Re: EXIFPlot: EXIF and bining

Replies:

Parents:


This EXIF data is also available with the utility jhead.

If you're running debian:

apt-get install jhead

http://www.sentex.net/~mwandel/jhead/

I use it with jpegtran to rotate images based on their orientation.

apt-get install libjpeg-progs

http://jpegclub.org/

Excerpt from photo organization script, based at one point on Gerald's
that makes thumbnails, index file and other html pages for medium
view, etc.

http://impressive.net/software/photo/source/


for i in `ls *jpg`; do
   jhead $i | egrep -q '^Orientation' && orientator $i    
done

I split the orientation out into orientator script:

#!/bin/sh -x

filename=$1
cp $filename $filename.EGP
echo "rotating $filename"
jpegtran -rotate `jhead $filename | grep 'Orientation' | sed -e \
's/.*rotate //'` $filename.EGP > $filename

So this will rotate 90, 180 or 270 degrees as needed.

I also started displaying jhead data, exposure, aperture, date etc. on
my photo pages.

I was doing so at first with Server Side Includes but decided to make
it static.

SSI approach excerpt:

echo "<pre><!--#exec cmd=\"echo \$DOCUMENT_NAME | sed -e \
's/shtml/jpg/' | xargs /usr/bin/jhead\" --></pre><!--#include \
virtual=\"/include/footer\" -->" >> $i-med.shtml

static:

echo "<pre>`jhead $i.jpg`</pre><!--#include \
virtual=\"/include/footer\" -->" >> $i-med.shtml

There are some addons for generating xml of jhead data.  It would be
pretty simple to generate xhtml or other output from this util but I
haven't bothered yet.  I might one day adopt one of the rdf and xhtml
solutions for my photos from others on this list.

--
Ted Guild <[email protected]>
http://www.guilds.net

Re: EXIFPlot: EXIF and bining

Replies:

  • None.

Parents:

Script orgy.

Le 07 d�c. 2003, � 13:37, Ted Guild a �crit :
> for i in `ls *jpg`; do
>     jhead $i | egrep -q '^Orientation' && orientator $i
> done
>

I'm using a small script similar to others I guess

#!/bin/sh
# photodated.sh
# Quick and dirty script by Stephanie Troeth
#  updated by Karl Dubost
# We expect one argument only
if [ $# != 1 ]; then
        echo ""
        echo "Usage: iphotocleanup.sh <root-dir>"
        echo ""
        echo "This program:-"
        echo "  * ensures that your photo files have the last modified
time of when they were taken (according to EXIF DateTimeOriginal) and
put them in dated space"
        exit 1
fi


rootdir=$1

# Here we find all the photo files and changed the last modified date
according
# to the relevant EXIF information in each photo file.
#
# I've put in a filter for DCP*.JPG or IMG*.JPG because my photos are
named
# that way by my cameras. You might have to change this bit to whatever
suits
# your file.

list=`find $1 -iname "*.JPG" -print`
for file in $list
{
        echo "Touching $file"

        datepath=`epinfo $file | grep DateTimeOriginal | sed
's/DateTimeOriginal
=//g;s/"//g;' | awk '{print $1}'|sed 's/:/\//g'`

        phototime=`epinfo $file | grep DateTimeOriginal | sed
's/DateTimeOrigina
l=//g;s/"//g;' | awk '{print $2}'|sed 's/:/-/g'`

        mkdir -p "$HOME/Pictures/$datepath/"
        filename="$HOME/Pictures/$datepath/pic$phototime.jpg"
        echo "move to $filename"
        mv $file $filename
      }



HURL: fogo mailing list archives, maintained by Gerald Oskoboiny