[MGNLDAM-85] Displaying a png image fails in some case Created: 16/Jan/13 Updated: 11/Feb/13 Resolved: 24/Jan/13 |
|
| Status: | Closed |
| Project: | Magnolia DAM Module |
| Component/s: | None |
| Affects Version/s: | 1.0 |
| Fix Version/s: | 1.0 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Eric Hechinger | Assignee: | Christopher Zimmermann |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Date of First Response: | |||||||||
| Description |
|
For some png (dam/demo-project/img/logo/magnolia-logo), we have the following exception when displaying an Image. From ImageUtil.class final boolean isOpaque = img.getTransparency() == Transparency.OPAQUE; if (!isOpaque && !outputFormat.supportsTransparency()) { ); // create a ColorModel that represents the one of the ARGB except the alpha channel The image isOpack = false && supportsTransparency = false --> jump in the if statement. ------------------------- |
| Comments |
| Comment by Eric Hechinger [ 16/Jan/13 ] |
|
Works fine with 4.5.x. |
| Comment by Christopher Zimmermann [ 23/Jan/13 ] |
|
Changed ImageUtil.flattenTransparentImageForOpaqueFormat to fallback to fillTransparentPixels if there is a problem with color model conversion. Added a testcase for the magnolia_logo.png which was causing the problem. |
| Comment by Daniel Lipp [ 23/Jan/13 ] |
|
We should not rely on exceptions for control flow. Looks like a could easily check the type before doing the cast and hence avoid the ClassCastException. |
| Comment by Christopher Zimmermann [ 24/Jan/13 ] |
|
ImageUtil.flattenTransparentImageForOpaqueFormat() was failing for images with ComponentColorModel. It has been improved to check for images with ComponentColorModel and to fallback on a slower routine when they are detected. |
| Comment by Christopher Zimmermann [ 24/Jan/13 ] |
|
Fixed by improving ImageUtil.flattenTransparentImageForOpaqueFormat in |