[KPhotoAlbum] Patch: rotation of raw thumbnails

Michael J Gruber michaeljgruber+gmane at fastmail.fm
Wed Feb 21 09:52:43 GMT 2007


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




More information about the Kphotoalbum mailing list