-
Bug
-
Resolution: Fixed
-
Neutral
-
3.2.4
-
None
-
-
Empty show more show less
-
Saigon 37
-
8
GIF images going through the imaging module come out distorted.
Steps to reproduce
Upload the "example.gif" image using Asset app.
Solution
Handle input images whose size is 1-4 bits per pixel.
info.magnolia.imaging.util.ImageUtil
public static int getImageType(BufferedImage img) { int imageType = img.getType(); switch (imageType) { case BufferedImage.TYPE_CUSTOM: // If the source image type is not set... imageType = img.getAlphaRaster() != null ? BufferedImage.TYPE_INT_ARGB_PRE : BufferedImage.TYPE_INT_RGB; break; // Handle both TYPE_BYTE_BINARY (1-4 bit/pixel) and TYPE_BYTE_INDEXED (8 bit/pixel). case BufferedImage.TYPE_BYTE_BINARY: case BufferedImage.TYPE_BYTE_INDEXED: if (img.getColorModel() != null) { imageType = img.getColorModel().hasAlpha() ? BufferedImage.TYPE_INT_ARGB_PRE : BufferedImage.TYPE_INT_RGB; } break; default: break; } return imageType; }
Acceptance criteria