Sha256: 195c0187a730bdf12653f9d760a143195c8cd0e65c612bc450002a55bc14870e

Contents?: true

Size: 1.08 KB

Versions: 14

Compression:

Stored size: 1.08 KB

Contents

#!/bin/bash

# This script requires ladon, dcraw, exiftool, and jpeg-recompress
# Usage:
#   $ cd path/to/photos
#   $ jpeg-archive
# Compressed JPEGs are now in ./Comp/*

if [ $1 == '--help' ]; then
    echo 'JPEG-Archive - Compress RAW and JPEG images in the current folder'
    echo 'Usage: jpeg-archive [options]'
    echo ''
    echo 'Possible compression options:'
    echo "`jpeg-recompress --help | tail -n+6`"
    exit 255
fi

if [ $1 == '--version' ]; then
    jpeg-recompress --version
    exit 255
fi

set -e

# Cleanup old files
rm -rf Comp
rm -rf /tmp/comp

echo 'Converting RAW files...'
ladon -m /tmp/comp/RELDIR '**/*.+(cr2|nef|dng)' -- "dcraw -w -q 3 -c RELPATH | jpeg-recompress ${@:--q high} --ppm - /tmp/comp/RELDIR/BASENAME.jpg"

echo 'Copying EXIF data...'
ladon '**/*.+(cr2|nef|dng)' -- exiftool -overwrite_original -TagsFromFile RELPATH -all:all /tmp/comp/RELDIR/BASENAME.jpg

echo 'Recompressing JPEG files'
ladon -m /tmp/comp/RELDIR '**/*.jpg' -- jpeg-recompress ${@:--q high} RELPATH /tmp/comp/RELPATH

mv /tmp/comp Comp

echo 'Done! Compressed files are in the Comp folder.'

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
image_compressor_pack-1.0.0.1-amd64-freebsd-11 ports/x86_64-unknown-freebsd11.0/jpeg-archive/2.1.1/bin/jpeg-archive
image_compressor_pack-1.0.0.1-x86_64-darwin-16 ports/x86_64-apple-darwin16.1.0/jpeg-archive/2.1.1/bin/jpeg-archive
image_compressor_pack-1.0.0.1-x86_64-darwin-15 ports/x86_64-apple-darwin15.6.0/jpeg-archive/2.1.1/bin/jpeg-archive
image_compressor_pack-1.0.0.1-universal-darwin-16 ports/x86_64-apple-darwin16.1.0/jpeg-archive/2.1.1/bin/jpeg-archive
image_compressor_pack-1.0.0.1-universal-darwin-15 ports/x86_64-apple-darwin15.6.0/jpeg-archive/2.1.1/bin/jpeg-archive
image_compressor_pack-1.0.0.1-amd64-freebsd-10 ports/x86_64-unknown-freebsd10.3/jpeg-archive/2.1.1/bin/jpeg-archive
image_compressor_pack-1.0.0.1-x86-linux ports/i686-linux-gnu/jpeg-archive/2.1.1/bin/jpeg-archive
image_compressor_pack-1.0.0.1-x86_64-linux ports/x86_64-linux-gnu/jpeg-archive/2.1.1/bin/jpeg-archive
image_compressor_pack-0.1.3-x86_64-darwin-14 ports/x86_64-apple-darwin14.3.0/jpeg-archive/2.1.1/bin/jpeg-archive
image_compressor_pack-0.1.3-universal-darwin-15 ports/x86_64-apple-darwin15.0.0/jpeg-archive/2.1.1/bin/jpeg-archive
image_compressor_pack-0.1.3-x86_64-darwin-15 ports/x86_64-apple-darwin15.0.0/jpeg-archive/2.1.1/bin/jpeg-archive
image_compressor_pack-0.1.3-x86-linux ports/i686-linux-gnu/jpeg-archive/2.1.1/bin/jpeg-archive
image_compressor_pack-0.1.3-x86_64-linux ports/x86_64-linux-gnu/jpeg-archive/2.1.1/bin/jpeg-archive
image_compressor_pack-0.1.3-amd64-freebsd-10 ports/x86_64-unknown-freebsd10.3/jpeg-archive/2.1.1/bin/jpeg-archive