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
 Images are appending
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

donaldadams1951

USA
4 Posts

Posted - Feb 23 2012 :  08:55:04  Show Profile  Reply
Delphi 7 Enterprise
MS SQL Server 2000

I am converting images in a database from TIFF to TiffJpeg to shrink them. I have written a procedure that extracts the images from the database one at a time and converts them to TIFFJpeg then write them back to the database.

If I do multiple images in a batch they append instead of being processed as a single image. For example if I tell it to do 5 images the first image contains 1 page of images in the file. The second contains the first image and the second, the third contains #1, #2 and #3, etc.

Here is the code that I use to convcert. Is there something I need to do to clear the previous image so I am only dealing with one image at a time, clearing the previous image so they do not append?


procedure TResizeImagesForm.ConvertImageToTIFFJpeg;
begin
if DebugModeCheckBox.Checked = True then
begin
StatusBar.SimpleText := 'ConvertImageToTIFFJpeg - Begin' ;
ResizeImagesForm.Refresh ;
Application.ProcessMessages;
end ;

ImageEnMView.MIO.LoadFromFile(TempResizeImageNameArchive);

ImageEnMView.MIO.Params[0].TIFF_JPEGQuality := ResizeImageQuality ;
ImageEnMView.MIO.Params[0].TIFF_Compression := ioTIFF_JPEG ;
ImageEnMView.MIO.Params[0].BitsPerSample:=8;
ImageEnMView.MIO.Params[0].SamplesPerPixel:=3;
ImageEnMView.MIO.DuplicateCompressionInfo();

ImageEnMView.MIO.SaveToFileTIFF(TempResizeImageNameConverted) ;

if DebugModeCheckBox.Checked = True then
begin
StatusBar.SimpleText := 'ConvertImageToTIFFJpeg - End' ;
ResizeImagesForm.Refresh ;
Application.ProcessMessages;
end ;

end;

fab

1310 Posts

Posted - Feb 23 2012 :  10:33:58  Show Profile  Reply
You could call...

ImageEnMView.Clear();

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