Hi, all
which function and how i need use it for convert image from jpeg2000 to jpeg. ???
Thanks
Just load the file and save it in another format:
uses
ImagingClasses;
var
Img: TSingleImage;
begin
Img := TSingleImage.Create;
Img.LoadFromFile('myjpeg2k.jp2');
Img.SaveToFile('myjpeg.jpg');
....
Thank you
I need convert jpeg2000 for a blob field. After converted the image, it need save to file. And I do it like this
// if field need to convert
if qr.FieldByName('ext').AsString = 'jp2'
then
begin
Img := TSingleImage.Create;
mem_st := TMemoryStream.Create;
// convert
try
TBlobField(qr.FieldByName('img')).SaveToStream(mem_st);
mem_st.Position := 0;
Img.LoadFromStream(mem_st);
str_file_path := qr.FieldByName('img_name').AsString + '.jpg';
Img.SaveToFile(str_file_path);
finally
mem_st.Free;
Img.Free;
end;
end
In result - image is a black square.
Help me please.
Quote from: Galfar on 31 August 2009, 21:49:38
Just load the file and save it in another format:
uses
ImagingClasses;
var
Img: TSingleImage;
begin
Img := TSingleImage.Create;
Img.LoadFromFile('myjpeg2k.jp2');
Img.SaveToFile('myjpeg.jpg');
....
I am also tried convert image by this method. And in result also get the black square in jpeg-file.
My be this is because I disable unit
ImagingExtras in
Imaging unit. I do it because Delphi 7 can not find ImagingExtras.dcu file. ??? And i realy can not find a ImagingExtras files in 0.26.2 package, that was uploaded from hear (http://prdownloads.sourceforge.net/imaginglib/imaginglib0262.zip?download) !!
Sorry.
I find ImagingExtras.pas and all work correctly.
Thanks