~ubuntu-branches/ubuntu/saucy/libjpeg6b/saucy-security

« back to all changes in this revision

Viewing changes to debian/extra/exifautotran

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2010-03-12 09:12:56 UTC
  • Revision ID: james.westby@ubuntu.com-20100312091256-backzcazf8ra3fc6
Tags: 6b-15ubuntu1
* Reintroduce libjpeg-progs, so that it is built against libjpeg6b. It's too
  late to migrate to libjpeg7 in lucid. (LP: #537370)
* debian/rules: Force libjpeg-progs version to 7+really<source version>, so
  that it upgrades from the current 7-1 version. Once we upgrade to libjpeg8
  in the next Ubuntu release, this can just go away again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# exifautotran [list of files]
 
3
#
 
4
# Transforms Exif files so that Orientation becomes 1
 
5
#
 
6
 
 
7
trap "if test -n \"\$tempfile\"; then rm -f \"\$tempfile\"; fi" INT QUIT TERM
 
8
 
 
9
for i
 
10
do
 
11
 case $i in
 
12
 -v|--version) echo "exifautotran"; exit 0;;
 
13
 -h|--help) 
 
14
             cat <<EOF
 
15
exifautotran [list of files]
 
16
 
 
17
Transforms Exif files so that Orientation becomes 1
 
18
EOF
 
19
             exit 0;;
 
20
 esac
 
21
 
 
22
 case `jpegexiforient -n "$i"` in
 
23
 1) transform="";;
 
24
 2) transform="-flip horizontal";;
 
25
 3) transform="-rotate 180";;
 
26
 4) transform="-flip vertical";;
 
27
 5) transform="-transpose";;
 
28
 6) transform="-rotate 90";;
 
29
 7) transform="-transverse";;
 
30
 8) transform="-rotate 270";;
 
31
 *) transform="";;
 
32
 esac
 
33
 if test -n "$transform"; then
 
34
  tempfile=`mktemp`;
 
35
  if test "$?" -ne "0"; then
 
36
    echo "Failed to create temporary file" >&2
 
37
    exit 1;
 
38
  fi
 
39
  echo Executing: jpegtran -copy all $transform $i >&2
 
40
  jpegtran -copy all $transform "$i" > $tempfile
 
41
  if test $? -ne 0; then
 
42
   echo Error while transforming $i - skipped. >&2
 
43
   rm "$tempfile"
 
44
  else
 
45
   cp "$tempfile" "$i"
 
46
   rm "$tempfile"
 
47
   jpegexiforient -1 "$i" > /dev/null
 
48
  fi
 
49
 fi
 
50
done