Le 24/06/2010 00:37, Mike Thurston a écrit :

I wish to rename pictures by date taken using UWIN on XP PRO. Can I
access the metadata associated with JPG files from the Uwin environment?
If so, what is the command or method of access.

http://sourceforge.net/projects/libexif/files/

also, to rotate your picture w/o recompressing them, use convert from ImageMagick

here is a sample script :

[[ -d _ ]] || mkdir _ || exit
[[ $# = 0 ]] && set .
for dir; do
cd "$dir" || continue
find *.JPG -maxdepth 0 -print0 | xargs -0n 5 exif |
#exif *.JPG |
awk -v dir="'${OLDPWD}'/_/" '
BEGIN { cmd="convert"; rotate="-rotate"; resample="-resample 72"
resample="-adaptive-resize 1280 -quality 80" }
function foo() {
        if (!f) return
        if (res <= 72) return
        args=resample
        if (deg) args=rotate" "deg" "args
        print cmd" "args" "f" "dir f
}
/JPG/ { foo(); split($0, a, "'"'"'"); f=a[2]; res=deg=0; next }
/left.*bottom/ { deg=-90; next }
/right.*top/ { deg=90; next }
/^x-Resolution/ { sub(".*[|]",""); res=$0+0; next }
END { foo(); }
' |
cat
cd "${OLDPWD}"

Regards,

Cyrille Lefevre
--
mailto:[email protected]



_______________________________________________
uwin-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/uwin-users

Reply via email to