Author |
Topic  |
quantuz
 
Sweden
55 Posts |
Posted - Oct 13 2014 : 12:32:00
|
Hi,
I have some low memory resource problem unhandled exception when loading camera raw using dcrawlib.dll I load about 5 5000x4000 .cr2 images at the same time, when I get to the fifth image the XE debugger just suddenly exit my application and Im back at the XE editor enviroment, like I made a program reset. I'm running XE2 IE 5.1 C-builder with the following code
aviIEIO_->AttachedIEBitmap = myiEBitmapPtr; aviIEIO_->Params->RAW_ExtraParams = "-w -4 -o 1 -W"; aviIEIO_->LoadFromFile(myimage.cr2);
Is there a missing error handeling in the IE code? A assert or throw without a destination? It works fine when I load same images as TIFF.
Best regards, //Christer |
|
xequte
    
39142 Posts |
|
quantuz
 
Sweden
55 Posts |
Posted - Oct 14 2014 : 23:26:50
|
Hi Nigel,
Here is a download link. http://aragonsystem.com/Download/IEmemTest.zip Try loading about 10 images in a row of the cr2 image in the /image directory. The IEview dont update the display, it gets white for me, mem use is about 1GB, after image 10+ mem is stuck at 1GB. The demo dont pops back to the editor as it does for us.
Regards, //Christer |
 |
|
Uwe
  
284 Posts |
Posted - Oct 15 2014 : 07:56:46
|
Christer, how much RAM do you have? Could it be that you're simply running out of memory?
-Uwe |
 |
|
quantuz
 
Sweden
55 Posts |
Posted - Oct 15 2014 : 13:30:32
|
Hi,
I have 6GB and if memory runs out I think IE shuold put the image OnDisk, I think that is the behaviour if I run the Allocate demo I made (the [Start] button), when memory is low Allocate alocates to Disk. I would be greate is LoadFromFile() could return status code that mem is out or unable to allocate. Now we check if the IEbitmap widht=0 then we try to cleanup mem and try again.
//Christer
|
 |
|
Uwe
  
284 Posts |
Posted - Oct 15 2014 : 15:53:36
|
Christer, the CR2 file you've posted seems to be corrupted. If I try to open the image or read its EXIF data, I get a "Floating point division by zero" error. It's not even possible to extract the EXIF thumbnail. Canon's DPP (Digital Photo Professional) crashes immediately if I try to open the image by the way.
-Uwe |
 |
|
quantuz
 
Sweden
55 Posts |
Posted - Oct 19 2014 : 04:59:13
|
Hi, Now I have found a sequence where the demo in the link below crash the load raw image application test. Download and run IEMemTest.exe (or compile the project) http://aragonsystem.com/Download/IEmemtest2.zip Then press [Load raw] and load the .cr2 image in the /Image directory, repeat this about 7-10 times until the application crash.
Regards, //Christer |
 |
|
Uwe
  
284 Posts |
Posted - Oct 19 2014 : 10:58:42
|
Christer,
Delphi 2010 Pro, ImageEn 4.3.0:
The "Floating point division by zero" (see above) happens when retrieving the image dimensions. I'm using
{...} FileType := FindFileFormat(SelectedPath, false ); ImageEnVect1.IO.ParamsFromFileFormat(SelectedPath, FileType); {...}
and
Width := ImageEnVect1.IO.Params.Width;
I've noticed by the way that your image dimensions (3744 x 5616) are off compared to regular Canon 5D Mark II files (3753 x 5634). Why is that?
Hope this helps -Uwe |
 |
|
quantuz
 
Sweden
55 Posts |
Posted - Oct 19 2014 : 12:03:21
|
Hi Uwe, Do you get the "Floating point division by zero" from IE when you call ImageEnVect1.IO.Params.Width; ? I Think IE should detect when Resources are low and return graceful with an error code and not hard exit as happens now. Now the test app hard exit when aviIEIO_->LoadFromFile(fileName); is called catch is not reached. Not sure about why the image dimension is of, I'l see if I can find out. //Christer |
 |
|
Uwe
  
284 Posts |
Posted - Oct 19 2014 : 12:47:24
|
Hi Christer,
No, the exception is caused by the ImageEnVect1.IO.ParamsFromFileFormat() call.
Still wondering why your image is the only CR2 file that ever managed to crash my application this way. Can you do me a favor and test against some 5DII images from another source (scroll down to the sample RAW files), please?
http://www.photographyblog.com/reviews_canon_eos_5d_mark_ii_3.php
-Uwe
|
 |
|
quantuz
 
Sweden
55 Posts |
Posted - Oct 19 2014 : 14:53:49
|
Hi Uwe,
Tried some raw images from your link and notised the following. Downloaded "canon_eos_5d_mark_ii_09.cr2" but it was saved as "canon_eos_5d_mark_ii_09.tiff", I renamed it to .cr2 and opened it and the size was 5634x3753 then I renamed it to .tiff opened again and now its 5616x3744. So the 5634x3753 must be the camera raw size. Anyway if I opened it as .cr2 I got the same crash as Before (please try with your app and see if its the same for you), but not if I open it as .tiff so there must be some issue with IE and loading raw with low mem Resources. I'm running XE C++ and IE 5.1 //Christer
|
 |
