Skip to content
Snippets Groups Projects
Commit 6499bdfb authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Create full-size JPEG preview as well as downscaled version

parent a1a2a086
No related branches found
No related tags found
No related merge requests found
......@@ -110,6 +110,8 @@ function gen_preview_jpeg(jpeg_fname) {
} else {
run("Enhance Contrast...", "saturated=0.3");
}
print("*** created JPEG preview: " + jpeg_fname);
saveAs("Jpeg", jpeg_fname);
if (width > 1024 || height > 1024) {
oldwidth = width;
......@@ -124,8 +126,10 @@ function gen_preview_jpeg(jpeg_fname) {
run("Scale...", "x=- y=- width=" + width + " height=" + height + " interpolation=None average");
makeRectangle((oldwidth-width+1)/2, (oldheight-height+1)/2, width, height);
run("Crop");
}
jpeg_fname = replace(jpeg_fname, '.jpg', '-1024.jpg');
print("*** created downscaled JPEG preview: " + jpeg_fname);
saveAs("Jpeg", jpeg_fname);
}
close();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment