From: Dirk Lemstra Date: Fri, 7 Dec 2018 19:45:16 +0000 (+0100) Subject: Set attribute when the image contains an acTL chunk to make it possible to detect... X-Git-Tag: 7.0.8-16~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a7ac23af498532443ccbfe1941a140100255502;p=imagemagick Set attribute when the image contains an acTL chunk to make it possible to detect if the image is APNG. --- diff --git a/coders/png.c b/coders/png.c index d89e85296..59c7057cc 100644 --- a/coders/png.c +++ b/coders/png.c @@ -1969,6 +1969,8 @@ static int read_user_chunk_callback(png_struct *ping, png_unknown_chunkp chunk) Image *image; + PNGErrorInfo + *error_info; /* The unknown chunk structure contains the chunk data: png_byte name[5]; @@ -1994,9 +1996,6 @@ static int read_user_chunk_callback(png_struct *ping, png_unknown_chunkp chunk) { /* process eXIf or exIf chunk */ - PNGErrorInfo - *error_info; - (void) LogMagickEvent(CoderEvent,GetMagickModule(), " recognized eXIf chunk"); @@ -2069,6 +2068,19 @@ static int read_user_chunk_callback(png_struct *ping, png_unknown_chunkp chunk) return(1); } + /* acTL */ + if ((chunk->name[0] == 97) && (chunk->name[1] == 99) && + (chunk->name[2] == 84) && (chunk->name[3] == 76)) + { + image=(Image *) png_get_user_chunk_ptr(ping); + error_info=(PNGErrorInfo *) png_get_error_ptr(ping); + + (void) SetImageProperty(image,"png:acTL","chunk was found", + error_info->exception); + + return(1); + } + return(0); /* Did not recognize */ } #endif /* PNG_UNKNOWN_CHUNKS_SUPPORTED */