save() and saveFrame() with OPENGL renderer fails (3.0a9) #3334

Closed
ciaron opened this Issue May 29, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@ciaron

ciaron commented May 29, 2015

The following code fails with an exception, removing 'OPENGL' allows me to save the frame. This is a regression from 3.0a5

void setup() {
  size(200, 200, OPENGL); // --> succeeds without OPENGL, P2D or P3D
  background(255);
  stroke(0);
}

void draw() {
  line(0, 0, width, height);
  save("abc.png");
  noLoop();
}

The exception(s) is/are:

Display 0 does not exist, using the default display instead.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.<init>(BufferedImage.java:331)
    at processing.core.PImage.saveImageIO(PImage.java:3161)
    at processing.core.PImage.save(PImage.java:3341)
    at processing.opengl.PGraphicsOpenGL.save(PGraphicsOpenGL.java:5761)
    at processing.core.PApplet.save(PApplet.java:3261)
    at save_bug.draw(save_bug.java:25)
    at processing.core.PApplet.handleDraw(PApplet.java:1983)
    at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:566)
    at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:691)
    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:673)
    at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:442)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1277)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1131)
    at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:680)
    at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:77)
    at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:451)
    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)
Error while saving image.
java.io.IOException: image save failed.
    at processing.core.PImage.saveImageIO(PImage.java:3208)
    at processing.core.PImage.save(PImage.java:3341)
    at processing.opengl.PGraphicsOpenGL.save(PGraphicsOpenGL.java:5761)
    at processing.core.PApplet.save(PApplet.java:3261)
    at save_bug.draw(save_bug.java:25)
    at processing.core.PApplet.handleDraw(PApplet.java:1983)
    at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:566)
    at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:691)
    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:673)
    at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:442)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1277)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1131)
    at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:680)
    at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:77)
    at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:451)
    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)

Perhaps related to #3255 ?

@codeanticode codeanticode self-assigned this May 29, 2015

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode May 31, 2015

Member

fixed with 6789f4d

Member

codeanticode commented May 31, 2015

fixed with 6789f4d

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode Jun 1, 2015

Member

needs test on retina.

Member

codeanticode commented Jun 1, 2015

needs test on retina.

@REAS

This comment has been minimized.

Show comment
Hide comment
@REAS

REAS Jun 3, 2015

Member

It's creating files fine on Retina, but it's cropping them by only rendering one quadrant with the _2X renderers.

Member

REAS commented Jun 3, 2015

It's creating files fine on Retina, but it's cropping them by only rendering one quadrant with the _2X renderers.

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode Jun 5, 2015

Member

Fixed with 824e8f2

Member

codeanticode commented Jun 5, 2015

Fixed with 824e8f2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment