Uploaded image for project: 'Imaging'
  1. Imaging
  2. MGNLIMG-132

CLONE - Revise image type assignments

XMLWordPrintable

      Currently we do image type assignment at least on two places:

      info.magnolia.imaging.operations.load.AbstractLoader.apply(BufferedImage, P) {
              ...
              int imageType = loaded.getType(); // set the output image type to the source image type
      
              if (imageType == BufferedImage.TYPE_CUSTOM) { // if the source image type is not set...
                  if (loaded.getAlphaRaster() != null) { // with alpha channel
                      imageType = BufferedImage.TYPE_INT_ARGB_PRE;
                  } else { // without alpha channel
                      imageType = BufferedImage.TYPE_INT_RGB;
                  }
              }
              ...
      }
      
      info.magnolia.imaging.operations.cropresize.resizers.MultiStepResizer.resize(BufferedImage, Coords, Size) {
              ...
              final int type = (src.getTransparency() == Transparency.OPAQUE) ? BufferedImage.TYPE_INT_RGB : BufferedImage.TYPE_INT_ARGB;
              ...
      }
      

      This two assignments should be in sync (e.g. create info.magnolia.imaging.util.ImageUtil.getImageType(BufferedImage)).
      A part of this function could be also fix for loosing transparency of an indexed transparent image, see SUPPORT-3443.

        Acceptance criteria

              rkovarik Roman Kovařík
              tmiyar Teresa Miyar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoR