<?xml version="1.0" encoding="UTF-8" ?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Posteet: identify</title> 
    <link>http://www.posteet.com/</link> 
    <description>Recent posteets posted to Posteet</description>
    <ttl>60</ttl>

    
    <item>
        <title>Renommer des photos avec l'aide de leurs informations EXIF</title>
        <link>http://www.posteet.com/view/1021</link>
        <description>
        <![CDATA[<pre>#!/bin/bash

repertoire=$1
nomsortie=$2

# Lancement de l'outil d'ImageMagick
traite_exif ()
{
	exif=`identify -verbose -quiet &quot;$i&quot; 2&gt;&gt; /dev/null | grep 'xif:DateTime:' | tr -d ' '`
	if test &quot;$exif&quot; = &quot;&quot;;then continue;fi
	annee=`echo $exif | cut -d ':' -f3`
	mois=`echo $exif | cut -d ':' -f4`
	jour=`echo $exif | cut -d ':' -f5 | cut -c1-2`
	heure=`echo $exif | cut -d ':' -f5 | cut -c3-4`
	minute=`echo $exif | cut -d ':' -f6`
	seconde=`echo $exif | cut -d ':' -f7`
	date_complete=`printf '%s_%s_%s_%sh%sm%s_%s.jpg' $annee $mois $jour $heure $minute $seconde &quot;$nomsortie&quot;`
	echo &quot;${date_complete}&quot;
	cp $i $repertoire/$nomsortie/$date_complete
}

# On verifie qu'un repertoire a ete entre
if test &quot;$repertoire&quot; = &quot;&quot;
then
	echo &quot;Veuillez preciser le repertoire de photos a traiter !&quot;
	exit 1
fi

# On verifie qu'un nom a ete entre
if test &quot;$nomsortie&quot; = &quot;&quot;
then
	echo &quot;Veuillez preciser un nom de fichier generique a donner a vos photos !&quot;
	exit 2
fi

# On verifie que le programme identify existe
which identify &gt;&gt; /dev/null 2&gt;&gt; /dev/null
identify_exists=`echo $?`
if test $identify_exists -ne 0
then
	echo &quot;Veuillez installer ImageMagick !&quot;
	exit 1
fi

mkdir $repertoire/$nomsortie

ls -b1 $repertoire/* | while read i
do
	nb_char=`echo -n &quot;$i&quot; | wc -c`
	prem_char=`expr $nb_char - 3`
	extension=`echo &quot;$i&quot; | cut -c${prem_char}-${nb_char} | tr a-z A-Z`
	if test &quot;JPEG&quot; = &quot;$extension&quot; || test &quot;.JPG&quot; = &quot;$extension&quot;
	then
		traite_exif &quot;$i&quot;
	fi
done</pre> <a href="http://www.posteet.com/tags/exif">[exif]</a>  <a href="http://www.posteet.com/tags/identify">[identify]</a>  <a href="http://www.posteet.com/tags/ImageMagick">[ImageMagick]</a>  <a href="http://www.posteet.com/tags/photos">[photos]</a> ]]>        </description>
        <dc:creator>benoitbalon</dc:creator>
        <pubDate>Wed, 18 Jun 2008 17:13:01 +0000</pubDate>

            <category>exif</category>
            <category>identify</category>
            <category>ImageMagick</category>
            <category>photos</category>
    
    </item>


</channel>
</rss>
