mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-12 22:14:29 +02:00
Introduce a generic WebPGetImageReader(type) function
Also introduce an always-failing 'reader' for unknown formats. So we don't have to check reader==NULL, code is more regular. -> We can get read of specific ReadPNG(), ReadJPEG(), ... declaration and use. Change-Id: I290759705420878f00c7223c726d4ad404afd9c4
This commit is contained in:
committed by
James Zern
parent
4eb5df28d1
commit
ce8733209d
@ -107,7 +107,7 @@ static int ReadPicture(const char* const filename, WebPPicture* const pic,
|
||||
|
||||
if (pic->width == 0 || pic->height == 0) {
|
||||
WebPImageReader reader = WebPGuessImageReader(data, data_size);
|
||||
ok = (reader != NULL) && reader(data, data_size, pic, keep_alpha, metadata);
|
||||
ok = reader(data, data_size, pic, keep_alpha, metadata);
|
||||
} else {
|
||||
// If image size is specified, infer it as YUV format.
|
||||
ok = ReadYUV(data, data_size, pic);
|
||||
|
Reference in New Issue
Block a user