extrapixel / gif-animation

GifAnimation is a Processing library to play and export GIF animations
GNU General Public License v3.0
171 stars 38 forks source link

Processing 3 branch fails to export gifs "Width (0) and height (0) cannot be <=0" #13

Open macrael opened 8 years ago

macrael commented 8 years ago

The 3.0 branch of processing does not work. I'm running processing 3.0.2 and even the included example gifExport fails in this way.

Exception in thread "Thread-2" java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0 at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016) at java.awt.image.BufferedImage.(BufferedImage.java:333) at gifAnimation.GifMaker.addFrame(GifMaker.java:153) at gifAnimation.GifMaker.addFrame(GifMaker.java:145) at gifExport.draw(gifExport.java:54) at processing.core.PApplet.handleDraw(PApplet.java:2402) at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:859) at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692) at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674) at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147) at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759) at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81) at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452) at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505)

ghost commented 7 years ago

I got same error when using P3D mode. In that case, I solved the issue by this.loadPixels(); gifExport.addFrame(this.pixels, width, height); instead of gifExport.addFrame(); (where this implies any PApplet).

extrapixel commented 2 years ago

@jeremydouglass and @macrael can you confirm this is resolved in the new 3.0 default branch? The library will be served at

jeremydouglass commented 2 years ago

@extrapixel I've installed the 3.0 library from the zip link above and tested both example gifDisplay and gifExport on Processing 3.4 and 3.5.4 -- both examples ran and displayed / saved correctly in both Processing versions.

I don't have Processing 4 on this machine -- maybe somebody else could give that a quick check?

jeremydouglass commented 2 years ago

Quick notes:

  1. gifAnimation.txt lists minrevision = 0246 -- that's Processing 3.0. That seems reasonable, I'll just note that I didn't actually test on 3.0, only 3.4 and 3.5.4.

  2. I believe that the old 2.0 library directory was GifAnimation and the new one is gifAnimation. Not necessarily an issue, just noting the change.

  3. These "raw" urls may be submitted directly to the Processing librarian for listing in Contributions manager. However, if they are uploaded as attachments to a github 3.0 release on this repo, then the urls will be:

https://github.com/extrapixel/gif-animation/releases/latest/download/gifAnimation.txt https://github.com/extrapixel/gif-animation/releases/latest/download/gifAnimation.zip

...which is useful, because if is later a 3.1 release or 3.2 release et cetera, that new release and its attachments will automatically become the new "latest" urls on github, and then those urls don't need to be resubmitted to contributions manager and go through a potentially multi-day update and sync process.

extrapixel commented 2 years ago

thanks @jeremydouglass !

I think this issue can be closed.

Regarding your other notes - they all are valid points.

  1. I agree, we should at least test the advertised minrevision or change it to something that we did test.
  2. Yes I think it was renamed in the PR #21 but I'm not sure why. I assumed some new naming convention?
  3. For the time being, i have submitted the raw urls to the librarian. My goal is to finally get this back into the library manager in the hopes to get more activity to this repo. In the medium term i think the release / distribution process needs to be refined.