CreativeInquiry / PEmbroider

Embroidery Library for Processing
Other
443 stars 28 forks source link

java.io.FileNotFoundException when running PEmbroider_stroke_outlines #90

Closed bonniee closed 3 years ago

bonniee commented 3 years ago

I encountered this error when running the example PEmbroider_stroke_outlines.

No library found for processing.embroider.PEmbroiderGraphics
java.io.FileNotFoundException: /Users/studio/Downloads/wtf.png (No such file or directory)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)

I'm on OSX. I don't have the specified /Users/studio/Downloads directory.

stephanschulz commented 3 years ago

I also get this error message but the app still is able to run and produce images.


No library found for processing.embroider.PEmbroiderGraphics
java.io.FileNotFoundException: /Users/studio/Downloads/wtf.png (No such file or directory)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
    at processing.core.PApplet.createOutput(PApplet.java:7674)
    at processing.core.PImage.saveImageIO(PImage.java:3260)
    at processing.core.PImage.save(PImage.java:3406)
    at processing.core.PGraphics.save(PGraphics.java:8403)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.endComposite(Unknown Source)
    at PEmbroider_stroke_outlines.setup(PEmbroider_stroke_outlines.java:60)
    at processing.core.PApplet.handleDraw(PApplet.java:2432)
    at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)
    at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)
java.lang.NullPointerException
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at javax.imageio.stream.FileCacheImageOutputStream.flushBefore(FileCacheImageOutputStream.java:258)
    at com.sun.imageio.plugins.png.ChunkStream.finish(PNGImageWriter.java:140)
    at com.sun.imageio.plugins.png.PNGImageWriter.write_IHDR(PNGImageWriter.java:401)
    at com.sun.imageio.plugins.png.PNGImageWriter.write(PNGImageWriter.java:1135)
    at processing.core.PImage.saveImageIO(PImage.java:3263)
    at processing.core.PImage.save(PImage.java:3406)
    at processing.core.PGraphics.save(PGraphics.java:8403)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.endComposite(Unknown Source)
    at PEmbroider_stroke_outlines.setup(PEmbroider_stroke_outlines.java:60)
    at processing.core.PApplet.handleDraw(PApplet.java:2432)
    at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)
    at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)
Error while saving image.
java.io.IOException: image save failed.
    at processing.core.PImage.saveImageIO(PImage.java:3275)
    at processing.core.PImage.save(PImage.java:3406)
    at processing.core.PGraphics.save(PGraphics.java:8403)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.endComposite(Unknown Source)
    at PEmbroider_stroke_outlines.setup(PEmbroider_stroke_outlines.java:60)
    at processing.core.PApplet.handleDraw(PApplet.java:2432)
    at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)
    at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)
java.io.FileNotFoundException: /Users/studio/Downloads/wtf.png (No such file or directory)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
    at processing.core.PApplet.createOutput(PApplet.java:7674)
    at processing.core.PImage.saveImageIO(PImage.java:3260)
    at processing.core.PImage.save(PImage.java:3406)
    at processing.core.PGraphics.save(PGraphics.java:8403)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.endComposite(Unknown Source)
    at PEmbroider_stroke_outlines.setup(PEmbroider_stroke_outlines.java:70)
    at processing.core.PApplet.handleDraw(PApplet.java:2432)
    at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)
    at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)
java.lang.NullPointerException
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at javax.imageio.stream.FileCacheImageOutputStream.flushBefore(FileCacheImageOutputStream.java:258)
    at com.sun.imageio.plugins.png.ChunkStream.finish(PNGImageWriter.java:140)
    at com.sun.imageio.plugins.png.PNGImageWriter.write_IHDR(PNGImageWriter.java:401)
    at com.sun.imageio.plugins.png.PNGImageWriter.write(PNGImageWriter.java:1135)
    at processing.core.PImage.saveImageIO(PImage.java:3263)
    at processing.core.PImage.save(PImage.java:3406)
    at processing.core.PGraphics.save(PGraphics.java:8403)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.endComposite(Unknown Source)
    at PEmbroider_stroke_outlines.setup(PEmbroider_stroke_outlines.java:70)
    at processing.core.PApplet.handleDraw(PApplet.java:2432)
    at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)
    at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)
Error while saving image.
java.io.IOException: image save failed.
    at processing.core.PImage.saveImageIO(PImage.java:3275)
    at processing.core.PImage.save(PImage.java:3406)
    at processing.core.PGraphics.save(PGraphics.java:8403)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.endComposite(Unknown Source)
    at PEmbroider_stroke_outlines.setup(PEmbroider_stroke_outlines.java:70)
    at processing.core.PApplet.handleDraw(PApplet.java:2432)
    at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)
    at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)
java.io.FileNotFoundException: /Users/studio/Downloads/wtf.png (No such file or directory)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
    at processing.core.PApplet.createOutput(PApplet.java:7674)
    at processing.core.PImage.saveImageIO(PImage.java:3260)
    at processing.core.PImage.save(PImage.java:3406)
    at processing.core.PGraphics.save(PGraphics.java:8403)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.endComposite(Unknown Source)
    at PEmbroider_stroke_outlines.setup(PEmbroider_stroke_outlines.java:80)
    at processing.core.PApplet.handleDraw(PApplet.java:2432)
    at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)
    at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)
java.lang.NullPointerException
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at javax.imageio.stream.FileCacheImageOutputStream.flushBefore(FileCacheImageOutputStream.java:258)
    at com.sun.imageio.plugins.png.ChunkStream.finish(PNGImageWriter.java:140)
    at com.sun.imageio.plugins.png.PNGImageWriter.write_IHDR(PNGImageWriter.java:401)
    at com.sun.imageio.plugins.png.PNGImageWriter.write(PNGImageWriter.java:1135)
    at processing.core.PImage.saveImageIO(PImage.java:3263)
    at processing.core.PImage.save(PImage.java:3406)
    at processing.core.PGraphics.save(PGraphics.java:8403)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.endComposite(Unknown Source)
    at PEmbroider_stroke_outlines.setup(PEmbroider_stroke_outlines.java:80)
    at processing.core.PApplet.handleDraw(PApplet.java:2432)
    at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)
    at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)
Error while saving image.
java.io.IOException: image save failed.
    at processing.core.PImage.saveImageIO(PImage.java:3275)
    at processing.core.PImage.save(PImage.java:3406)
    at processing.core.PGraphics.save(PGraphics.java:8403)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.image(Unknown Source)
    at processing.embroider.PEmbroiderGraphics.endComposite(Unknown Source)
    at PEmbroider_stroke_outlines.setup(PEmbroider_stroke_outlines.java:80)
    at processing.core.PApplet.handleDraw(PApplet.java:2432)
    at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)
    at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)
LingDong- commented 3 years ago

No library found is a Processing bug. It actually does find the library and will work correctly. Just ignore it.

I cannot reproduce the FileNotFoundException

Are you on the latest version?

It looks like one of my debug image outputs (hardcoded to a path on my computer), however, a search in the current source code reveals that all these debug lines have already been removed.

EDIT: Looks like the distribution zip isn't in sync with the source. I've regenerated the package, the FileNotFoundException should now go away in the newest download. Sorry about that.

golanlevin commented 3 years ago

I've just cleaned up the PEmbroider_stroke_outlines Example code, and I can confirm that this sketch is not producing this error on OSX. @bonniee, thanks for your bug report.

bonniee commented 3 years ago

Thank you both!