Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blur filter throws exception if extent is too large relative to image size #723

Open
jlstrecker opened this issue May 18, 2023 · 1 comment · May be fixed by #818
Open

Blur filter throws exception if extent is too large relative to image size #723

jlstrecker opened this issue May 18, 2023 · 1 comment · May be fixed by #818
Labels
Help Wanted We have very little time and would like some help

Comments

@jlstrecker
Copy link

Description

When filter(BLUR, param) is called with param above a certain amount relative to the image size, an ArithmeticException is thrown for division by zero.

Expected Behavior

Image is blurred the specified amount.

Current Behavior

java.lang.ArithmeticException: / by zero
	at processing.core.PImage.blurARGB(PImage.java:1318)
	at processing.core.PImage.filter(PImage.java:991)
	at processing.opengl.PGraphicsOpenGL.filter(PGraphicsOpenGL.java:6037)
	at processing.core.PApplet.filter(PApplet.java:15081)
	at BlurTest.draw(BlurTest.java:25)
	at processing.core.PApplet.handleDraw(PApplet.java:2094)
	at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:840)
	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:782)
	at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
	at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:453)
	at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
	at java.base/java.util.TimerThread.mainLoop(Timer.java:566)
	at java.base/java.util.TimerThread.run(Timer.java:516)

Steps to Reproduce

Run this sketch:

void setup() {
  size(100, 100, P3D);
}

void draw() {
  background(0);
  ellipse(50, 50, 80, 80);
  filter(BLUR, 29);  // 28 is OK, 29 throws exception
}

Your Environment

  • Processing version: 4.2
  • Operating System and OS version: macOS 10.15.7

Possible Causes / Solutions

@benfry benfry added the Help Wanted We have very little time and would like some help label Jul 16, 2023
@SaumyaKarnwal
Copy link

Can u assign this to me ? I might be able to fix this !

@SaumyaKarnwal SaumyaKarnwal linked a pull request Jan 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted We have very little time and would like some help
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants