Processing 4.3 Display GIF Image?

I’d like to display a simple gif image. The PDE 3.x.x works with the library “gifAnimation”, as I recalled I have done it. But, PDE 4 does not work with the lib. Maybe, I just dont know how to make it work. So is there any solution or other lib for displaying gif image? it showed error (see comment) when I run the code.

I see there are examples in main processing “Examples” page but it used sequential image while my pictures are not individual images but one single compressed gif. So is there any work around on this issue?

Thank you in advance.

Also, this is an error I get when trying the former gifAnimation library.


java.lang.NoClassDefFoundError: gifAnimation/Gif
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3373)
	at java.base/java.lang.Class.getConstructor0(Class.java:3578)
	at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2754)
	at processing.core.PApplet.runSketch(PApplet.java:10068)
	at processing.core.PApplet.main(PApplet.java:9845)
Caused by: java.lang.ClassNotFoundException: gifAnimation.Gif
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	... 6 more
Could not run the sketch (Target VM failed to initialize).
For more information, read Help ? Troubleshooting.

my pictures are not individual images but one single compressed gif

Have you tried loadImage()?

Yes:) It showed a still image no animation

Hello @teemee ,

With Processing 4.3 and W10 Pro the example provided with the library work:

It also worked with an animated GIF that I created with Movie Maker (comes with PDE).

:)

YES That’s what I talked about I used it but it did not work this time. gifDisplay shows errors as in my first comment. I am also working on Windows.

YES That’s what I talked about I used it but it did not work this time. gifDisplay shows errors as in my first comment. I am also working on Windows.

Update:

On Windows 10 64-Bits with NVIDIA: I have tried lower version of PDE to 3.5.4, gifAnimation still does not work. And, I read on Processing old forum that “Target VM failed to initialize” errors due to something with nVidia. While the solution suggested there was to download 3.5.x version instead of newer one, it does not work todays anymore. Anyone know any alternative solution? Thanks.

On Mac 10.15.7 gifAnimation works fine on both PDE 3.5.4 and BETA 4.0. I have not tried on version 4 other than beta.

Can you tell me what graphic card does your computer use? Is it NVIDIA and what is the model and driver? Thanks!!

No Library Issue, relates to:

I’ll close this topic!

Cheers
— mnse

1 Like