View script | License | Download script | History | Other scripts by: crazyaxe |
30-Apr 18:01 UTC
[0.037] 11.606k
[0.037] 11.606k
Archive version of: resizer.r ... version: 1 ... crazyaxe 22-Jul-2011Amendment note: new script || Publicly available? Yes Rebol [ Title: "Resizer" File: %resizer.r Author: "Massimiliano Vessi" Date: 2011-07-22 Version: 1.1.1 email: maxint@tiscali.it Purpose: {Simple image resizer} Library: [ level: 'intermediate platform: 'all type: [tool demo ] domain: [all] tested-under: [view 2.7.8.3.1 Windows Linux ] support: maxint@tiscali.it license: 'gpl see-also: none ] ] max_L: 70 max_H: 70 suff: "_small" ridimensiona: does [ immagini: request-file foreach immagine_f immagini [ immagine_i: load-image immagine_f temp_imm: load-image immagine_f ;we'll use this for height check if x/data [ dimensioni: immagine_i/size if dimensioni/1 > max_L [ fattore: dimensioni/1 / max_L temp_L: layout/tight [ image (dimensioni / fattore) immagine_i ] temp_imm: to-image temp_L ;this will be used for heigh check save/png (to-file rejoin [ immagine_f suff_f/text ".png" ]) temp_imm ] ] if y/data [ dimensioni: temp_imm/size ;this way, we'll use the X resized image or the original image if dimensioni/2 > max_H [ fattore: dimensioni/2 / max_H temp_L: layout/tight [ image (dimensioni / fattore) immagine_i ] temp_imm: to-image temp_L save/png (to-file rejoin [ immagine_f suff_f/text ".png" ]) temp_imm ] ] ] alert "DONE!" ] help_L: layout [ title "Help" text 250 {This is software aims to create small copy of the original images, resize the to smaller size. You can choose what dimensions use, if software should check just length or height or both. You can select multiple files at one time. You can choose the suffix to append at the new images. If you need further help, you can contact me:} text (rejoin [ "maxint" "@" "tiscali.it" ]) ] view layout [ title "THUMBNAIL GENERATOR" across x: check true text "Max Leight:" maxL: field (to-string max_L) return y: check text "Max Height:" maxL: field (to-string max_H) return text "Suffix:" suff_f: field suff ;ths suffix to append at the file names of thumbnail immages return button "Select image(s)" [ ridimensiona ] btn-help [ view/new help_L ] ] |