Page 1 of 1

Canon CR2 large thumbnail

Posted: Wed Sep 03, 2008 2:17 pm
by KingLeonid

I'm trying to use GFL for loading Canon CR2 files. I need to load thumbnail first, then after user clicks on it, load full image.
I faced the following problem with thumbnails for CR2:
If I load embedded thumbnail then it loads very fast but thumbnail is very small. I need larger thumbnail images (256x256 for example) and I know that inside CR2 format there is not only thumbnail + raw sensor full size image, but there is also a large JPEG image - some kind of large preview.
For exmaple in CR2 file with 10Mpix image, there is also 3Mpix jpeg image inside.

Could GFL load that portion of CR2 (IFD #1 Segment) into memory using fast JPEG decoding algorithm?

P.S: I know that some viewers use this segment for displaying CR2 instead of loading raw sensor data.

Posted: Fri Sep 05, 2008 9:20 am
by KingLeonid
May be I choose incorrect forum for my question?
Pierre, could you, please, give me an answer to my question.

Posted: Fri Sep 05, 2008 1:15 pm
by xnview
Could try with gflLoadThumbnail & 0 as w/h size

Posted: Fri Sep 05, 2008 1:45 pm
by KingLeonid
Thank you for reply.
Now I've got it with LOAD_PARAMS.Flags=0, w=, h=0.
If I set Flags = EMBEDDED_THUMBNAIL then I got small picture, that's also good.

But anyway the loading process of the large preview image is very slow. :(

I've just compared two tests:
1. Loading larger preview 1953x1301 from CR2 file via LoadThumbnail
2. Loading the same image 1953x1301 from previously saved JPEG file via LoadBitmap

And I could say that loading image from JPEG at least three times faster.
But why?

P.S: According to CR2 spec that I found in the INET, larger preview is also compressed by JPEG algorithm.
PPS: My original size of CR2 is 3906 x 2602.

Posted: Fri Sep 05, 2008 1:58 pm
by xnview
Please send me a CR2?

Posted: Fri Sep 05, 2008 2:17 pm
by KingLeonid
I've uploaded zip archive with 2 images - CR2 + JPEG from my test example.
ZIP is 8.6 Mb of size.
Here is the link:

Thank you for cooperation.

Posted: Mon Sep 08, 2008 7:26 am
by xnview
With your file, i get a embedded thumbnail of 1936x1288, it's quick

Posted: Mon Sep 08, 2008 7:58 am
by KingLeonid
Dear Pierre,
If I use GFL_LOAD_EMBEDDED_THUMBNAIL then I only got very small image 160x120.
Here is the code:

Code: Select all

errcode = gflLoadThumbnail(fname, 0, 0, &ibitmap, &param, 0);
If I do not modify default thumbnail params, then I get large preview but loading is slow.

Posted: Mon Sep 08, 2008 8:04 am
by xnview
So send me your email by PM, i'll send new SDK

Posted: Mon Sep 08, 2008 11:58 am
by KingLeonid
Dear, Pierre

Thank you for your new version of SDK.
Libgfl290 now works well, and loads large preview very fast.

I really appreciate your early replies and your help in fixing this problem.

Re: Canon CR2 large thumbnail

Posted: Fri Jan 18, 2013 5:54 pm
by barry
Dear Pierre!

I have the same problem with loading embedded Thumbnails from RAW-files for Canon PowerShot cameras (with CHDK).

Code: Select all

    fGflErrCode := gflLoadThumbnailW(PWideChar( filename ), 0, 0, @gfl_bmp, @lp, finfo);
This code loading a very large thumbnail (1836x1380 px).
You need original RAW-files (.CRW, .DNG)?

Re: Canon CR2 large thumbnail

Posted: Fri Jan 18, 2013 6:17 pm
by barry
XnView also build Thumbnail for directory with this RAW-files large time (generate from source image).

Re: Canon CR2 large thumbnail

Posted: Mon Jan 21, 2013 10:37 am
by xnview
yes in RAW you can have big image

Re: Canon CR2 large thumbnail

Posted: Tue Jan 29, 2013 9:13 am
by barry
xnview wrote:yes in RAW you can have big image
The original big image I load without problems through gflLoadBitmap. But I mean, if I load the embedded Thumbnail - it is also converted from a large original image, but not extracted from EXIF.