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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TImageEnMView.MIO.LoadFromFileZIP

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
JonMRobertson Posted - Apr 28 2024 : 13:10:33
When TImageEnMView.MIO.LoadFromFileZIP loads a PDF from a .ZIP file, only the first page of the PDF is loaded. If I load the same PDF using LoadFromFilePDF, all pages are loaded in the TImageEnMView.

Is this expected when loading from a ZIP file?

I am using ImageEn 12.5. I have not tested in a newer version but didn’t notice anything mentioned in release notes or the forum.

I emailed a sample project and my email was rejected:

550 5.0.350 One or more of the attachments in your email is of a file type that is NOT allowed by the recipient's organization.

Thanks
6   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - May 14 2024 : 00:25:45
Maybe in a later update

Nigel
Xequte Software
www.imageen.com
JonMRobertson Posted - Apr 30 2024 : 08:43:35
 
Probably the easiest way at present is to extract the zip to a stream or temporary file and pass that to TImageEnMView.MIO.LoadFromStream/FilePDF().


That is what I'm doing.

 
I'm not sure that will do what you are looking for.


I was offering a suggested enhancement. That's all.
xequte Posted - Apr 29 2024 : 23:47:46
Hi Jon

I'm not sure that will do what you are looking for. You'd need to fill the TImageEnMView with ZipPath+PageIndex for each page in the PDF file (and know how many pages it contained). There is just not a good way to do that at present.

When you pass a PDF file to LoadFromFilePDF(), the PDF is the container and TImageEnMView shows each of its objects (which are the pages). With LoadFromFileZip, the Zip is the container, and its objects are the files it contains. It makes no effort to check whether those files themselves contain objects/pages. That would only be useful in the situation where a zip file contains precisely one file, which should then be unwrapped.

Probably the easiest way at present is to extract the zip to a stream or temporary file and pass that to TImageEnMView.MIO.LoadFromStream/FilePDF().


Nigel
Xequte Software
www.imageen.com
JonMRobertson Posted - Apr 29 2024 : 08:15:40
 
Although I am not familiar with 7z.dll. I took a quick glance but did not see how difficult it would be to extract a single file using an index or item name.

Now I feel silly. I just noticed TImageEnMIO.ExtractZIP_SevenZip, which has parameters for using an index.

Jon
JonMRobertson Posted - Apr 29 2024 : 08:07:18
 
Possibly we might look at loading all pages of an image (e.g. when the zip file contains only one file), but they will be in a later version.

Thanks. I can manually extract using Delphi's TZipFile. I only tried LoadFromFileZIP because it was available.

Another option would be to overload LoadFromFileZIP:
function TImageEnMIO.LoadFromFileZIP(const FileName: string; const Index: Integer; const Password: string = ''): Boolean; overload;
function TImageEnMIO.LoadFromFileZIP(const FileName: string; const ImageName: string; const Password: string = ''): Boolean; overload;

Although I am not familiar with 7z.dll. I took a quick glance but did not see how difficult it would be to extract a single file using an index or item name. It is trivial using TZipFile.
 
Unfortunately our mail system blocks some types, like EXE files.

A lot of email servers will block EXE files. My attachment was a .zip that contained project source (all text) and one zip that contained a PDF. The zip was the only binary file in the zipped attachment.

Thanks Nigel.
xequte Posted - Apr 28 2024 : 20:03:27
Hi Jon

This is expected. When loading the contents of a zip file, only the first frame/page of each image is shown. Possibly we might look at loading all pages of an image (e.g. when the zip file contains only one file), but that will be in a later version.

Unfortunately our mail system blocks some types, like EXE files.

Nigel
Xequte Software
www.imageen.com