mirror of
https://github.com/webmproject/libwebp.git
synced 2025-03-09 19:22:49 +01:00
pngdec.c: add support for 'eXIf' tag
Test file created with exiftool 12.76: ``` exiftool test_app1_exif.png -exif:all \ -exif:DocumentName=test_multi_exif.png -o test_multi_exif.png ``` Bug: webp:398066379 Change-Id: I1437390a70f5708421683eb69c588624bb376baa
This commit is contained in:
parent
319860e919
commit
565da14882
@ -161,6 +161,20 @@ static int ExtractMetadataFromPNG(png_structp png,
|
|||||||
png_textp text = NULL;
|
png_textp text = NULL;
|
||||||
const png_uint_32 num = png_get_text(png, info, &text, NULL);
|
const png_uint_32 num = png_get_text(png, info, &text, NULL);
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
|
|
||||||
|
#ifdef PNG_eXIf_SUPPORTED
|
||||||
|
// Look for an 'eXIf' tag. Preference is given to this tag as it's newer
|
||||||
|
// than the TextualData tags.
|
||||||
|
{
|
||||||
|
png_bytep exif;
|
||||||
|
png_uint_32 len;
|
||||||
|
|
||||||
|
if (png_get_eXIf_1(png, info, &len, &exif) == PNG_INFO_eXIf) {
|
||||||
|
if (!MetadataCopy((const char*)exif, len, &metadata->exif)) return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // PNG_eXIf_SUPPORTED
|
||||||
|
|
||||||
// Look for EXIF / XMP metadata.
|
// Look for EXIF / XMP metadata.
|
||||||
for (i = 0; i < num; ++i, ++text) {
|
for (i = 0; i < num; ++i, ++text) {
|
||||||
int j;
|
int j;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user