[KPhotoAlbum] Importing Canon raw files

Shawn Willden shawn-kimdaba at willden.org
Tue May 9 22:55:32 BST 2006


On Tuesday 09 May 2006 14:48, Robert L Krawitz wrote:
> Hmm.  I'm quite sure that I extracted it with Dave Coffin's parse
> program, and it was 1.5 MB, but I've set my camera to large fine +
> RAW.  I thought the 20D and XT did the same thing.  The original Rebel
> was certainly different.

Two images that I shot just now, same scene (mounted on a tripod).  The first 
was RAW+JPEG, the second RAW only:

-rw-r--r-- 1 shawn shawn 9485856 May  9 15:21 IMG_0547.CR2
-rw-r--r-- 1 shawn shawn 2645694 May  9 15:21 IMG_0547.JPG
-rw-r--r-- 1 shawn shawn 7230346 May  9 15:21 IMG_0548.CR2

Notice how much larger the first CR2 file is?  I noticed that and wondered 
why.  Looking into it, I found that the CR2 from the RAW+JPEG contains two 
embedded JPEGs.  The relevant bits of the exiftool output are:

    Preview Image Length            : 2627102
    Thumbnail Length                : 8864

And:

    PreviewImageLength              : 337791
    ThumbnailLength                 : 9193

Extracting the preview images and running identify on them shows:

IMG_0547.jpg JPEG 3456x2304 DirectClass 2.5mb 0.810u 0:02
IMG_0548.jpg[1] JPEG 1536x1024 DirectClass 330kb

The downloaded JPEG is a bit larger than the extracted JPEG, but using 
exiftool to copy the EXIF data from the CR2 to the extracted JPEG gets them 
very close (the extracted JPEG + copied EXIF data is a little larger).  
Finally, if I convert both JPEGs to PPM format, they have identical md5sums.

Is the 20D really different in this respect?

BTW, if you're not familiar with exiftool, look into it.  It's kind of slow, 
but the best EXIF manipulation tool I've found.  It can read EXIF data 
directly from the CR2 file, and it can copy EXIF data, either wholesale or as 
specified from one file to another.  On Debian:

	apt-get install libimage-exiftool-perl

> I never, NEVER edit the RAW file in any way.  My import script sets it
> read-only as soon as it can.

I can see that.  I've verified pretty thoroughly (to my satisfaction, anyway) 
that removing the embedded JPEG from the RAW file doesn't remove anything of 
substance, so I'm comfortable with it.  If I were to leave it in, I'd 
probably delete the downloaded JPEG, since it's trivial to extract it from 
the CR2.

	Shawn.




More information about the Kphotoalbum mailing list