ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TIETIFFHandler - “Out Of Memory” error message
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AndNit

Brazil
60 Posts

Posted - Feb 04 2024 :  08:33:45  Show Profile  Reply
message translated by Google Translate

Hello everything is fine?

I need help with a process that seems simple, but in some files it has given me a lot of work. Our system opens Tif documents and our process works very well using TIETIFFHandler, I use TIETIFFHandler to manipulate these files, as it is the way with the best time performance, to open, manipulate and save large tif files (596 MB / 1,381 images), However, in some specific cases, TIETIFFHandler is unable to open the files and displays an “Out Of Memory” error message.

To solve this problem, if I change the file opening to ImageEnMView1.LoadFromFileOnDemand, the process does not present any errors, but editing these files becomes a very slow process, including new pages and saving the entire file again for example. Is there any way to handle these files safely and quickly?

The way I do it today is this:

Tiff : TIETIFFHandler;

//here I pass the path of the tif file to the procedure
LoadTiffFile(CaminhoImgDoc)

//procedure to open the file	
procedure TfrmConsCert.LoadTiffFile(const Filename: string);
var
  I, idx: Integer;
begin
  if IEFilenameInExtensions( Filename, '*.tif;*.tiff' ) = False then
    exit;
  try
     // in some files, here it shows the error "Out of Memory"
     Tiff.ReadFile( FileName );
     ImageEnMView1.LockUpdate();

     ImageEnMView1.Clear;
     for I := 0 to Tiff.GetPagesCount - 1 do begin
       idx := ImageEnMView1.AppendImage();
       ImageEnMView1.ImageID[ idx ] := 99;  
     end;
     ImageEnMView1.SelectedImage := 0;
     ImageEnMView1.UnlockUpdate();
  except
     \\this way, files with an "Out of Memory" error will open normally
     ImageEnMView1.LoadFromFileOnDemand(FileName);
  end;
end;

xequte

38046 Posts

Posted - Feb 04 2024 :  15:31:30  Show Profile  Reply
Hi

Do you have some samples of the very large tiff files that cause "Out of Memory" errors?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

AndNit

Brazil
60 Posts

Posted - Feb 05 2024 :  06:14:52  Show Profile  Reply
message translated by Google Translate

hey,

Yes, I do, and they are not always large files, but most of them are. Where can I send?

It is worth remembering that the error only occurs using TIETIFFHandler.
Go to Top of Page

xequte

38046 Posts

Posted - Feb 07 2024 :  19:49:12  Show Profile  Reply
Hi

I can reproduce the memory issues and will see if there are any improvements we can make there.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

AndNit

Brazil
60 Posts

Posted - Feb 09 2024 :  08:14:27  Show Profile  Reply
Thanks Nigel Do you think we can find a solution to this problem, or a palliative? We are increasingly experiencing this type of problem among our customers.
For now, if you can help me, how do I open a document using loadfromfileondemand, insert 10 more pages into the same document and update the original file without having to save the entire file again? I thank.
Go to Top of Page

xequte

38046 Posts

Posted - Feb 10 2024 :  15:10:17  Show Profile  Reply
Hi

I'll let you know once we complete our investigation.

TImageEnMView cannot insert pages without saving the entire content, you would need to use one of the other TIFF methods to perform the insertion, such as:

http://www.imageen.com/help/InsertTIFFImageFile.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

xequte

38046 Posts

Posted - Feb 19 2024 :  13:29:13  Show Profile  Reply
Hi

We have an update that should help with this. Can you email me for it?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

AndNit

Brazil
60 Posts

Posted - Feb 19 2024 :  16:33:22  Show Profile  Reply
Of course, I will send it tomorrow, as soon as I arrive at the Office.

Anyway, the indication to use InsertTIFFImageFile worked very well, I implemented it on the client today and it seems to be working well.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: