Bob Friesenhahn - 2017-05-27

Rather oddly, the GraphicsMagick Image structure does not store 'quality' and so quality is only stored in an ImageInfo structure used while writing the image (this attribute will eventually be added). After some investigation, I see if the attribute 'JPEG-Quality' is defined, then the value of this attibute takes precedence over the value stored in ImageInfo. The 'JPEG-Quality' attribute became defined when the JPEG file was first read. This attribute is peculiar to JPEG.

The attribute may be deleted via

image.attribute("JPEG-Quality", NULL);

and then the value which was set should appear again in formatExpression().