Thread-safe method.
(ImagePlus imp, String path, int quality)
| 36 | |
| 37 | /** Thread-safe method. */ |
| 38 | public static String save(ImagePlus imp, String path, int quality) { |
| 39 | if (imp==null) |
| 40 | imp = IJ.getImage(); |
| 41 | if (path==null || path.length()==0) |
| 42 | path = SaveDialog.getPath(imp, ".jpg"); |
| 43 | if (path==null) |
| 44 | return null; |
| 45 | String error = (new JpegWriter()).saveAsJpeg(imp, path, quality); |
| 46 | return error; |
| 47 | } |
| 48 | |
| 49 | String saveAsJpeg(ImagePlus imp, String path, int quality) { |
| 50 | int width = imp.getWidth(); |
no test coverage detected