4 An CLI tool written in Java for resizing images.
5 Recursively transfers a tree of files and directories and resizes images.
11 If you have fully-fledged operating system like some GNU/Linux distribution,
12 you will probably use better tool for resizing images.
13 In Debian or Ubuntu you can easilly install ImageMagick:
14 apt install imagemagick
16 convert ${input} -resize 1200x1200 -quality 80 ${output};
17 or write some shell script around it.
19 But if you need a multiplatform tool with minimal requirements,
20 the copy-image-resizer might be useful.
26 cd java/copy-image-resizer/
29 compiled program is in: dist/copy-image-resizer.jar
31 you can run it directly:
32 java -jar dist/copy-image-resizer.jar
33 or install it somewhere and run through th wrapper script:
34 scripts/copy-image-resizer.sh
35 (link it somewhere on your $PATH as „copy-image-resizer“)
37 TODO: .rpm and .deb packages
42 copy-image-resizer supports these options:
44 --input-dir (mandatory)
45 one parameter: path to the input directory
47 --output-dir (mandatory)
48 one parameter: path to the output directory
50 --size (mandatory, can be used multiple times to generate multiple resolutions)
51 1. parameter: width (integer)
52 2. parameter: height (integer)
53 3. parameter: resizeSmaller (boolean) whether smaller images should be also scaled
55 --size-named (alternative to --size)
56 1. parameter: width (integer)
57 2. parameter: height (integer)
58 3. parameter: resizeSmaller (boolean)
59 4. parameter: directory (string) output sub-directory for this resolution (default in --size is WIDTHxHEIGHT e.g. 64x64)
61 --skip-errors (optional, alternative to --skip-errors-silently)
63 errors will be just logged and program will fail at the end if any errors
64 (default behavior is: fail on first error)
66 --skip-errors-silently (optional, alternative to --skip-errors)
68 errors will be just logged and program will report success even if there were any errors
74 copy-image-resizer --input-dir MyPhotos/ --output-dir MyBlog/ --size 800 600 false --size 1600 1200 false --size-named 300 300 false thumnails
76 Will generate three output resolutions in separate directories: „MyBlog/800x600“, „MyBlog/1600x1200“ and „MyBlog/thumbnails“