[MGNLIMG-38] outputting into jpg format fails if processed image is a gif or png Created: 18/May/09 Updated: 02/Apr/13 Resolved: 20/May/09 |
|
| Status: | Closed |
| Project: | Imaging |
| Component/s: | image operations |
| Affects Version/s: | 3.0 |
| Fix Version/s: | 3.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Philipp Bärfuss | Assignee: | Magnolia International |
| 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 |
|
The method ImageUtil.flattenTransparentImageForOpaqueFormat(BufferedImage, OutputFormat) fails for the following cenario the exceptions are not the same 1) java.lang.ClassCastException: java.awt.image.ComponentColorModel cannot be cast to java.awt.image.DirectColorModel 2) java.lang.ArrayIndexOutOfBoundsException: 1 |
| Comments |
| Comment by Magnolia International [ 20/May/09 ] |
|
Adding testcases. I get a different exception depending on the source image, it's a transparent gif, I get the same you do; if it's opaque, I get another one. An opaque png seems to cause no issue; an 8-bit transparent png also throws an ArrayIndexOutOfBoundsException. A translucent png with alpha channel the ClassCastException you had. |
| Comment by Magnolia International [ 20/May/09 ] |
|
Solved by fixing |
| Comment by Christopher Zimmermann [ 24/Jan/13 ] |
|
Explicitly test for ComponentColorModel instead of just catching an exception to determine if fillTransparentPixels should be called. |