7323 Commits

Author SHA1 Message Date
Cristy 635006fc10 release icon directory 2026-04-18 11:59:35 -04:00
Dirk Lemstra f7496a3751 Call CloseBlob on the correct image to prevent the blob from remaining open (dlemstra/Magick.NET/issues/1997) 2026-04-18 14:28:49 +02:00
Dirk Lemstra ea1d15bf80 Make another variable volatile. 2026-04-18 12:36:22 +02:00
Dirk Lemstra c9ccc99f71 Fix missing volatile on quantum_info in WriteOnePNGImage 2026-04-18 00:31:25 +02:00
Nicolas Cornu b074bd9ce7 Fix JXL orientation when writing. (#8673)
JXL documentation told us to ignore EXIF because orientation is
encoded in the stream itself.
ImageMagick was keeping the EXIF but not setting the stream.
Both should be kept and synchronized.
2026-04-17 18:12:18 +02:00
Dirk Lemstra 2d6a2bb8bc Added extra checks for older version of libxml2 that can raise errors inside xmlCreatePushParserCtxt. 2026-04-17 11:58:44 +02:00
Dirk Lemstra 3da25c642d Corrected the patch that was made earlier to fix reading JPEG compressed TIFF images (dlemstra/Magick.NET/issues/1993) 2026-04-14 23:11:52 +02:00
Dirk Lemstra d2fc148ac1 Cosmetic 2026-04-11 21:16:24 +02:00
Dirk Lemstra cddcd139b8 Code style changes. 2026-04-11 21:14:38 +02:00
Rafael Niebles 6c5f330bbf Support for 4-bit (indexed 16-color) PCX (#8655)
* setting plane count and bit depth

* setting image type to palette type to mirror setimagemonochrome's logic

* working version 1

* unit tests

* leave extra unit tests only

* improve code style

* rm magicktype header

* rm comment

* rm am makefile

* leave extra unit tests only

* put unit tests in right place!

* restore makefile.am from tests

* remove tests

* remove extra newlines to match style

* remove extra newlines to match style in if/elses

* remove palettetype setting

* use correct naming in if/else

* windows build fix

Co-authored-by: Dirk Lemstra <dirk@lemstra.org>

---------

Co-authored-by: Dirk Lemstra <dirk@lemstra.org>
2026-04-11 21:13:10 +02:00
Dirk Lemstra c062b1d014 Meta channels are not support when the image has a colormap. 2026-04-10 21:59:55 +02:00
Dirk Lemstra d94e28638e Use a name that is more consistent with the rest of the naming in the file. 2026-04-10 21:46:41 +02:00
Cristy 2a06c7be3b https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-5xg3-585r-9jh5 2026-04-09 14:33:04 -04:00
Dirk Lemstra 1c7767fc5f Patch to correct the sample size for 16 bit floats in the JXL encoder (GHSA-jvgr-9ph5-m8v4) 2026-04-09 18:41:09 +02:00
Cristy 476854241a https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-2442-cq27-vf6x 2026-04-09 10:49:25 -04:00
Cristy 3d653bea2d https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-pwg5-6jfc-crvh 2026-04-09 10:39:06 -04:00
Cristy ca761f220b https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-x928-4434-crqj 2026-04-09 10:18:13 -04:00
Dirk Lemstra 51291c3885 Minor readability change. 2026-04-09 15:36:24 +02:00
Dirk Lemstra b8d0cd4ef0 Fix incorrect orientation of JPEG compressed TIFF images (dlemstra/Magick.NET/issues/1991) 2026-04-09 14:27:23 +02:00
Madars ecae45e659 Fix MNG animation speed for sub-frame animations with offsets (#8666)
Skip writing FRAM mode 4 disposal chunks in WriteOnePNGImage when
DEFI handles frame positioning. The extra FRAM chunks with delay=0
were conflicting with the FRAM mode 3 already set by WriteMNGImage,
causing incorrect playback speed.
2026-04-09 10:08:09 +02:00
Dirk Lemstra 2d4494cba3 Corrected check to avoid possible overflow. 2026-04-09 07:58:30 +02:00
Cristy a20f8f9747 reset VID filename 2026-04-08 22:32:17 -04:00
Cristy f86452a8ae https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-5592-p365-24xh 2026-04-08 22:08:36 -04:00
Dirk Lemstra 8cb2a8ebbe Added support for writing meta channels to the PSD coder (#8393) 2026-04-08 06:34:13 +02:00
Dirk Lemstra 0836fbb65b Updated comment to make it clear what the current default behavior is. 2026-04-07 20:43:39 +02:00
Dirk Lemstra 92172c44e3 Added option (icon:png-compression-size) to the icon decoder that can be use the specify the minimum size when png compression should be used (#2394) 2026-04-07 06:37:52 +02:00
Dirk Lemstra 22faaddf9d Use a better name for the image. 2026-04-06 20:13:48 +02:00
Dirk Lemstra a330f3ff40 Improved name of variable. 2026-04-06 15:43:15 +02:00
Madars 9505e6f886 Fix JXL animated export transparent blending and offset frames (#8656)
* Fix JXL animated export transparent blending and offset frames

- Enforced alpha_trait normalization using TransparentAlphaChannel for missing alpha channels to prevent solid white backgrounds when converting sequences containing mixed transparencies.
- Removed strict geometry checks from JXLSameFrameType inside JXL encoder and moved buffer allocation natively into the sequential frame loop to accurately allocate dynamically varying dimensions.
- Populated JxlFrameHeader layer info parameters (have_crop, crop_x0, etc) to appropriately support animation sub-frames.
- Correctly parsed image->previous->dispose property to map ImageMagick's dispose rules straight into JXL's blendmode behaviors (JXL_BLEND_REPLACE vs JXL_BLEND_BLEND) safely on both color and alpha channels.

* Variable name frame makes more sense than next in this context

* Fix white areas in animated JXL exports by using OpaqueAlphaChannel instead of TransparentAlphaChannel

* Rename next variable to frame in JXLSameFrameType
2026-04-06 15:38:24 +02:00
Madars 09e0ad32e6 Fix AVIF animation export error on sequences with mixed alpha (#8657)
* Fix AVIF/HEIC animation export error on sequences with mixed alpha bounds

- Normalizes alpha traits via TransparentAlphaChannel prior to heif frame processing, similar to JXL, fulfilling libheif's strict requirement to uniformly present either an alpha channel across every frame or entirely omit alpha tracking.

* Variable name frame makes more sense than next in this context
2026-04-05 23:17:15 +02:00
Dirk Lemstra f20b42813d Whitespace. 2026-03-31 22:24:02 +02:00
Dirk Lemstra 23d609d285 Use the correct bit depth when reading a PNG bKGD (#8485) 2026-03-31 19:29:53 +02:00
Dirk Lemstra 7ac2dccf3e Use a cast to double instead of a multiplication. 2026-03-31 19:29:53 +02:00
Dirk Lemstra 7e78a4058d Corrected version check. 2026-03-29 23:44:30 +02:00
Dirk Lemstra 26ca4ee01e Added option that can be used to fix the byte order of a DICOM image. 2026-03-28 09:27:35 +01:00
Cristy 54254cf74d https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-98cp-rj9f-6v5g 2026-03-25 20:27:04 -04:00
Cristy 1e87687ba0 sync image pixels before writing 2026-03-25 08:42:36 -04:00
Cristy 52d2e9c2f9 conditional compile 2026-03-25 08:30:52 -04:00
Madars 741d4d2403 Fix APNG output duration/framerate (#8639)
When writing APNG via ffmpeg in the VIDEO coder, ImageMagick bypasses the frame
duplication hack (by setting length_of_delay_loop = 1). As a result, exactly one
intermediate file is passed to ffmpeg for each original frame. Because ffmpeg
assumes 25 fps for image sequence inputs and no framerate was explicitly passed,
the output APNG was always forced to exactly 25 fps (40ms per frame), ignoring
the actual image delay.

This commit appends a precise setpts and -r override to the ffmpeg options
for APNG outputs, stretching or squeezing the input PTS perfectly to match
the requested time_per_frame and ensuring the correct APNG metadata is written.
2026-03-25 05:54:52 -04:00
Madars e18c0ce8d3 Animated AVIF support (libheif 1.20.0+) (#8640)
* Add animated AVIF (image sequence) reading support via libheif sequence API

Use heif_sequences.h track API (libheif >= 1.19.0) to decode animated
AVIF files. When a HEIF container has an image sequence, frames are
decoded from the visual track with proper per-frame delay/timing
derived from the track timescale. Falls back to the existing top-level
images approach for non-animated files.

Key changes:
- Include heif_sequences.h for libheif >= 1.19.0
- Add ReadHEICSequenceFrames() using heif_track_decode_next_image()
- Detect sequences with heif_context_has_sequence() before falling
  back to the primary image / top-level images path
- Set ticks_per_second from track timescale, delay from frame duration
- Properly propagate alpha trait and BackgroundDispose to all frames

* Add animated AVIF sequence writing support via libheif track API

When writing AVIF with multiple frames (adjoin mode), use the libheif
sequence track API (>= 1.19.0) to produce proper animated AVIF output
instead of encoding frames as separate top-level images.

Key changes:
- Add WriteHEICSequenceImage() that creates a visual sequence track
  and encodes frames with heif_track_encode_sequence_image()
- Set track timescale from image->ticks_per_second and frame duration
  from image->delay via heif_track_options_set_timescale() and
  heif_image_set_duration()
- Set sequence-level timescale with heif_context_set_sequence_timescale()
  to ensure proper duration computation in the output file
- Route multi-frame AVIF writes through the sequence writer in
  WriteHEICImage(), falling back to the existing still-image path
  for single frames and non-AVIF formats
- Supports quality, speed, chroma, and ICC profile options

* Some checks and cleanup

* Fix error handling logic in heic writer loops

When an error occurred in heif_image_create or heif_track_encode_sequence_image
during a multi-frame encode, the loop would break but 'status' was never set
to MagickFalse (it retained the initialized MagickTrue value). This caused the
encoder to proceed to write a potentially empty/corrupt file and incorrectly
report success.

This logic bug was present in the existing WriteHEICImage as well as the new
WriteHEICSequenceImage. Fixed both to properly assign IsHEIFSuccess to status
before breaking on error.

* Auto-coalesce images dynamically on encode for APNG/AVIF sequences

Since libheif requires every frame of a sequence encode to match the dimensions and placement expected by the track precisely, formats like GIF that use delta-frames (smaller dimensions + page offsets) caused the encoding loop to fail on the unequal frame sizes. We now detect this dynamically in WriteHEICImage and CoalesceImages if necessary to guarantee fully-baked frames before hitting WriteHEICSequenceImage.

* Update sequence API checks to require libheif >= 1.20.0

* Restore libheif >= 1.19.0 checks for security limits
2026-03-25 05:54:27 -04:00
Cristy 22aef93313 https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-w54j-7wpm-crhj 2026-03-24 19:11:14 -04:00
Cristy b620ae39d3 eliminate compiler exception 2026-03-24 08:45:17 -04:00
Cristy d27b840a61 https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-v67w-737x-v2c9 2026-03-24 08:03:28 -04:00
Madars e2e023dfa3 Set BackgroundDispose for animated JXL frames with alpha (#8635)
JXL delivers fully coalesced frames where each frame is a complete
independent image. Without setting dispose, converting transparent
animated JXL to GIF/WebP/MNG causes frames to accumulate instead
of replacing, making previous frames bleed through transparent areas.
2026-03-24 07:54:06 -04:00
Madars 5c38bb6f21 Skip frame duplication for APNG in video coder (#8636)
The video coder duplicates frames to simulate timing at a fixed
framerate for video formats. APNG supports per-frame delays natively
via fcTL chunks, so this duplication is unnecessary and causes the
output to have double (or more) the expected number of frames.
2026-03-24 07:53:40 -04:00
Cristy 0ff9eefa20 https://github.com/ImageMagick/ImageMagick/issues/7904 2026-03-23 20:42:54 -04:00
Cristy 4d7ebd363e sync pixels within JPEG coder 2026-03-22 17:42:23 -04:00
Cristy 3f55da39c8 https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-6p22-q7w5-33pg 2026-03-21 10:53:07 -04:00
Cristy 093f1b7902 https://github.com/ImageMagick/ImageMagick/discussions/6914 2026-03-21 10:08:37 -04:00
Cristy 5c4cca722a https://github.com/ImageMagick/ImageMagick/issues/8632 2026-03-21 09:46:01 -04:00