mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
Merge "cwebp: name InputFileFormat members consistently"
This commit is contained in:
commit
54169d6cd7
@ -517,8 +517,8 @@ static int ReadTIFF(const char* const filename,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
PNG = 0,
|
PNG_ = 0,
|
||||||
JPEG,
|
JPEG_,
|
||||||
TIFF_, // 'TIFF' clashes with libtiff
|
TIFF_, // 'TIFF' clashes with libtiff
|
||||||
UNSUPPORTED
|
UNSUPPORTED
|
||||||
} InputFileFormat;
|
} InputFileFormat;
|
||||||
@ -535,9 +535,9 @@ static InputFileFormat GetImageType(FILE* in_file) {
|
|||||||
|
|
||||||
magic = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
|
magic = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
|
||||||
if (magic == 0x89504E47U) {
|
if (magic == 0x89504E47U) {
|
||||||
format = PNG;
|
format = PNG_;
|
||||||
} else if (magic >= 0xFFD8FF00U && magic <= 0xFFD8FFFFU) {
|
} else if (magic >= 0xFFD8FF00U && magic <= 0xFFD8FFFFU) {
|
||||||
format = JPEG;
|
format = JPEG_;
|
||||||
} else if (magic == 0x49492A00 || magic == 0x4D4D002A) {
|
} else if (magic == 0x49492A00 || magic == 0x4D4D002A) {
|
||||||
format = TIFF_;
|
format = TIFF_;
|
||||||
}
|
}
|
||||||
@ -556,9 +556,9 @@ static int ReadPicture(const char* const filename, WebPPicture* const pic,
|
|||||||
if (pic->width == 0 || pic->height == 0) {
|
if (pic->width == 0 || pic->height == 0) {
|
||||||
// If no size specified, try to decode it as PNG/JPEG (as appropriate).
|
// If no size specified, try to decode it as PNG/JPEG (as appropriate).
|
||||||
const InputFileFormat format = GetImageType(in_file);
|
const InputFileFormat format = GetImageType(in_file);
|
||||||
if (format == PNG) {
|
if (format == PNG_) {
|
||||||
ok = ReadPNG(in_file, pic, keep_alpha);
|
ok = ReadPNG(in_file, pic, keep_alpha);
|
||||||
} else if (format == JPEG) {
|
} else if (format == JPEG_) {
|
||||||
ok = ReadJPEG(in_file, pic);
|
ok = ReadJPEG(in_file, pic);
|
||||||
} else if (format == TIFF_) {
|
} else if (format == TIFF_) {
|
||||||
ok = ReadTIFF(filename, pic, keep_alpha);
|
ok = ReadTIFF(filename, pic, keep_alpha);
|
||||||
|
Loading…
Reference in New Issue
Block a user