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
 Saving JPEG - 32bit vs 64bit - Creates different sizes?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

cpstevenc

USA
116 Posts

Posted - May 25 2024 :  14:10:24  Show Profile  Reply
Using Delphi 11.3 and latest ImageEN as of today.

I have an issue, where please don't get hooked up on the why its an issue... it just is...... out of my control on the panic.

I reduce the code down to this, very simple.

Take any JPG input.

Save it back out.

Simple.

The "problem" is the file that is created in 32bit and 64bit don't match.

Example would be

input = 216,709 bytes
32bit output = 205,209 bytes
64bit output = 201,966 bytes

The issue is, everyone expects the file sizes on the output to be the same.
And it is not.

Again, on the high level, this doesn't seem like a big deal.
But we are dealing with a process among thousands of servers, millions ( maybe close to billions? ) of images now.
And for that process, this is an issue....

I know it sounds odd/dumb, but its the problem I am now tasked on figuring out.

procedure DoImage;
begin
 var
 Image := TImageEn.Create(nil);
 Image.io.LoadFromFile('in.jpg');
{$IFDEF WIN64}
 Image.io.SaveToFileJpeg('out-64.jpg');
{$ELSE}
 Image.io.SaveToFileJpeg('out-32.jpg');
{$ENDIF}
 Image.Free;
end;



Using C# to do similar code, 32bit vs 64bit, makes 1:1 files.
Exactly the same.

cpstevenc

USA
116 Posts

Posted - May 25 2024 :  21:22:34  Show Profile  Reply
I found that I am NOT on the latest ImageEN.

Also this could be Embedded ICC profile related?

Using this site @ https://processing.compress-or-die.com/analyze-process

All the images made with 64bit is missing Embedded ICC Profile,
While all images made with 32bit has this defined.

Waiting on email to get the latest download link and will report back.
Go to Top of Page

xequte

38610 Posts

Posted - May 25 2024 :  21:42:21  Show Profile  Reply
Hi

Remember that ImageEn includes three JPEG engines:

- Native (32bit only)
- DLL (32 and 64bit)
- WIC (32 and 64bit)

By default, native is used on 32bit apps and DLL on 64bit apps (if the DLL is found, otherwise WIC).

So, ensure you are using the same engine on both 32bit and 64bit. The best method would be to include the ielib DLL in the same folder as your EXE (32 and 64bit versions):

https://www.imageen.com/help/TIEGlobalSettings.JPEGEngine.html
https://www.imageen.com/help/ImageEn_DLLs.html

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

cpstevenc

USA
116 Posts

Posted - May 25 2024 :  21:55:46  Show Profile  Reply
Hmm ok... This I had zero clue on.

Up until now, everything has been 32bit.

So 64bit and ImageEN is a new thing we are working on.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: