2017-09-22 22:58:29 +02:00
|
|
|
apply-exif-orientation.sh
|
|
|
|
=========================
|
|
|
|
|
|
|
|
`apply-exif-orientation.sh` retrieves the Orientation EXIF tag from an image
|
|
|
|
file and rotates the actual image data according to the said orientation. The
|
|
|
|
EXIF Orientation tag is deleted in the process. The goal is to allow the image
|
|
|
|
to be displayed correctly by tools that don't handle EXIF metadata (such as
|
|
|
|
ImageMagick's display).
|
|
|
|
|
|
|
|
EXIF information is manipulated using exiftool, shipped with the
|
|
|
|
`Image::ExifTool` Perl module (Debian package: `libimage-exiftool-perl`).
|
|
|
|
Image is rotated using ImageMagick's `convert`.
|
|
|
|
|
|
|
|
**Warning**: no backup of the original file is made!
|
2017-09-23 05:30:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
tiff-batch-convert.sh
|
|
|
|
===============
|
|
|
|
|
|
|
|
`tiff-batch-convert.sh` converts TIFF images to another format of your choice,
|
|
|
|
such as JPEG.
|
|
|
|
|
|
|
|
Use case: you have a bunch of albums that you scanned to TIFF to preserve
|
|
|
|
quality, with a good resolution, each album being in its own directory. But
|
|
|
|
TIFFs are big; you want to generate compressed versions of the albums, possibly
|
|
|
|
down-scalling the images, to share on the Internet or copy them to your
|
|
|
|
smartphone.
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
|
2017-10-06 16:31:03 +02:00
|
|
|
tiff-batch-convert.sh <QUALITY> <DESTINATION> <ALBUM1> [ALBUM2 [...]]
|
|
|
|
|
|
|
|
<QUALITY> impacts the resolution of the converted pictures; it can be "low",
|
|
|
|
"medium" or "high". Use "high" for no rescaling. The actual size of the
|
|
|
|
pictures for "low" and "medium" is hard-coded in the script (see "Limitations
|
|
|
|
and bugs" below).
|
2017-09-23 05:30:51 +02:00
|
|
|
|
|
|
|
`<DESTINATION>` is the base directory in which the converted albums will be
|
|
|
|
stored; each album will be in a separate sub-folder
|
|
|
|
|
|
|
|
For example, this will convert every album under
|
|
|
|
`$HOME/Pictures/my_albums_tiff` and store the result under
|
|
|
|
`/mnt/usb0/my_albums_lowres` (supposedly a USB drive):
|
|
|
|
|
|
|
|
tiff-batch-convert.sh /mnt/usb0/my_albums_lowres $HOME/Pictures/my_albums_tiff/*
|
|
|
|
|
|
|
|
Limitations and bugs:
|
|
|
|
|
2017-10-06 16:31:03 +02:00
|
|
|
- Existing destination files will be **OVERWRITTEN WITHOUT WARNING**!
|
2017-09-23 05:30:51 +02:00
|
|
|
- Input files must have the extention `.tiff` (lowercase), not `.tif`.
|
|
|
|
- The albums provided on the command-line must contain TIFF images directly;
|
|
|
|
sub-folders won't be searched.
|
|
|
|
- Similarly, the full hierarchy of the input albums is *not* preserved: each
|
|
|
|
album will be generated as a subfolder of `<DESTINATION>`, even if the
|
|
|
|
original albums are stored in different places. It is easy to modify this
|
|
|
|
behaviour in the script if needed.
|
2017-10-06 16:31:03 +02:00
|
|
|
- To change the output format or the size of the generated pictures (for "low"
|
|
|
|
and "medium" quality settings), you will have to edit the script (see the
|
|
|
|
"USER CONFIGURATION" section of the script).
|
2017-09-23 05:30:51 +02:00
|
|
|
|
|
|
|
Dependencies:
|
|
|
|
|
|
|
|
- `convert` from ImageMagick (pkgsrc: ImageMagick, Debian: imagemagick)
|
|
|
|
- `tiffinfo` from libtiff (pkgsrc: tiff, Debian: libtiff-tools)
|