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
 Images are appending

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
donaldadams1951 Posted - Feb 23 2012 : 08:55:04
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;
1   L A T E S T    R E P L I E S    (Newest First)
fab Posted - Feb 23 2012 : 10:33:58
You could call...

ImageEnMView.Clear();

...before LoadFromFile.