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
 Program EXE size - Delphi 7
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

HNRSoftware

USA
2 Posts

Posted - Oct 01 2019 :  08:00:00  Show Profile  Reply
I've owned ImageEN for years, maybe decades, (recently installed 8.6) but have only used it sparingly mainly because the exe footprint is so large. My critical use is an image deskew, which are a couple if TImageEnProc calls. It works beautifully. My problem is that using this turns my 550k program into a 3.4Mb program.

I am very old-school, (Delphi 7) and I rely on exe size being an indicator that I am bringing in many units that I do not want, which can make things harder to debug.

ImageEN has a 32bit windows dll, and it "feels" like this job should be done in the dll and should add a very small amount to the footprint. I must be doing something wrong, but I can't figure out what.

Any thoughts?

xequte

38610 Posts

Posted - Oct 02 2019 :  21:26:15  Show Profile  Reply
Hi

EXE size is something I consider a lot. Please see the defines in ie.inc that outline units that can be undefined and how much they will reduce EXE size. Though naturally as ImageEn is a *big* library, adding it to a project will unavoidably make it much larger.

The DLL file is optional for 32bit projects. It only adds native Camera RAW support (and optionally faster JPEG and PNG loading).




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

HNRSoftware

USA
2 Posts

Posted - Oct 03 2019 :  09:18:24  Show Profile  Reply
Hi Nigel - thanks for the pointer. I brute-force commented out about half of the defines -- the ones that I didn't think I would need. The rebuild of 300,000+ lines got me a single error -- undefined ielkAngle which seems to be connected with layers. Sticking the layers define back in solved that and the rebuilt library saved about 1.2Mb in exe size.

After quick success there, I went back and undefined some more things. I hit an error on GetAutoFit due to the deprecatedinversion8 define.

Apparently, the ImgProc.Rotate which I use got deprecated, so I had to redefine the whole group of deprecated defines. I think I need to track down where the Rotate function got renamed to or moved to.

As best as I can tell, I've undefined the things I don't need (for now), but I really have no idea how much of the SDK I have disabled doing this. Net footprint savings were 1.65Mb out of a 3.4Mb exe -- pretty good. I think ImageEN's part of the exe is now about 1.0Mb.

Thank you for pointing me to this. I wish I had asked this question a decade or two ago....

Howard
Go to Top of Page

xequte

38610 Posts

Posted - Oct 03 2019 :  17:09:36  Show Profile  Reply
Hi Howard

We have fixed the define errors. You can email us for an update, or just comment out the deprecated code.

The rotate change is easy to fix. This is the undefined method:

{$ifdef IEIncludeDeprecatedInV4}
// Deprecated in 5.0.0
procedure TImageEnProc.Rotate(Angle: Double; AntiAlias: Boolean; AntialiasMode: TIEAntialiasMode; BackgroundColor: TColor);
begin
  if AntiAlias then
    Rotate(Angle, AntiAliasMode, BackgroundColor)
  else             
    Rotate(Angle, ierNone, BackgroundColor)
end;
{$endif}


So just remove the AntiAlias boolean parameter, and specify ierNone for AntiAliasMode if it was false.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: