[KPhotoAlbum] Nikon Raw (NEF) & orientation
Risto H. Kurppa
risto at kurppa.fi
Sun Jun 11 14:45:25 BST 2006
Hi!
I've made a script (attached) that creates jpg files from nef files
(dcraw) , copies the exif - data (exiftool) and sets the jpeg date &
time to the exif datetimeoriginal date/time.
If you want to try it, run it in the folder where you have .nef -
files (it'll search them and create from image.nef a new jpeg image
called image.nef.jpg). On your own responsibility & risk!!
So - this is not the thing. The thing is that the rotation of the
images doesn't quite work..
Sample images are available: http://rhk.homelinux.net/test/kpa_nef_test
jpg_only.jpg
nef+jpg.jpg
nef+jpg.nef
nef+jpg.nef.jpg
nef_only.nef
nef_only.nef.jpg
*.jpg and *.nef are writen by Nikon D70
*.nef.jpg are written by the script attached script (ie. dcraw & exiftool)
exiftool shows
Orientation : Rotate 270 CW
fo all six images.
ok - the interesting thing is what KPA does (compared to what I think
it should do, that is rotate the image to show it vertically)
jpg_only.jpg
shows OK, rotated correctly and everything
nef+jpg.jpg
shows OK, rotated correctly and everything
nef+jpg.nef
shows photo top on right - and photo left on bottom (ie. mirrorized
upside down!)
nef+jpg.nef.jpg
shows photo top on left and photo left on top ie. doesn't rotate
nef_only.nef
shows photo top on right - and photo left on bottom (ie. mirrorized
upside down!)
nef_only.nef.jpg
shows photo top on left and photo left on top ie. doesn't rotate
There is also a screenshot.png in the folder for you to see what KPA
does. The images with black borders are .nef. Remember also that KPA
doesn't show the last file type' (so something.nef is actually
something.nef.jpg!!!!)
Questions:
1a)Can or is it possible to fork KPA to read NEF EXIF?
1b)Should KPA show NEF's better than only the lowest quality preview?
1c)Should KPA rotate NEFs?
2)How to prevent the NEF mirror effect?
3)How to make KPA to rotate also the extracted JPEG:s?
4)Is there something about this EXIF & orientation stuff I don't know
or understand?
#nef_handler.sh
#risto at kurppa.fi 2006-05-22
#requires: dcraw && exiftool installed
re_match=nef
re_match2=NEF
replace=nef.jpg
for i in $(ls | grep -i .nef$)
do
src=$i
echo $src
#generate target filename 1
tgt=$(echo $src | sed -e "s/$re_match/$replace/")
#generate target filename 2
tgt=$(echo $tgt | sed -e "s/$re_match2/$replace/")
#extract jpeg from the nef file
dcraw -cw $src | cjpeg > $tgt
#copy EXIF
exiftool -overwrite_original -TagsFromFile $src $tgt
#update file date from exif
exiftool '-DateTimeOriginal>FileModifyDate' $tgt
done
echo Finished!
Thanks!!
r
--
rhk
|risto h. kurppa / risto at kurppa.fi
|kfor.kurppa.fi - rauhanturvaajana Kosovossa
|www.vastavalo.fi - Suomen laajin avoin kuvatoimisto
|Miksi käyttää keskinkertaista? Parasta on saatavilla vapaasti! ubuntu.sange.fi
|Kissoja ei kannata imuroida. Ei edes vaikka ne olisivat tosi
likaisia. - Antti 8v
More information about the Kphotoalbum
mailing list