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. |
|
|