GraphicsMagick ChangeLog
2025-06-13 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
magick/colorspace.c (TransformRGBImage): Validate that CineonLog parameters are in legal ranges. Addresses Coverity 470177 "Division or modulo by float zero".
coders/logo.c (EmbeddedImageList): Provide space for "VERTICALRIGHTSHINGLE" string termination.
2025-06-12 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
magick/utility.c (GetMagickGeometry): Skip resize computions given an area ('@') value of zero. Coverity 470174 "Division or modulo by float zero ".
magick/colorspace.c (RGBTransformImage): Validate that CineonLog parameters are in legal ranges. Addresses Coverity 470177, 470183, and 470184 "Division or modulo by float zero".
magick/describe.c (DescribeImage): Fix Coverity 470181 "Division or modulo by float zero". This is not likely to happen, but Coverity has no way to know that.
magick/render.c (DrawPolygonPrimitive): Coverity 470185 "Logically dead code". There is no actual issue of any consequence.
magick/pixel_cache.c (CheckImagePixelLimits): Change limit range check to avoid useless warning about "dead code". Coverity issue 470175 "Logically dead code" and 376900 "Operands don't affect result".
coders/rle.c (ReadRLEImage): Verify that integer returned by ReadBlobByte() is not EOF, and is in range of unsigned char before assigning value. Coverity issue 10235 "Negative loop bound".
coders/ps3.c (ZLIBEncode2Image): Assure that z_stream is ended in error case. Coverity issue 470178 "Resource leak".
coders/pdf.c (ZLIBEncodeImage): Assure that z_stream is ended in error case. Coverity issue 470180 "Resource leak".
coders/caption.c (ReadCAPTIONImage): NULL pointers which are no longer needed. Coverity issue 470182 about a memory leak via 'q' appears to be bogus.
magick/montage.c (CloneMontageInfo): Assure that memory allocated by GetMontageInfo() is freed, before overwriting the pointer to it with a new allocation. Coverity issues 470173, 470176, and 40179.
Makefile.am (coverity-build): Add a 'coverity-build' target, which only does the Coverity build, without submitting it for Coverity analysis.
coders/meta.c (ReadMETAImage): WriteBlob() does not perform partial writes so remove that apparent assumption.
2025-06-11 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
coders/meta.c (formatIPTC): Return immediately upon blob I/O error. (parse8BIM): Return immediately upon blob I/O error. (parse8BIMW): Return immediately upon blob I/O error.
2025-06-10 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
doc/options.imdoc (characters): Document that adding '!' to the geometry specification does change the image aspect ratio if necessary. Addresses GraphicsMagick feature request #48 "-geometry !".
2025-06-09 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
coders/png.c (WriteOnePNGImage): In error handler, check if image is null prior to attempting to dereference it. This issue is recently introduced. Should resolve oss-fuzz 423668251 "graphicsmagick:coder_PNG24_fuzzer: Null-dereference in WriteOnePNGImage". (WriteOnePNGImage): Fix recently-introduced typo which causes heap buffer overflow. Should resolve oss-fuzz 423417425 "graphicsmagick:coder_PNG8_fuzzer: Heap-buffer-overflow in WriteOnePNGImage".
NEWS.txt: Update the news.
magick/transform.c (TransformImage): If crop_geometry contains '%', that should not block a full list of image tiles from being generated. Resolves SourceForge issue #717 "-crop does not generate tiles when used with a percentage".
2025-06-08 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
NEWS.txt: Update the news.
coders/png.c (WriteOnePNGImage): Fix broken tRNS table when writing via "PNG8". Warn if pixel transparencies are independent of color palette, since this results in a loss of image quality. Remove output file if an error occurs. Addresses SourceForge issue #755 "Converting to indexed PNG produces invalid file".
2025-06-04 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
coders/wpg.c (ReadWPGImage): Fix improper usage of MagickReallocateResourceLimitedMemory(). Addresses oss-fuzz 422512441 "graphicsmagick:coder_WPG_fuzzer: Direct-leak in _MagickReallocateResourceLimitedMemory ()".
magick/resource.c (DestroyMagickResources): If DEBUG_MAGICK_RESOURCES is enabled, do not assert unless DEBUG_MAGICK_RESOURCES_ASSERT is also enabled. An assertion prevents valgrind from showing us where the leaks are.
magick/memory.c: Document that _MagickReallocateResourceLimitedMemory() returns a discrete pointer, similar to realloc(). This means it does not work the same as MagickReallocateMemory().
magick/tsd.c (MagickTsdKeyCreate2): Fix GCC -Wcalloc-transposed-args related warning.
2025-06-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
coders/svg.c: GetStyleTokens, GetTransformTokens, and SVGProcessTransformString should have a 'const SVGInfo *svg_info' argument rather than a wrong and misleading 'void *context' argument. Fixes a crash which was recently introduced. (ReadSVGImage): Fix some leaked memory resources, which were not leaked while using SVGEndDocument().
coders/msl.c (ReadMSLImage): Use libxml2's SAX handlers for the MVG XML-based scripting implementation. These changes are informed by Nick Wellnhofer's changes to ImageMagick's SVG renderer as provided in ImageMagick pull request 7784 at "https://github.com/ImageMagick/ImageMagick/pull/7784/commits/c0405a520b6e0e445dd8f70c1883125d2015c298". This should resolve the MVG portion of SourceForge issue #749 "Use libxml2's SAX handlers". (MSLInfo): Add signature to MSLInfo.
coders/svg.c (SVGInfo): Add signature to SVGInfo.
2025-05-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
coders/svg.c (ReadSVGImage): Use libxml2's SAX handlers for the SVG renderer. These changes are informed by Nick Wellnhofer's changes to ImageMagick's SVG renderer as provided in ImageMagick pull request 7784 at "https://github.com/ImageMagick/ImageMagick/pull/7784/commits/c0405a520b6e0e445dd8f70c1883125d2015c298". This should resolve the SVG portion of SourceForge issue #749 "Use libxml2's SAX handlers".
2025-05-27 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
fuzzing/oss-fuzz-build.sh: Now that libpng configure.ac has been fixed upstream, restore 'autoreconf -fiv' step when building libpng.
2025-05-23 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
coders/tiff.c: Add support for libtiff 4.5 TIFFWarningExtR() and TIFFErrorExtR() in order to provide an error handling context per TIFF handle. This improves concurrency and thread safety when multiple libraries are using libtiff within the same process. Resolves SourceForge issue #753 "Support TIFFErrorExtR() in TIFF coder".
2025-05-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
scripts/format_c_api_doc.py (proto_pretty): Fix regular expression encoding.
2025-05-18 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
coders/xpm.c (ParseColor): Avoid truncation of nul character from "g4 ".
coders/logo.c (EmbeddedImageList): Avoid truncation of nul character from "VERTICALRIGHTSHINGLE".
magick/utility.c (GetPageGeometry): Avoid truncation of nul character from "LETTERSMALL".
magick/attribute.c: Avoid truncation of nul character from "ThumbnailPrimaryChromaticities".
fuzzing/README.txt: Add notes regarding how to build libjxl for testing.
2025-05-17 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
coders/jxl.c (ReadJXLImage): More effort to free profile memory if JxlDecoderSetBoxBuffer() fails. Addresses oss-fuzz issue "graphicsmagick:coder_TIFF_any_fuzzer: Direct-leak in _MagickReallocateResourceLimitedMemory". Maybe this will fix it.
2025-05-13 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
magick/magick_types.h.in: Retreat from use of C'99 printf macros. The approach used was not working out, and especially under Microsoft Windows. This means that most changes made yesterday are reverted.
2025-05-12 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
www/INSTALL-windows.rst: Suggest that GraphicsMagick now requires (or will soon require) at least a working C'99 compiler and headers in order to compile under Microsoft Visual Studio. Visual Studio support will re-start from Visual Studio 2019 rather than the 2008 edition.
magick/magick_types.h.in: Use types and declarations from inttypes.h and stddef.h rather than values from the configure script. It seems long enough since 1999 that we can rely on these headers now. ;-)
configure.ac: Remove code to compute sized types for current CPU and compiler options.
2025-05-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
coders/jxl.c (ReadJXLImage): Free profile memory if JxlDecoderSetBoxBuffer() fails. Addresses oss-fuzz issue "graphicsmagick:coder_TIFF_any_fuzzer: Direct-leak in _MagickReallocateResourceLimitedMemory".
fuzzing/oss-fuzz-build.sh: Disable 'harfbuzz' in freetype build in order to avoid compilation error due to use of RTLD_DEFAULT.
2025-03-31 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
NEWS.txt: Update the news.
2025-03-26 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
coders/jxl.c (ReadJXLImage): pixel_format.num_channels needs to be 2 for grayscale matte. Addresses oss-fuzz 406320404 "graphicsmagick:coder_JXL_fuzzer: Heap-buffer-overflow in ImportViewPixelArea".
2025-03-17 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
coders/tiff.c (AddIFDExifFields): Check for overflow of computed unsigned value. Code is only active if EXPERIMENTAL_EXIF_TAGS is true. Addresses oss-fuzz 403696329 "graphicsmagick:coder_TIFF_any_fuzzer: Crash in LD_UINT16_HI".
Reflow code to match the conventions used by the rest of the project.
2025-03-16 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
NEWS.txt: Updated the news.
fuzzing/oss-fuzz-build.sh (CPPFLAGS): Continue to enable EXPERIMENTAL_EXIF_TAGS in oss-fuzz build in order to continue testing writing EXIF in TIFF format.
coders/tiff.c (EXPERIMENTAL_EXIF_TAGS): Disable EXPERIMENTAL_EXIF_TAGS by default until libtiff API weaknesses are resolved.
2025-03-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
coders/jp2.c (ReadJP2Image): Add casts in order to avoid compilation warnings with old Jasper.
2025-03-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
README.txt: Refresh README text.
2025-02-14 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
wand/magick_wand.c: Fix comment indentation issue which was causing some functions to not appear in the formatted documentation. Thanks to Robert C. <robgcs@users.sourceforge.net> for reporting that documentation for some functions were missing.
2025-02-11 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
magick/nt_base.h: Update notes regarding _MSC_VER values and Visual C++ versions.
www/index.rst: Promote the Mercurial repository at https://foss.heptapod.net/graphicsmagick/graphicsmagick since it seems to work better.
2025-02-08 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
magick/magic.c: Make the magic-based format descriptions more detailed and helpful.
2025-02-07 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
magick/magic.c (ListMagicInfo): Include a format description in the output of 'gm convert -list magic'.
2025-02-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
magick/magic.c: Add a Magic description field in order to help identify and document format variants based on header magic. (GetMagickFileFormat): Trace the format description at Coder level.
2025-01-29 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
coders/png.c (WriteOnePNGImage): Ignore exessively short ICM profiles. Should address oss-fuzz 392927700 "graphicsmagick:coder_PNG64_fuzzer: Heap-buffer-overflow in png_write_iCCP".
magick/magic.c (StaticMagic): Identify some more HEIF sub-formats.
coders/heif.c (ReadHEIFImage): Request the primary image handle from libheif. Do not throw an error if there is more than one image in the heif. Patch by Kevin Clauson and submitted via SourceForge patch #84 "Patch: use primary image for heic even when have multiple image".
2025-01-25 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
coders/heif.c (ReadMetadata): Only apply Exif orientation if ignore-transformations is true since HEIF native transformations will handle orientation otherwise. Patch by Kevin Clauson via GraphicsMagick SourceForge patch #83 "Patch: Fix HEIC Orientation Issue".
2025-01-24 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
wand/magick_wand.c (MagickSetImagePixels): If update image has matte, then promote canvas image to have matte. Support composing individual channels 'R', 'G', 'B', 'A', 'O', 'T', 'C', 'M', 'Y', 'K'. Intended to address SourceForge issue #752 "MagickResizeImage() discarding alpha values".
2025-01-17 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
tests/rwfile.c: Fix another GCC warning.
2025-01-15 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
NEWS.txt: Update the news.
coders/jpeg.c (WriteJPEGImage): Properly invert CMYK components when writing. Addresses SourceForge bug #751 "all CMYK colorspace image become black-white inverted". This bug was introduced in GraphicsMagick 1.3.43. Existing files which appear "corrupt" due to this issue may be salvaged by using the -negate command like "gm convert bad-cmyk.jpg -negate good-cmyk.jpg".
www/INSTALL-unix.rst: Document the Docutils version necessary to format reStructuredText files to HTML format.
2025-01-06 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
www/wand/Makefile.am ($(WWWWANDAPIDIR)/%.apirst): Pass an absolute path to format_c_api_doc.py --include-rst argument.
magick/magick_endian.c (MagickReverseBits): Function has never been used for anything. Mark it as deprecated. MagickGetBitRevTable(): Function has never been used for anything. Mark it as deprecated.
2025-01-04 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
NEWS.txt: Update the news.
Update copyright year and rotate ChangeLog.