[MGNLIMG-132] CLONE - Revise image type assignments Created: 02/Jun/14  Updated: 18/Jun/14  Resolved: 04/Jun/14

Status: Closed
Project: Imaging
Component/s: image operations
Affects Version/s: 2.2.3, 2.2.4
Fix Version/s: 2.2.5

Type: Task Priority: Critical
Reporter: Teresa Miyar Assignee: Roman Kovařík
Resolution: Fixed Votes: 0
Labels: maintenance, support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Cloners
clones MGNLIMG-131 Revise image type assignments Closed
causality
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:

 Description   

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.



 Comments   
Comment by Roman Kovařík [ 05/Jun/14 ]

Commit:
https://git.magnolia-cms.com/gitweb/?p=modules/imaging.git;a=commitdiff;h=bfe949d9cc7c93ab0bfb9d3213520aec3cfe3734

Generated at Mon Feb 12 02:12:35 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.