Add limited PAM decoding support

Should support RGB / RGB_ALPHA / GRAYSCALE correctly, though

Change-Id: Idb1470581ebdfc6efee73009b2abd53889e901cb
This commit is contained in:
Pascal Massimino
2017-03-02 04:37:23 -08:00
parent 976adac1ce
commit 17e3c11f99
2 changed files with 149 additions and 50 deletions

View File

@ -31,8 +31,8 @@ WebPInputFileFormat WebPGuessImageType(const uint8_t* const data,
format = WEBP_WEBP_FORMAT;
} else if (((magic1 >> 24) & 0xff) == 'P') {
const int type = (magic1 >> 16) & 0xff;
// we only support 'P5' and 'P6' for now.
if (type >= '5' && type <= '6') format = WEBP_PNM_FORMAT;
// we only support 'P5 -> P7' for now.
if (type >= '5' && type <= '7') format = WEBP_PNM_FORMAT;
}
}
return format;