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

Method save

core/src/processing/core/PImage.java:3195–3217  ·  view source on GitHub ↗

Saves the image into a file. Append a file extension to the name of the file, to indicate the file format to be used: either TIFF (.tif), TARGA (.tga), JPEG (.jpg), or PNG (.png). If no extension is included in the filename, the image will save in TIFF format and .tif will be added to the name. The

(String filename)

Source from the content-addressed store, hash-verified

3193 * @param filename a sequence of letters and numbers
3194 */
3195 public boolean save(String filename) { // ignore
3196 String path;
3197
3198 if (parent != null) {
3199 // use savePath(), so that the intermediate directories are created
3200 path = parent.savePath(filename);
3201
3202 } else {
3203 File file = new File(filename);
3204 if (file.isAbsolute()) {
3205 // make sure that the intermediate folders have been created
3206 PApplet.createPath(file);
3207 path = file.getAbsolutePath();
3208 } else {
3209 String msg =
3210 "PImage.save() requires an absolute path. " +
3211 "Use createImage(), or pass savePath() to save().";
3212 PGraphics.showException(msg);
3213 return false;
3214 }
3215 }
3216 return saveImpl(path);
3217 }
3218
3219
3220 /**

Callers

nothing calls this directly

Calls 4

createPathMethod · 0.95
showExceptionMethod · 0.95
saveImplMethod · 0.95
savePathMethod · 0.80

Tested by

no test coverage detected