Canon CR2 large thumbnail
Moderators: XnTriq, helmut, xnview
-
- Posts: 6
- Joined: Wed Sep 03, 2008 2:06 pm
Canon CR2 large thumbnail
Hi,
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.
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.
Best regards, Leo.
-
- Posts: 6
- Joined: Wed Sep 03, 2008 2:06 pm
-
- Author of XnView
- Posts: 44449
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- Posts: 6
- Joined: Wed Sep 03, 2008 2:06 pm
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.
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.
Best regards, Leo.
-
- Author of XnView
- Posts: 44449
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- Posts: 6
- Joined: Wed Sep 03, 2008 2:06 pm
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: http://xnc.jinr.ru/personal/download/canon.zip
Thank you for cooperation.
ZIP is 8.6 Mb of size.
Here is the link: http://xnc.jinr.ru/personal/download/canon.zip
Thank you for cooperation.
Best regards, Leo.
-
- Author of XnView
- Posts: 44449
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- Posts: 6
- Joined: Wed Sep 03, 2008 2:06 pm
Dear Pierre,
If I use GFL_LOAD_EMBEDDED_THUMBNAIL then I only got very small image 160x120.
Here is the code:
If I do not modify default thumbnail params, then I get large preview but loading is slow.
If I use GFL_LOAD_EMBEDDED_THUMBNAIL then I only got very small image 160x120.
Here is the code:
Code: Select all
gflGetDefaultThumbnailParams(¶m);
param.Flags |= GFL_LOAD_EMBEDDED_THUMBNAIL;
errcode = gflLoadThumbnail(fname, 0, 0, &ibitmap, ¶m, 0);
Best regards, Leo.
-
- Author of XnView
- Posts: 44449
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- Posts: 6
- Joined: Wed Sep 03, 2008 2:06 pm
-
- Posts: 3
- Joined: Tue Jan 08, 2013 7:17 pm
Re: Canon CR2 large thumbnail
Dear Pierre!
I have the same problem with loading embedded Thumbnails from RAW-files for Canon PowerShot cameras (with CHDK).
This code loading a very large thumbnail (1836x1380 px).
You need original RAW-files (.CRW, .DNG)?
I have the same problem with loading embedded Thumbnails from RAW-files for Canon PowerShot cameras (with CHDK).
Code: Select all
lp.Flags := GFL_LOAD_EMBEDDED_THUMBNAIL;
fGflErrCode := gflLoadThumbnailW(PWideChar( filename ), 0, 0, @gfl_bmp, @lp, finfo);
You need original RAW-files (.CRW, .DNG)?
-
- Posts: 3
- Joined: Tue Jan 08, 2013 7:17 pm
Re: Canon CR2 large thumbnail
XnView also build Thumbnail for directory with this RAW-files large time (generate from source image).
-
- Author of XnView
- Posts: 44449
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- Posts: 3
- Joined: Tue Jan 08, 2013 7:17 pm
Re: Canon CR2 large thumbnail
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.xnview wrote:yes in RAW you can have big image