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
 Calculate JPEG save size
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jwcarney

USA
2 Posts

Posted - Jun 25 2022 :  12:35:03  Show Profile  Reply
I noticed in the demo apps, the TSaveImageEnDialog has an advanced option, which when selected shows a screen
with the picture and it's original file size, when you select compression quality and press preview, it shows the compressed size. How do I get that value directly in code so I can check file size before saving. If the size is too large I'll reset the quality and process again (I'll use the assign options to reuse the original file loaded, applying compression to a second tiebitmap that will be the one saved). Seems simple but I can't find the property in the docs. I Currently have the trial version running in Delphi 10.43 and Delphi 11.1 (need both for clients).



Joseph W Carney

xequte

38608 Posts

Posted - Jun 27 2022 :  17:50:28  Show Profile  Reply
Hi Joseph

Here is an example:

// Show a preview and compressed size for a JPEG
ienSource.IO.Params.JPEG_QUALITY := JPEGQuality;
ienSource.IO.Params.JPEG_COLORSPACE := JPEGPhotometric;
ienSource.IO.Params.JPEG_DCTMETHOD := JPEGDCTMethod;
ienSource.IO.Params.JPEG_OPTIMALHUFFMAN := JPEGOptimalHuffman;
ienSource.IO.Params.JPEG_SMOOTH := JPEGSmooth;
ienSource.IO.Params.JPEG_PROGRESSIVE := JPEGProgressive;
ienSource.IO.SaveToStreamJpeg(mf);
mf.position := 0;
ienPreview.IO.LoadFromStreamJpeg(mf);
lblSaveSize.caption := IEBytesToStr2( mf.size );


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

jwcarney

USA
2 Posts

Posted - Jun 28 2022 :  07:26:22  Show Profile  Reply
Thank you.
Also, just purchased license. anyway to get my registration before Wed?
Joseph W Carney
Go to Top of Page

xequte

38608 Posts

Posted - Jun 30 2022 :  00:25:21  Show Profile  Reply
Hi Joseph

If you are still waiting for your registration, please check your spam folder, and email us if you have not received it.

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