[KPhotoAlbum] Patch: rotation of raw thumbnails

Risto H. Kurppa risto at kurppa.fi
Wed Feb 21 11:05:12 GMT 2007


Hi!

Good news about rotation!

About resolution: My KPA shows me a really low res preview of the NEF
and as far as I know, NEF includes some kind of low resolution
thumbnail.

I noticed that 'exiv2 -Pxgnycsh DSC_8439.NEF ' (version 0.10)
prints me a lot of stuff, including this:

0x0099 Nikon3       NEFThumbnailSize            Short       2   4
  0000  f0 05 f0 03

exiftool print includes these lines:
Jpg From Raw Start              : 131072
Jpg From Raw Length             : 713898
Jpg From Raw                    : (Binary data 713898 bytes, use -b
option to extract)
Preview Image                   : (Binary data 25390 bytes, use -b
option to extract)

(exif tool site: http://www.sno.phy.queensu.ca/~phil/exiftool/ and if
down, see google cache
http://216.239.59.104/search?q=cache:6t16A4Ez7zsJ:www.sno.phy.queensu.ca/~phil/exiftool/+exiftool&hl=fi&ct=clnk&cd=1&gl=fi&client=firefox-a
)

exiftool -b -PreviewImage DSC_8439.NEF > preview.jpg
gave me a 564x372px preview image

exiftool -b -ThumbnailImage DSC_8439.NEF > thumbnail.jpg
gave me an empty preview image..

Examples to extract:
http://216.239.59.104/search?q=cache:xxwIY1C1BVYJ:www.sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html+exiftool+extract+preview&hl=fi&ct=clnk&cd=2&gl=fi&client=firefox-a

This page http://pages.quicksilver.net.nz/pepe/d70/Nikon_D70_on_Linux.html
tells:
"gqview, which uses the GTK library to load images, finds the first
(smaller 120x160) thumbnail but knows nothing of the second, larger
one. Here is an appalling patch for version 1.5.X to remedy the
situation, which requires a working nefextract in you path first. You
want jpegtran in your path as well to enable auto rotation (there is a
good chance it is already installed for your system).  Right click and
choose (Edit -> In the Gimp...) to complete a reasonable single photo
workflow."

AFAIK  this is my case, the preview images KPA shows are around
120x160px (though this is about GTK & GQview, but anyway..)

It's a great step to see NEF:s orientate properly, another would be to
see proper previews of NEF:s (a small res NEF preview on full screen
is awful - that's why I always have to run a script that creates JPG:s
from my NEF:s and the try to hide NEF:s from KPA to see..)

r



2007/2/21, Michael J Gruber <michaeljgruber+gmane at fastmail.fm>:
> Risto H. Kurppa venit, vidit, dixit 2007-02-20 12:39:
> > Great job!
> >
> > It'd be really great to make this work!
> >
> > You can find a portrait Nikon D70 NEF at
> > http://rhk.homelinux.net/temp/dsc_7687.nef (5Mb or so..)
> >
> > Please report if it works! Also please let me know if .nef preview is
> > handled the same way your cr2:s (a really low resolution preview).
>
> Thanks Risto and Robert for the files.
>
> Here's some more info and reports: KPA uses different code for
> displaying (i.e.: reading EXIF info) resp. creating thumbnails of raw
> files: exiv2 resp. an embedded version of parse.c (with parts of
> dcraw.c) by D. Coffin.
>
> Therefore, test results for KPA depend on the version of exiv2 on your
> system!
>
> On an old Suse 9.3 box, exiv2 doesn't recognize any EXIF in raw files,
> therefore KPA doesn't know any rotation info. The thumbnail creation
> code recognizes orientation info in 20D and 350D files but not D70
> files, so it saves thumbnails rotated for the former (which is
> incorrect) and they display correctly (before my patch); the D70 file is
> displayed incorrectly. After my patch, none gets displayed correctly,
> simply because of the old exiv2.
>
> On a (modestly) current Fedoa Core 5, exiv2 is reasonably up to date.
> None of the Canon raw files get displayed correctly before the patch,
> only the Nikon nef does. All of them and the Nikon get displayed
> correctly after my patch. Yep ;)
>
> Regarding the resolution:
> With my 350D, if I shoot in RAW+JPG mode the camera saves a JPG and a
> CR2 (raw), and the CR2 has a full size "thumbnail" embedded. I have to
> test, but I think if I shoot in RAW mode only the CR2 gets a much
> smaller thumbnail. This is somewhat dumb: I have to choose between RAW+2
> JPGs (one embedded, one extra) and RAW only.
>
> Robert's 20D file has a 1.1MP (or so) embedded thumbnail. Other RAW
> files from other cameras have thumbs between 0.6MP and 1.2MP or so.
>
> The Nikon nefs have 0.0MP :(
>
> KPA uses that thumbnail extraction code also for displaying raw files.
> This works perfectly for the CR2s I shoot in CR2+JPG mode (because of
> the full size "thumbnail") and not so nicely for your nef.
>
> In the end, I think KPA should use the same library for everything
> around raw images. The KIPI folks came up with libkdcraw which might be
> just what we need. Still, processing the raw file (rather than
> extracting an embedded thumbnail) just in order to get a thumbnail
> should be way too expensive. And, unfortunately, exiv2 doesn't find the
> thumbnail in the D70 nef file.
>
> Michael
>
> _______________________________________________
> KPhotoAlbum mailing list
> KPhotoAlbum at kdab.net
> http://mail.kdab.net/mailman/listinfo/kphotoalbum
>
>


-- 
rhk

| risto h. kurppa
| risto at kurppa.fi
| http://risto.kurppa.fi



More information about the Kphotoalbum mailing list