Firemonkey: Loading a JPEG into any type of image control then saving to file or stream makes it smaller. Can this be avoided?


In a mobile app one or more images (only jpeg/jpg) – either taken with built-in camera or selected from photo library – are displayed before uploading to a web service.

But loading an image into a FMX TImage / TImageControl / TImageViewer and saving it to stream (or file) makes it smaller, about 45%.

Any idea why this happens and is there a way to avoid the reduction in size ?

As asked for this is the simple test code, nothing special to it:

procedure TImageTest.btnTestClick(Sender: TObject);
aFile : string;
if not OpenDialog.Execute then
// get jpg file name for loading
aFile := OpenDialog.Filename;
// load into TImage, TImageControl or TImageViewer
// and save to file for comparison

Comments are closed.