Board index » delphi » Converte BMP to JPEG and store JPEG in a MYSQL DB

Converte BMP to JPEG and store JPEG in a MYSQL DB

I have a PARADOX table with a field of type GRAPHIC, where are a bitmap
stored.
I have a table a MySQL table with a field of type LONGBLOB, where I want to
store a JPEG image.
I need to convert the PARADOX graphic to JPEG and store the JPEG image into
the LONGBLOB field in the MySQL DB.

Could anyone help me?

Thanks

Genilton Barbosa
GBSoft Consultoria e Sistemas
gbs...@buynet.com.br
www.gbimoveis.com - The best place to rent or buy your home

 

Re:Converte BMP to JPEG and store JPEG in a MYSQL DB


here's a quick and dirty routine to transfer from pics stored as bmp in blob
field to another table as a jpg.

Jim Margarit

uses jpeg;

var
    jpg : TJPEGImage;

begin
    jpg := TJPEGImage.Create;
    jpg.CompressionQuality := 50;
    while not tblSrc.eof do
    begin
        jpg.Assign(dbImage1.Picture.Bitmap); {dbimage1 is attached to
picture blobfield of source table}
        jpg.compress;
        jpg.savetofile('c:\temp.jpg'); {I wanted to see intermediate files
for debugging}
        tblDestBlobField.LoadFromFile('c:\temp.jpg');  {persistent blob
TField}
        tblSrc.next;
    end;
end;

Quote
"Genilton Barbosa" <genil...@hotmail.com> wrote in message

news:3ad34600$1_2@dnews...
Quote
> I have a PARADOX table with a field of type GRAPHIC, where are a bitmap
> stored.
> I have a table a MySQL table with a field of type LONGBLOB, where I want
to
> store a JPEG image.
> I need to convert the PARADOX graphic to JPEG and store the JPEG image
into
> the LONGBLOB field in the MySQL DB.

> Could anyone help me?

> Thanks

> Genilton Barbosa
> GBSoft Consultoria e Sistemas
> gbs...@buynet.com.br
> www.gbimoveis.com - The best place to rent or buy your home

Re:Converte BMP to JPEG and store JPEG in a MYSQL DB


ImageLib Combo
www.imagelib.com

Quote
"Genilton Barbosa" <genil...@hotmail.com> wrote in message

news:3ad34600$1_2@dnews...
Quote
> I have a PARADOX table with a field of type GRAPHIC, where are a bitmap
> stored.
> I have a table a MySQL table with a field of type LONGBLOB, where I want
to
> store a JPEG image.
> I need to convert the PARADOX graphic to JPEG and store the JPEG image
into
> the LONGBLOB field in the MySQL DB.

> Could anyone help me?

> Thanks

> Genilton Barbosa
> GBSoft Consultoria e Sistemas
> gbs...@buynet.com.br
> www.gbimoveis.com - The best place to rent or buy your home

Other Threads