MCPcopy Index your code
hub / github.com/benfry/processing4 / saveImage

Method saveImage

core/src/processing/awt/ShimAWT.java:518–541  ·  view source on GitHub ↗
(PImage image, String path, String... args)

Source from the content-addressed store, hash-verified

516
517
518 static public boolean saveImage(PImage image, String path, String... args) {
519 if (saveImageExtensions == null) {
520 saveImageExtensions = javax.imageio.ImageIO.getWriterFormatNames();
521 }
522 try {
523 if (saveImageExtensions != null) {
524 for (String saveImageFormat : saveImageExtensions) {
525 if (path.endsWith("." + saveImageFormat)) {
526 if (!saveImageIO(image, path, args)) {
527 System.err.println("Error while saving image.");
528 return false;
529 }
530 return true;
531 }
532 }
533 System.err.println("Could not save " + path + ", " +
534 "make sure it ends with a supported extension " +
535 "(" + PApplet.join(saveImageExtensions, ", ") + ")");
536 }
537 } catch (IOException e) {
538 e.printStackTrace();
539 }
540 return false;
541 }
542
543
544 static protected String[] saveImageExtensions;

Callers 1

saveImplMethod · 0.95

Calls 4

saveImageIOMethod · 0.95
joinMethod · 0.95
printlnMethod · 0.45
printStackTraceMethod · 0.45

Tested by

no test coverage detected