CPAN::Forum
Image-ExifTool - Re: XMP coyright field -> IPTC copyright field
| Posted on Mon Feb 25 19:13:41 2008 by frereroy in response to 7192 (See the whole thread of 17) |
| Re: XMP coyright field -> IPTC copyright field |
|
H,
MANY thanks for all you help so far (+ other helpful messages sent from forum)
I've downloaded and looked at both scripts and AppleScript doesn't look to be my thing!
I think that I prefer the shell stuff. I found the following on a French site that uses ImageMagik's convert to make an intermediary bmp file then uses different parts of the XMP and IPTC:
I would like to simplify it and wonder whether the intermediate BMP file is really necessary.
What I am tying to do in fact is to use an image that has been "saved for web" in Photoshop CS3 at 360px wide to insert in articles.
I want it as "slim as possible" the whole XMP block adds 20% to my file size but I want to keep the copyright, a keyword and the the title in IPTC as it takes up very little space.
Here is what I found:
#!/bin/sh
exiftool="/usr/bin/exiftool"
convert="/usr/bin/convert"
if [ ! -x $exiftool ]; then
echo "$exiftool not found"
exit 0
fi
if [ ! -x $convert ]; then
echo "$convert not found"
exit 0
fi
if [ "$1" = "" ]; then
echo "No directory given"
exit 0
fi
if [ ! -d $1 ]; then
echo "$1 is not a directory"
exit 0
fi
dir=$1
for src in $dir/*.jpg; do
echo "Processing $src..."
copy=`echo $src.tmp`
/bin/cp $src $copy
$convert -resize 600x600 -size 600x600 $src $src.bmp
$convert -quality 85 $src.bmp $src
$exiftool -q -overwrite_original \
-TagsFromFile $copy \
-exif:all \
-xmp:Description \
-xmp:Title \
-xmp:Subject \
-xmp:Location \
-xmp:City \
-xmp:State \
-xmp:Country \
-xmp:CountryCode \
-xmp:Rights \
-xmp:Creator \
'-xmp-exif:all > exif:all' \
'-xmp:Description > exif:ImageDescription' \
'-xmp:Title > iptc:Headline' \
'-xmp:Subject > iptc:Keywords' \
'-xmp:Location > iptc:Sub-location' \
'-xmp:City > iptc:City' \
'-xmp:State > iptc:Province-State' \
'-xmp:Country > iptc:Country-PrimaryLocationName' \
'-xmp:CountryCode > iptc:Country-PrimaryLocationCode' \
'-xmp:Rights > iptc:CopyrightNotice' \
'-xmp:Rights > exif:Copyright' \
'-xmp:Creator > iptc:By-line' \
'-xmp:Creator > exif:Artist' \
'-exif:DateTimeOriginal > exif:CreateDate' \
'-xmp:Lens > exif:Lens' \
-xmp:WebStatement \
-ICC_Profile \
'-exif:DateTimeOriginal>FileModifyDate' \
$src
/bin/rm $copy $src.bmp
done
|
| Direct Responses: 7194 | Write a response |
(4)
]