Newer
Older
Import / code / .svn / pristine / 0b / 0b83507e4d7c8e2d0e0c7ca496a27cfc18a83ee7.svn-base
@John John on 29 Dec 2020 476 bytes bulk import from macbookpro checkouts
#!/bin/bash
IFS='
'
fpaths=`echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | sort`
for file in $fpaths
do
  if [ -f "$file" ]; then
	base=${file%.*}
	ext=${file##*.}
	if [[ ( ( "$ext" == "JPG" ) || ( "$ext" == "jpg" ) ) || ( ( "$ext" == "jpeg" ) || ( "$ext" == "JPEG" ) ) ]]; then
		cp "$file" "$base-tmp-cpy.jpg"
		exifautotran "$base-tmp-cpy.jpg"
		jpegtopnm "$base-tmp-cpy.jpg" | pnmtops -noturn | ps2pdf13 -sPAPERSIZE=a4 - "$base.pdf"
		rm "$base-tmp-cpy.jpg"
	fi
  fi
done