mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-12 22:14:29 +02:00
make ReadPNG and ReadJPEG take a filename instead of a FILE
-> read is a bit slower (memory allocation and such) than reading directly from disk. -> we're not yet ready to accept stdin as input (-- -) because we still need to guess the file type with GetImageType(). And since we can't rewind on stdin, this will need a bit more work before being able to read from stdin. Change-Id: I6491fac4b07d28d1854518325ead88669656ddbf
This commit is contained in:
@ -155,9 +155,9 @@ static int ReadPicture(const char* const filename, WebPPicture* const pic,
|
||||
}
|
||||
format = GetImageType(in_file);
|
||||
if (format == PNG_) {
|
||||
ok = ReadPNG(in_file, pic, keep_alpha, metadata);
|
||||
ok = ReadPNG(filename, pic, keep_alpha, metadata);
|
||||
} else if (format == JPEG_) {
|
||||
ok = ReadJPEG(in_file, pic, metadata);
|
||||
ok = ReadJPEG(filename, pic, metadata);
|
||||
} else if (format == TIFF_) {
|
||||
ok = ReadTIFF(filename, pic, keep_alpha, metadata);
|
||||
} else if (format == WEBP_) {
|
||||
|
Reference in New Issue
Block a user