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
 Support for big bmp to jpg
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

levent

Turkey
3 Posts

Posted - Dec 13 2018 :  07:43:00  Show Profile  Reply
Hi, I'm a newbie here. Does imageen support to convert big bmp to jpg (for example 20000x20000 24bit)?If so How can I manage to do it in Delphi?
Thanks in advance.

yogiyang

India
552 Posts

Posted - Dec 14 2018 :  01:45:03  Show Profile  Reply
Hello,

Yes!

Just load the file in ImageEn and save it the format you want.

For example:

  //Load file in ImageEn
  ImageEnView1.IO.LoadFromFileBMP('MyBMPFile');


  //Save File
  ImageEnView1.IO.Params.JPEG_Quality = 90;
  ImageEnView1.IO.SaveToFileJpeg('MyJPGFile');


HTH


Yogi Yang
Go to Top of Page

xequte

4854 Posts

Posted - Dec 14 2018 :  03:13:51  Show Profile  Reply
You can also do it without a visual component using:

aBmp := TIEBitmap.create;
aBmp.ParamsEnabled := True; // Load params with the image
aBmp.Read( 'C:\MyImage.bmp' );
aBmp.Params.JPEG_Quality := 70;
aBmp.Write( 'C:\OutImage.jpeg' );
aBmp.Free;

(the large size does not matter, as TIEBitmap does not have the memory constraints of TBitmap).

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

levent

Turkey
3 Posts

Posted - Dec 14 2018 :  05:26:18  Show Profile  Reply
Hi again,
thanks for answers but unfortunately, both solutions you offer gave outofresources errors. My example bmp file is 20480x20480 24bit and the file size is approx. 1.2 gb.

Any clue?
P.S. I' ve used trial vers.
Go to Top of Page

xequte

4854 Posts

Posted - Dec 15 2018 :  05:12:06  Show Profile  Reply
Hi

Try changing the value of Location to ieFile:

https://www.imageen.com/help/ImageEn/TIEBitmap.Location.html

(Although it should be managed automatically).

If that fails, please upload the file somewhere so we can test it. Also, what version of Delphi are you using?



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

levent

Turkey
3 Posts

Posted - Dec 17 2018 :  02:09:29  Show Profile  Reply
Hi again. I attached an example file. There is no problem with the load of bitmap file but when I call write procedure Eoutofresources exception immediately raise..


I believe you can also get same error with the example code below

aBmp := TIEBitmap.create;
aBmp.Location:=ieFile;
aBmp.ParamsEnabled := True;
// A0 600 dpi 19866 x 28087
abmp.Width:=19866;
abmp.Height:=28087;
aBmp.Params.JPEG_Quality := 90;
aBmp.Write( 'C:\OutImage.jpeg' );

And My example file is here:
Download Attachment: 2018121714952_try20480.zip

Thanks in advance

Edit: My delphi vers. 10.2
Edit2: typo fixes...
Go to Top of Page

xequte

4854 Posts

Posted - Dec 17 2018 :  09:24:39  Show Profile  Reply
We have tested this:
aBmp := TIEBitmap.create;
aBmp.Location:=ieFile;
aBmp.ParamsEnabled := True;  
// A0 600 dpi 19866 x 28087
abmp.Width:=19866;
abmp.Height:=28087;
aBmp.Params.JPEG_Quality := 90;
aBmp.Write( 'C:\OutImage.jpeg' );
aBmp.free();


It worked well on our systems and saves an 8MB (black) jpeg file.

Is there enough free space on disk?


Example conversion code:
aBmp := TIEBitmap.create;
aBmp.ParamsEnabled := True;
aBmp.Read('c:\try20480.bmp');
aBmp.Params.JPEG_Quality := 90;
aBmp.Write( 'C:\OutImage.jpeg' );
aBmp.free;


Which also worked fine with big files.


FYI, to force ImageEn to use ieFile, even when the image can be contained in memory:
aBmp := TIEBitmap.create;
IEGlobalSettings().DefMinFileSize := -1;    // <<<<< add this
aBmp.MinFileSize := 0;                      // <<<<< add this
aBmp.Location:=ieFile;
...etc...



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