* Don't write a PNG text chunk with "density" keyword that overrides the
PNG pHYs chunk, if the pHYs chunk was not excluded (reference
http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=18225).
+ * Ignore any PNG text chunk with a "density" keyword found by the PNG
+ decoder, if the PNG datastream also contains a pHYs chunk.
2011-03-06 6.6.8-2 Cristy <quetzlzacatenango@image...>
* Support the Radiance HDR image format.
}
*value='\0';
(void) ConcatenateMagickString(value,text[i].text,length+2);
- (void) SetImageProperty(image,text[i].key,value);
+
+ /* Don't save "density" property if we have a pHYs chunk */
+ if (LocaleCompare(text[i].key,"density") != 0 ||
+ !png_get_valid(ping,ping_info,PNG_INFO_pHYs))
+ (void) SetImageProperty(image,text[i].key,value);
if (logging != MagickFalse)
{