|
Uwe
  
284 Posts |
Posted - Oct 19 2014 : 20:12:00
|
Christer, what browser do you use? Because when I download an image from that site with Firefox 26.0, it always saves in the proper RAW format and never in a format I didn't select.
Anyway, I downloaded the same file as you now and have no problem whatsoever with it. If I rename the file to canon_eos_5d_mark_ii_09.tiff, it also opens without a crash. Which doesn't surprise me as the CR2 format is actually TIFF based. Renaming it back to canon_eos_5d_mark_ii_09.cr2 has no negative effect. It just opens without any error messages and the size reverts back to 3753 x 5634 pixels. That width and height changed simply by altering the file extension is really strange, by the way, and what I understand even less is that your CR2 file shows the image dimensions for the TIFF file extension.
Would you mind to provide another sample file? It needs to be one directly out of your camera with no changes applied.
Thanks -Uwe
|
 |
|
quantuz
 
Sweden
55 Posts |
Posted - Oct 20 2014 : 14:11:33
|
Hi Uwe, I used MS explorer 11 and I get .tiff when it should have been .cr2 I have NO problem loading them as TIFF. Also tried some Nikon raw from http://www.photographyblog.com/previews/nikon_d600_photos/ (renamed them as .nef) same problem IEMemtest crash after about 6+ images Who can look into the error handeling in IE when load of raw, can you or Nigel do that? Cheers and thanks a lot for your help! //Christer |
 |
|
Uwe
  
284 Posts |
Posted - Oct 20 2014 : 15:01:37
|
Hi Christer,
I still have my doubts that this is a low memory issue. Reason why is that I've tested your CR2 image on various machines ranging from 2 GB to 16 GB RAM, and each time the computers crashed so badly that it required a restart. And it's only this particular image that causes the crash, which is why I've asked if you could provide another unaltered sample image from your camera. By the way: do you use programs like Lightroom, DXO or similar to edit EXIF and other file information within your pictures?
Regarding the error handling, I would suggest to contact Nigel directly.
Good luck -Uwe |
 |
|
xequte
    
39142 Posts |
Posted - Oct 21 2014 : 21:56:15
|
Hi Christer
I've been monitoring this thread and am thankful to Uwe for his help in debugging. Can you clarify whether there are multiple images that cause this problem or just one rogue file?
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
 |
|
quantuz
 
Sweden
55 Posts |
Posted - Oct 22 2014 : 02:08:46
|
Hi Nigel,
As you can see in the IEMemtest code there are new TIEBitmap created for each raw image loaded and NOT release until the app closes, soo the memory is consumed and the crach issue is when used mem by the app is about 1 GB. Tryed the same demo on big TIFF images and there was no crash insted the image with=0 after load and that is ok then I know I need to clen-up mem, the load raw should behave the same. Would be nice if LoadFromFile() returned som error code what have happened. Thanks, //Christer |
 |
|
Uwe
  
284 Posts |
Posted - Oct 22 2014 : 07:46:59
|
Christer,
quote: soo the memory is consumed and the crach issue is when used mem by the app is about 1 GB.
What confuses me a bit is that your application only crashes after loading the fifth or sixth image while mine crashes the very moment I try to open the file. Is the sample image you've provided the last one you load before your application stops working?
-Uwe |
 |
|
quantuz
 
Sweden
55 Posts |
Posted - Oct 22 2014 : 08:19:29
|
Hi Nigel, To clerify, no, its not one specific image file that is the problem; wich cr2 is used (or if same or different for multi load) doesnt matter,always same error. in our main application theres an crash to desktop, as if there is a parameterless throw or assert in the imageEN code. Cheers, //Christer |
 |
|
xequte
    
39142 Posts |
|
Fishous

USA
11 Posts |
Posted - Oct 28 2014 : 09:22:24
|
I've also noticed some very odd behavior with CR2 files from a EOS T3i and the ImageEnView and the ImageEnMView. The 64 bit seems better, but it's still wonky.
The 32 bit hardly seems to load them at all, and the 64 ImageEnView works, but the ImageEnMView pulls in partial thumbnails, sometimes no thumbnail at all for the same files depending on how many there are. bmpFilt.pas kicks a "Not valid 256x256 Icon" exception, but oddly only once per try.
My Machine is a quad core with 8GB of ram, Win7 64 bit. I'll put together some details and start another thread. |
 |
|
Uwe
  
284 Posts |
Posted - Oct 28 2014 : 11:04:31
|
quote: The 32 bit hardly seems to load them at all
Would you mind to provide some sample files that don't load on your computer? I've never had problems opening files from the Canon EOS 600D/T3i or the Canon 5D Mark II with 32bit ImageEn/ dcrawlib.dll unless they were somehow corrupted. I'm really starting to wonder what you guys are doing to your files. Adding metadata in the wrong places? Damaged card reader or hard drive? Using software that messes up the internal file structure (Adobe Lightroom was suspected to do that to CR2 files for example)? A bug in your code? Or is it a bug in ImageEn after all and I was just lucky all these years? Dunno.
-Uwe |
 |
|
Topic  |
|