[MGNLIMG-131] Revise image type assignments Created: 22/Apr/14 Updated: 04/Jun/14 Resolved: 22/Apr/14 |
|
| Status: | Closed |
| Project: | Imaging |
| Component/s: | image operations |
| Affects Version/s: | 3.0.3 |
| Fix Version/s: | 3.0.4 |
| Type: | Task | Priority: | Neutral |
| Reporter: | Roman Kovařík | 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: |
|
||||||||||||
| Template: |
|
||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||
| Task DoR: |
Empty
|
||||||||||||
| 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)). |