====Unixscripts:Photos==== These are useful in manipulating photos (jpegs). They depend on my library **argp.sh**(1) - see [[unixscripts:0-intro|Unix Scripts]] - and these external packages are required **jhead**(1), **jpgtrans**(1), netpbm-progs (**pnmscale**(1)), libjpeg (**djpeg**(1), **cjpeg**(1)) ===erect-jpeg=== {{scripts:erect-jpeg | erect-jpeg }} - rotate a photo so that it displays correctly by examining the Orientation Exim information in the file. Uses **xargs**(1) to parallelise operations to as many CPUs as it can find. ++++ usage for label-photos | {{page>usages:erect-jpeg&inline}} ++++ ===label-photos=== {{scripts:label-photos | label-photos }} - view *.jpg files and prompts for a label for each, putting the label into the Exif comment field. It also recurses through any directories called ''zoom'', applying the same label to photos of the same name. ++++ usage for label-photos | {{page>usages:label-photos&inline}} ++++ ===rename-jpeg-by-date=== {{scripts:rename-jpeg-by-date | rename-jpeg-by-date }} - renames jpg files according to the date reported by jhead ++++ usage for rename-jpeg-by-date | {{page>usages:rename-jpeg-by-date&inline}} ++++ === resize-jpeg === {{scripts: resize-jpeg| resize-jpeg }} - size a jpeg so that the longest side is the required number of pixels and the other side is scaled. ++++ usage for resize-jpeg | {{page>usages:resize-jpeg&inline}} ++++ === shrink-jpeg === {{scripts:shrink-jpeg| shrink-jpeg }} - passes photos through **djpeg**(1) and **cjpeg**(1) which can result in a size reduction of about 50% without compromising much on quality. The amount of shrinkage depends on the camera, of course. ++++ usage for shrink-jpeg | {{page>usages:shrink-jpeg&inline}} ++++ -----