./graphics/GraphicsMagick, Tools and libraries for reading, writing, and manipulating images

[ Image CVSweb ] [ Image Homepage ] [ Image RSS ] [ Image Required by ]


Branch: CURRENT, Version: 1.3.48, Package name: GraphicsMagick-1.3.48, Maintainer: pkgsrc-users

GraphicsMagick(TM) provides a powerful image manipulation and
translation utility. It is capable of displaying still images and
animations using the X Window system, provides a simple interface for
interactively editing images, and is capable of importing selected
windows or the entire desktop. GraphicsMagick can read and write over
88 image formats, including JPEG, TIFF, WMF, SVG, PNG, PNM, GIF, and
Photo CD. It can resize, rotate, sharpen, color reduce, or add
special effects to the image and save the result to any supported
format. GraphicsMagick may be used to create animated or transparent
.gifs, create composite images, create thumbnail images, and much,
much, more.

GraphicsMagick is one of your choices if you need a program to
manipulate and display images. If you want to develop your own
applications which use GraphicsMagick code or APIs, you need to
install GraphicsMagick-devel as well.


Required to run:
[textproc/libxml2] [graphics/tiff] [graphics/freetype2] [graphics/png] [graphics/jpeg] [devel/libltdl] [graphics/jbigkit] [fonts/urw-fonts] [graphics/lcms2] [graphics/libwebp] [devel/pkgconf] [archivers/zstd]

Required to build:
[pkgtools/x11-links] [pkgtools/cwrappers]

Package options: x11

Master sites:

Filesize: 5939.285 KB

Version history: (Expand)


CVS history: (Expand)


   2026-08-01 16:28:46 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
GraphicsMagick p5-GraphicsMagick: updated to 1.3.48

1.3.48

Security Fixes:

