/
The transparency bit is lost during image cropping [5.2.2-B1]

The transparency bit is lost during image cropping [5.2.2-B1]

The "ImageHelper" class can be used to perform various manipulations with user uploaded images. The most popular ones are:

  • image resizing
  • image cropping
  • applying watermark

Turns out, that during image crop operation the original image transparency bit is discarded and black color is used to fill missing pieces of cropped image.

Solution

If original image had transparency bit and no "fill" transformation option is provided (specifies the color to fill missing parts of the image with), then default to transparent image (if image format supports it, e.g. png/gif) instead of black color fill.

Related Tasks