imagick: document the image types - #5826
Open
lacatoire wants to merge 1 commit into
Open
Conversation
lacatoire
force-pushed
the
fix/imagick-image-types
branch
3 times, most recently
from
September 2, 2026 15:09
6c5cf89 to
07bacc6
Compare
The IMGTYPE_* constants had empty descriptions and Imagick::setImageType only repeated its own name, leaving readers to guess what an image type is and what the MATTE variants mean. Each constant now states the conversion SetImageType() performs, and the group notes that MATTE is the ImageMagick 6 name for the alpha channel, with the ALPHA spellings available as of ImageMagick 7. setType() is distinguished from setImageType().
lacatoire
force-pushed
the
fix/imagick-image-types
branch
from
September 2, 2026 15:13
07bacc6 to
5947a15
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
IMGTYPE_*constants had empty descriptions, andImagick::setImageType()only repeated its own name with an empty parameter entry, so nothing on either page said what an image type is or what theMATTEvariants mean.Each constant now states the conversion
SetImageType()actually performs, taken from the switch inMagickCore/attribute.c: which colorspace the image is transformed to, whether it is quantised, and whether the alpha channel is kept or discarded. Two of them convert nothing at all —IMGTYPE_UNDEFINEDandIMGTYPE_OPTIMIZEfall through to a barebreak.The group introduction answers the question the issue asks:
MATTEis the ImageMagick 6 name for the alpha channel, and Imagick registers anALPHAspelling with the same value when built against ImageMagick 7.Imagick::setType()is also given a sentence distinguishing it fromImagick::setImageType(): it sets the type used for images read or written afterwards, whereassetImageType()converts the current image. Both previously carried nearly the same description.Fixes: #2990