Address ImageMagick CVE CVE-2026-42050, ImageMagick security advisory \ 
GHSA-7mxf-ff4f-jj7p, which is related to an X11 display buffer overflow. This is \ 
really a minor issue since it requires X11 keyboard input and causes no harm.
DCM: In RLE decoder, detect and report end of input. Reported-by: Tristan Madani.
DCM: Convert from ASCII numeric value to unsigned value, with error detection. \ 
Avoid problems caused by negative values. Reported-by: Tristan Madani.
display: Correct bounds checking for 'filename' length. Thanks to Petr Gajdos \ 
for a heads-up regarding the disparity.
GradientImage(): Fix 'pixel_packets' and 'indexes' addressing logic for \ 
NorthGravity. Addresses "[security] GraphicsMagick GradientImage: \ 
heap-buffer-overflow READ in NorthGravity branch reached from gm convert \ 
(magick/gradient.c:284)" from David Korczynski. Credit to Anthropic Claude \ 
and Ada Logics.
ImageToBlob(): Fix memory leak which may occur if WriteImage() fails.
LOCALE: Bound the length passed to strncpy() and string terminator. Addresses \ 
"[security] GraphicsMagick LOCALE coder: stack-buffer-overflow WRITE in \ 
ReadConfigureFile reached from gm convert (coders/locale.c:257)" from David \ 
Korczynski. Credit to Anthropic Claude and Ada Logics.
META/IPTC: Prevent reading past the end of a truncated/short IPTC profile.
MIFF: Correct scope of 'values' reallocation error handling. Addresses \ 
"[security] GraphicsMagick MIFF reader: heap-use-after-free WRITE via stale \ 
cursor on values-buffer realloc failure (coders/miff.c:1048)" from David \ 
Korczynski. Credit to Anthropic Claude and Ada Logics.
MSL: Properly log warnings and errors using LogMagickEventList() given a \ 
va_list. Reported-by: Tristan Madani.
PCD: Over-provision the per-channel Huffman decode buffers and detect any \ 
attempt to overflow them. Discovered and reported by Cipher - Causal Security \ 
(https://causalsecurity.com/).
PCX: If image has more than 256 colors, save as a DirectClass type. Addresses \ 
"[security] GraphicsMagick PCX writer: heap-buffer-overflow WRITE in \ 
WritePCXImage colormap fill (coders/pcx.c:1186)" from David Korczynski. \ 
Credit to Anthropic Claude and Ada Logics.
PNG: Use only values from GetImageCharacteristics() since IsMonochromeImage() \ 
and IsGrayImage() may produce different answers. Addresses "[security] \ 
GraphicsMagick MNG re-encode: heap-buffer-overflow WRITE in \ 
ExportGrayAlphaQuantumType reached from gm convert (magick/export.c:1105)" \ 
as reported by David Korczynski via email on May 28, 2026. Credit to Anthropic \ 
Claude and Ada Logics.
SVG: Properly log warnings and errors using LogMagickEventList() given a \ 
va_list. Reported-by: Tristan Madani.
TIFF: Add many more validations and safeguards to EXIF in TIFF writer. Addresses \ 
"[security] GraphicsMagick TIFF writer: heap-buffer-overflow WRITE in \ 
AddIFDExifFields via 32-bit count*2 wrap on EXIF SHORT array \ 
(coders/tiff.c)" from David Korczynski. Credit to Anthropic Claude and Ada \ 
Logics.
TIFF: If EXIF profile string is not already NUL terminated, assure that it is \ 
NUL terminated before passing it to libtiff. Reported-by: Tristan Madani.
TIFF: In AddIFDExifFields(), address possible out of bounds read (2 bytes) \ 
beyond the end of the allocated profile buffer. Reported-by: Tristan Madani.
VIFF: Memory leak fix (ImageMagick CVE-2026-61870).

Bug fixes:

configure.ac: Fixes so Freetype and zlib may be detected if pkg-config is not \ 
available.
PICT: Remove the attempt to intuit byteCount must be a word because the approach \ 
used does not work reliably. This means that defective PICT files previously \ 
written by ImageMagick or GraphicsMagick may fail to be read.
VIFF: Fixes so remaining Khoros VIFF sample files sample files from the \ 
Encyclopedia Of Graphics File Formats which are based on integer data storage \ 
types read correctly.
   2026-06-29 14:02:13 by Adam Ciarcinski | Files touched by this commit (1)
Log message:
GraphicsMagick: better PLIST
   2026-06-29 14:00:29 by Adam Ciarcinski | Files touched by this commit (8) | Package updated
Log message:
GraphicsMagick p5-GraphicsMagick: updated to 1.3.47

1.3.47

Security Fixes:

DPX: Fix subsampling validation logic which was failing due to incorrect logic. \ 
This avoids a divide by zero possibility.
JNG writer: Properly handle and report the case where ImageToBlob()returns NULL.
MNG writer: Enforce that MNG only supports a color palette up to 256 colors \ 
(ImageMagick CVE-2026-28690).
MagickXImageWindowCommand(): Assure that static buffer does not overflow if the \ 
user keeps a numeric key depressed (ImageMagick CVE-2026-33535).
PCD: Prevent an out of bounds read (ImageMagick security advisory \ 
GHSA-wrhr-rf8j-r842).
PNG writer: Detect and report an excessively large profile, an other unexpected \ 
conditions (ImageMagick CVE-2026-30883).
RenderFreetype(): Use MagickConfirmAccess() to verify that font file name is \ 
allowed to be read.
TIFF EXIF IFD writer: Detect and prevent infinite looping (EXIF IFD writer code \ 
may be excluded by the -DEXPERIMENTAL_EXIF_TAGS=0 define).
TIFF EXIF IFD writer: Only transfer tags from EXIF and GPS IFDs. Do not transfer \ 
tags from the main IFDs.
YUV: Fix validation of 'sampling-factor' argument. (ImageMagick CVE-2026-25799). \ 
Given that the argument normally comes from a user (rather than an input file) \ 
this seems to be a minor security issue at most.
PS, PS2, PS3: Enforce that width and height dimensions, and total pixels, \ 
to/from Ghostscript are within the same limits as specified for GraphicsMagick. \ 
This helps avoid Ghostscript-based denial of service opportunities.
SVG: Add validations for element id syntax. Reject invalid attribute values \ 
which contain single quotes.
XCF: Report an error if there are no layers. Fix two unsigned integer overflow cases.
DescribeImage(): Avoid heap write overflow while parsing the image directory.
Bug fixes:

ColorFloodfillImage(): Disable OpenMP since it was observed to create corrupt images.
DCM/DICOM: Fix bit shift for 16-bit short, which corrupted results for some images.
DrawImage(): Fix memory leak which might occur under severe conditions.
Magick++: Use HAVE_PTHREAD to enable thread-safe code. This bug has been present \ 
since 2003!
Magick++: If monochrome is disabled, then clear the image is_monochrome flag if \ 
it is set.
Magick++: No longer throw a C++ exception from the MutexLock destructor.
JP2: Fix a bug which caused lossless compression to not be engaged by '-define \ 
jp2:rate=1.0'.
JPEG: Allow writing CMYK JPEG without specifically requesting it (SourceForge \ 
issue 768). This fixes a regression introduced in the last release.
JPEG: For components == 1 (gray), fix reading PseudoClass images.
ModuleAliases: Added a mapping from magick "MPRI" to module \ 
"MPR". This missing mapping caused the "MPRI" coder to not \ 
work for non-module builds. As a result, the 'mogrify' "hald-clut", \ 
"map", "mask", and "tile" subcommands were not \ 
working. Any use of "MPRI:N" syntax to save an image for later (from \ 
the command-line or via the APIs) would have failed.
HEIF: Check the return status of \ 
heif_image_handle_get_preferred_decoding_colorspace() in order to avoid \ 
consuming uninitialized memory. While this might appear to be a security issue, \ 
it appears to be reasonably benign.
Apple PICT: Since the implementation originating from ImageMagick, the rowBytes \ 
transition from from byte to short while reading byteCount was 200. However, it \ 
should have been 250! See \ 
"https://github.com/ImageMagick/ImageMagick/issues/7837" for details. \ 
The reader and writer have been changed to use 250. This means that PICT files \ 
written by the fixed GraphicsMagick will not be readable by older GraphicsMagick \ 
versions (but the fixed GraphicsMagick can read older existing files).
PNM: Improve ASCII formats error checking.
HEIF (HEIC, AVIF, etc.): The identify command was very slow with HEIF, although \ 
it always reported accurate information. Now identify is fast but may return \ 
wrong results if the image is rotated. Use '-define \ 
heif:ignore-transformations=false' to assure that the values returned are \ 
accurate.
TIFF: Be more pessimistic about claims from libtiff and require that it produce \ 
a scanline, strip, or tile, before allocating pixels from the pixel cache. This \ 
helps prevent small files from using excessive resources.
Rendering (-draw/MVG): use the resource-limited memory allocator to provide more \ 
resource limit control (for primitive info and graphic contexts).
GIF: Store image comment in first image frame rather than the last frame.
Add missing prototypes for some functions and declare some functions as 'static' \ 
which were accidentally left visible.
PerlMagick: PerlMagick is now "const correct" and data which could be \ 
const is now declared as such.
MAT: Fix memory leaks.
XPM/PICON: Verify that the expected number of pixels were transferred to the image.
SetImageType(): Assure that callers of SetImageType() do check for its failure, \ 
and return appropriate status.
API Updates:

Wand API: Added the MagickSetBackgroundColor() function to support setting the \ 
default background color.
Drawing API: DrawNewContext(), is a new function to allocate an empty drawing \ 
context.
Wand API: The wand/drawing_wand.c functions which duplicate code in \ 
magick/draw.c are gutted and replaced with calls into magick/draw.c.
Magick++: Add access confirmation functions and enumerations to Magick namespace \ 
so that file/URL access confirmation functions may be used. A sample \ 
implementation is included in the 'zoom' demo program.
New Features:

PNM: Support reading PBM raw (P1), PGM raw (P2), and PPM raw (P3) files which \ 
lack a newline character at the end of the last line.
HEIF (HEIC, AVCI, AVIF, MP4, etc.): Memory limits and many more libheif resource \ 
limits are now applied/available. Support reading multiple image frames. Support \ 
arbitrary image depths up to 16 bits. Deduce file type by consulting libheif. \ 
Support reading HEIF image from an in-memory BLOB, or memory mapped file.
HEIF (HEIC, AVCI, AVIF, MP4, etc.): Support both RGB interleaved and planar \ 
decode modes at once. Use the heif:interleaved-rgb-decode=yes/no define to \ 
select which mode is used.
HEIF (HEIC, AVCI, AVIF, MP4, etc.): Add support for -define \ 
heif:tile-threads=number to specify how many tiles may be decoded at once.
The 'convert' and 'mogrify' subcommands now support -remap, which is equivalent \ 
to -map. This is to improve compatibility with ImageMagick, which changed from \ 
-map to -remap some time after the GraphicsMagick fork in 2022.
Command arguments which currently accept "Opacity" now accept \ 
"Alpha" as a synonym. This is to improve compatibility with \ 
ImageMagick
Command arguments which currently accept "CopyOpacity" now accept \ 
"CopyAlpha" as a synonym. This is to improve compatibility with \ 
ImageMagick.
Resource Limited Memory: Added module, function, and line parameters for the \ 
purpose of tracing, and to capture the source location where the allocation was \ 
made.
Resource limit for number of simultaneous images: Add an 'ImagesResource' limit \ 
and '-limit images' to place a limit on discrete raster images which may be \ 
loaded into the program simultaneously. The resource which is limited is the \ 
number of Image pixel cache stores with allocated pixels rather than \ 
reference-counted "Image" handles.
WBMP: Support alternate file extensions "WBM" and "WBP".
OSS-Fuzz: The oss-fuzz build script is completely re-written and supports \ 
building almost all of the available library dependencies.
TIFF: Added support for LERC compression in TIFF reader and writer, as welll as \ 
update Magick++, PerlMagick, and TclMagick to be able to access it.
Behavior Changes:

Apple PICT: Older GraphicsMagick will be unable to read the PICT files that \ 
newer versions write, but newer GraphicsMagick can still read files which were \ 
written by ImageMagick or GraphicsMagick in the broken format.
C API: MagickRealloc() now behaves like standard realloc() and the \ 
MagickReallocMemory() macro takes responsibility for freeing the original memory \ 
upon a reallocation failure.
Rendering (-draw/MVG): The default image canvas color is now the background \ 
color (default white), which may be transparent. Previously, the image was \ 
always set to opaque.
General Implementation Improvements:

FormatString(): Deprecate FormatString(), and replace all usages with \ 
MagickFormatString(), or a suitable equivalent. Code previously depended on many \ 
string buffers being allocated with size 'MaxTextExtent' to avoid buffer \ 
overflow. The updates result in MagickFormatString() being passed the actual \ 
underlying buffer size in most cases (except for when the API design prevents \ 
it). This allows underlying buffer sizes to be optimially-sized, but that has \ 
not been done yet.
   2026-05-14 18:42:34 by Ryo ONODERA | Files touched by this commit (1335)
Log message:
*: Recursive revbump from security/nettle-4.0
   2026-04-20 20:14:10 by Adam Ciarcinski | Files touched by this commit (45)
Log message:
revbump for x265
   2026-02-06 11:06:21 by Thomas Klausner | Files touched by this commit (1305)
Log message:
*: recursive bump for nettle 4.0 shlib major bump
   2026-01-07 09:49:50 by Thomas Klausner | Files touched by this commit (2525)
Log message:
*: recursive bump for icu 78.1
   2025-10-23 22:40:24 by Thomas Klausner | Files touched by this commit (2999)
Log message:
*: recursive bump for pcre2

Running an old binary against the new pcre doesn't work:
/usr/pkg/lib/libpcre2-8.so.0: version PCRE2_10.47 required by \ 
/usr/pkg/lib/libglib-2.0.so.0 not defined