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
 Shrink Physical Image Size

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
EnvisionIT Posted - Sep 23 2015 : 22:18:47
Have an issue, we use ImageEn to display images / capture images from camera's etc. They are stored in a DB. We have several clients that over time have image db's in the hundreds of GB.

I'd like to write a utility that shrinks the overall size of the image to 800 x 600 and convert the image to a jpg to minimize the physical size of the image.

I've got an TImageEnDBView component on a form. To convert the image to JPG's I've been using the SaveToFile('test.jpg', toJPEG).

Is there an easier way to shrink the image and convert to jpg's?

3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Sep 27 2015 : 20:54:39
Sorry, that method should be Resample, not Resize. I have updated the example.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
EnvisionIT Posted - Sep 25 2015 : 23:18:41
Thanks Nigel,

I am using 6.2.

However, this code will not compile...

uses iexDBBitmaps;

MyBMP := TIEDBBitmap.Create;
try
MyBMP.Read(MEMIMG_IMAGE_BLOB);
MyBMP.Resize( 800, 600, rfLanczos3, True);
MyBMP.JpegQuality := 75;
MyBMP.Write(MEMIMG_IMAGE_BLOB, ioJPEG);
finally
MyBMP.Free;
end;

Hovering over the above Resize and I get the following:

TIEBitmap.Resize(Integer, Integer, Double, Integer, TIEHAlign, TIEVAlign)

and upon compiling:

[dcc32 Error] MainU.pas(74): E2010 Incompatible types: 'Double' and 'TResampleFilter'
xequte Posted - Sep 24 2015 : 05:32:30
Hi

Are you using v6.2.0? It has a new TIEDBBitmap, which makes the process much easier.

MyBMP := TIEDBBitmap.Create();
MyBMP.Read( MyTableImageBlobField );
MyBmp.Resample( 800, 600, rfLanczos3, true);
MyBmp.JpegQuality := 75;
MyBmp.Write( MyTableImageBlobField, ioJPEG );
MyBmp.Free;


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com