franta-hg@0: copy-image-resizer franta-hg@0: ------------------ franta-hg@0: franta-hg@0: An CLI tool written in Java for resizing images. franta-hg@0: Recursively transfers a tree of files and directories and resizes images. franta-hg@0: franta-hg@0: franta-hg@0: Why? franta-hg@0: ---- franta-hg@0: franta-hg@0: If you have fully-fledged operating system like some GNU/Linux distribution, franta-hg@0: you will probably use better tool for resizing images. franta-hg@0: In Debian or Ubuntu you can easilly install ImageMagick: franta-hg@0: apt install imagemagick franta-hg@0: and resize images: franta-hg@0: convert ${input} -resize 1200x1200 -quality 80 ${output}; franta-hg@0: or write some shell script around it. franta-hg@0: franta-hg@0: But if you need a multiplatform tool with minimal requirements, franta-hg@0: the copy-image-resizer might be useful. franta-hg@0: franta-hg@0: franta-hg@20: Instalation franta-hg@20: ----------- franta-hg@0: franta-hg@20: cd java/copy-image-resizer/ franta-hg@20: ant franta-hg@0: franta-hg@20: compiled program is in: dist/copy-image-resizer.jar franta-hg@20: franta-hg@20: you can run it directly: franta-hg@20: java -jar dist/copy-image-resizer.jar franta-hg@20: or install it somewhere and run through th wrapper script: franta-hg@20: scripts/copy-image-resizer.sh franta-hg@20: (link it somewhere on your $PATH as „copy-image-resizer“) franta-hg@20: franta-hg@20: TODO: .rpm and .deb packages franta-hg@20: franta-hg@20: Usage franta-hg@20: ----- franta-hg@20: franta-hg@20: copy-image-resizer supports these options: franta-hg@20: franta-hg@20: --input-dir (mandatory) franta-hg@20: one parameter: path to the input directory franta-hg@20: franta-hg@20: --output-dir (mandatory) franta-hg@20: one parameter: path to the output directory franta-hg@20: franta-hg@20: --size (mandatory, can be used multiple times to generate multiple resolutions) franta-hg@20: 1. parameter: width (integer) franta-hg@20: 2. parameter: height (integer) franta-hg@20: 3. parameter: resizeSmaller (boolean) whether smaller images should be also scaled franta-hg@20: franta-hg@20: --size-named (alternative to --size) franta-hg@20: 1. parameter: width (integer) franta-hg@20: 2. parameter: height (integer) franta-hg@20: 3. parameter: resizeSmaller (boolean) franta-hg@20: 4. parameter: directory (string) output sub-directory for this resolution (default in --size is WIDTHxHEIGHT e.g. 64x64) franta-hg@20: franta-hg@20: --skip-errors (optional, alternative to --skip-errors-silently) franta-hg@20: no parameters franta-hg@20: errors will be just logged and program will fail at the end if any errors franta-hg@20: (default behavior is: fail on first error) franta-hg@20: franta-hg@20: --skip-errors-silently (optional, alternative to --skip-errors) franta-hg@20: no parameters franta-hg@20: errors will be just logged and program will report success even if there were any errors franta-hg@20: franta-hg@20: franta-hg@20: franta-hg@20: Example: franta-hg@20: franta-hg@20: copy-image-resizer --input-dir MyPhotos/ --output-dir MyBlog/ --size 800 600 false --size 1600 1200 false --size-named 300 300 false thumnails franta-hg@20: franta-hg@20: Will generate three output resolutions in separate directories: „MyBlog/800x600“, „MyBlog/1600x1200“ and „MyBlog/thumbnails“ franta-hg@20: franta-hg@20: