[MTE-135] Gif Images not working Created: 27/Apr/21  Updated: 16/Dec/21  Resolved: 23/Nov/21

Status: Closed
Project: Magnolia Templating Essentials
Component/s: imaging
Affects Version/s: 2.0
Fix Version/s: 2.0.1

Type: Bug Priority: Neutral
Reporter: Carlos Cantalapiedra Assignee: Evzen Fochr
Resolution: Fixed Votes: 1
Labels: java11, maintenance, quickwin
Remaining Estimate: Not Specified
Time Spent: 3h
Original Estimate: Not Specified

Attachments: PNG File error.png     PNG File image-2021-10-26-13-40-20-000.png     PNG File not-working-gif.png    
Issue Links:
Problem/Incident
relation
is related to MGNLIMG-237 Specifically use uppercase LZW for co... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* 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:
Sprint: Global Maintenance 2
Story Points: 2

 Description   

Steps to reproduce

  1.  Go to our demo
  2. Upload a GIF image at the Asset app
  3.  Edit the Malasia Taste asset and change it for the gif image uploaded on the previous step
  4. Open the tour and check the image is not shown and an error appears at the console

Expected results

The GIF image is rendered

Actual results

An error is shown at the console and the GIF image is not rendered

Workaround

N/A

Development notes

On Magnolia 6.2.1, the GIF image is shown and animated



 Comments   
Comment by Roman Kovařík [ 29/Apr/21 ]

Nicely written ticket! It's much easier to test with the directs links.

Looks like tika wrongly detects mime type as image/jpeg. Might be caused be tika update?

Comment by Jan Haderka [ 30/Apr/21 ]

Actually despite suspecting the Tika, I'm not able to reproduce the problem locally with vanilla 6.2.8. Issue might be related to actual version/type/provider of JVM used.

Comment by Federico Grilli [ 30/Apr/21 ]

Tried on our 6.2.8 demo. Gif is uploaded and displays fine in Asset App. Indeed, while rendering the tour a 500 HTTP error occurs. Trying to open image in a new tab reveals the stacktrace


Root cause

java.lang.IllegalArgumentException: Unknown compression type! java.desktop/javax.imageio.ImageWriteParam.setCompressionType(ImageWriteParam.java:1040) info.magnolia.imaging.OutputFormat.applyTo(OutputFormat.java:80) info.magnolia.imaging.DefaultImageStreamer.write(DefaultImageStreamer.java:83) info.magnolia.imaging.DefaultImageStreamer.serveImage(DefaultImageStreamer.java:69) info.magnolia.imaging.caching.CachingImageStreamer.generateAndStore(CachingImageStreamer.java:226) info.magnolia.imaging.caching.CachingImageStreamer$1.load(CachingImageStreamer.java:132) info.magnolia.imaging.caching.CachingImageStreamer$1.load(CachingImageStreamer.java:127) com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3529) com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2278) com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155) com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045) com.google.common.cache.LocalCache.get(LocalCache.java:3951) com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974) com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4935) info.magnolia.imaging.caching.CachingImageStreamer.serveImage(CachingImageStreamer.java:148) info.magnolia.imaging.Imaging.generate(Imaging.java:84)

...
Comment by Jan Haderka [ 30/Apr/21 ]

Everything works as expected when using eg Oracle JDK

java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode) 

but not working when using OpenJDK

java -version
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode) 

or when using Zulu

java -version
openjdk version "11.0.10" 2021-01-19 LTS
OpenJDK Runtime Environment Zulu11.45+27-CA (build 11.0.10+9-LTS)
OpenJDK 64-Bit Server VM Zulu11.45+27-CA (build 11.0.10+9-LTS, mixed mode) 

Could be that the cause is also because of switch from Java 8 to Java 11, however the issue is clearly outside of Magnolia and not related to any particular version (reproduced exactly same behavior as far back as 6.2.0).

Comment by Jan Haderka [ 30/Apr/21 ]

Issue is caused by chosen JVM implementation. Workaround is either to switch to different JVM or to avoid using image variations for GIF images.

Comment by Jeffrey van der Heide [ 26/Oct/21 ]

https://docs.magnolia-cms.com/product-docs/6.2/Administration/Certified-stack.html#_java should probably be updated if this is a "won't fix". Because it would seem that Oracle JDK and OpenJDK are no longer interchangeable alternatives.

Comment by Richard Gange [ 26/Oct/21 ]

I just tested with Oracle Java 11 and it's not working there either.

Comment by Richard Gange [ 28/Oct/21 ]

Yes, it does work now. Looks like we also have some others to clean up as well. I did create a PR for this one. I'll take care of the one in DefaultImageGenerator next.

Generated at Mon Feb 12 07:41:51 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.