Author |
Topic |
|
AndNit
Brazil
81 Posts |
Posted - Feb 04 2024 : 08:33:45
|
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
38608 Posts |
Posted - Feb 04 2024 : 15:31:30
|
Hi
Do you have some samples of the very large tiff files that cause "Out of Memory" errors?
Nigel Xequte Software www.imageen.com
|
|
|
AndNit
Brazil
81 Posts |
Posted - Feb 05 2024 : 06:14:52
|
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. |
|
|
xequte
38608 Posts |
Posted - Feb 07 2024 : 19:49:12
|
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
|
|
|
AndNit
Brazil
81 Posts |
Posted - Feb 09 2024 : 08:14:27
|
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. |
|
|
xequte
38608 Posts |
|
xequte
38608 Posts |
Posted - Feb 19 2024 : 13:29:13
|
Hi
We have an update that should help with this. Can you email me for it?
Nigel Xequte Software www.imageen.com
|
|
|
AndNit
Brazil
81 Posts |
Posted - Feb 19 2024 : 16:33:22
|
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. |
|
|
AndNit
Brazil
81 Posts |
Posted - Mar 04 2024 : 09:14:54
|
email sent
Thanks |
|
|
|
Topic |
|
|
|