Using DBImage to store JPEG images to database

Using DBImage to store JPEG images to database

Post by Kaushal Shet » Sun, 31 Dec 1899 09:00:00


I'm trying to save a JPEG image in Delphi 3.0 to an Oracle LONG RAW
column.  Currently, I do the following:
1. Acquire an image from a digital camera into a TPicture object (using
EnhTWAIN)
2. Use Delphi's JPEG unit to convert the TPicture to a JPEG
3. Assign the JPEG to the Picture property of a TDBImage control
4. Post to the database

I guess TDBImage.Picture does not support JPEGs, so my image does not
display in the TDBImage control, and nothing is saved to the database.
If I assign the original picture to the TDBImage, it is displayed and
saved to the database, but the file is ~10 times bigger than the JPEG
image would be.  The original image is around 5MB, and the JPEG image is
around 500K.  I will need to store hundreds of such images in the
database, so compression is a MUST.  Can anyone provide any pointers as
to how I might accomplish this?

The process is flexible, but the compressed image MUST be a JPEG.
Thanks for any assistance you can provide.

Kaushal Sheth


 
 
 

Using DBImage to store JPEG images to database

Post by Danie » Sun, 31 Dec 1899 09:00:00



> I'm trying to save a JPEG image in Delphi 3.0 to an Oracle LONG RAW
> column.  Currently, I do the following:
> 1. Acquire an image from a digital camera into a TPicture object (using
> EnhTWAIN)
> 2. Use Delphi's JPEG unit to convert the TPicture to a JPEG
> 3. Assign the JPEG to the Picture property of a TDBImage control
> 4. Post to the database

> I guess TDBImage.Picture does not support JPEGs, so my image does not
> display in the TDBImage control, and nothing is saved to the database.
> If I assign the original picture to the TDBImage, it is displayed and
> saved to the database, but the file is ~10 times bigger than the JPEG
> image would be.  The original image is around 5MB, and the JPEG image is
> around 500K.  I will need to store hundreds of such images in the
> database, so compression is a MUST.  Can anyone provide any pointers as
> to how I might accomplish this?

> The process is flexible, but the compressed image MUST be a JPEG.
> Thanks for any assistance you can provide.

> Kaushal Sheth


Um...I'm fairly new at the database side of Delphi, but I was looking
into picture storage recently.

I am using Delphi 1 so I had to aquire a third party component to use
JPEG images.  It supports the use of streams, so I can use a TBlobStream
component to read from and write to the table (a graphic field in a
paradox table).

I haven't fully tested all of this yet - that will be tomorrow - but if
it doesn't work I will try using a bytes field (which as far as I can
tell is simply raw storage of data).

I got the JPEG component from the Delphi Super Page, in case your
wondering.  It shouldn't matter, though as I am fairly sure that the
Delphi JPEG components (whatever they may be) support streams.

Daniel England.


 
 
 

Using DBImage to store JPEG images to database

Post by Kaimowit » Sun, 31 Dec 1899 09:00:00


If anyone's in Cape Town, South Africa and keen to give me some tutoring in
Delphi (about 2 hours a week) please drop me a note.

- Evan

 
 
 

1. dbImage and JPEG

Hi,
I have created a dBase database with Delphi 5. Using the dBImage-component
I've been trying to save not only BMP-Images but also JPEG-Images
into my database. With some tricks I've been able to display JPEG images,
but I have not been able to save JPEGS into the DB.
How could I make that work?
Thx and greets,

                                    Christian

2. Hot Start-Up

3. DBImage can't display JPEG

4. Getting T-SQL PRINT output

5. D3 - Storing Jpeg images in Interbase

6. SQL Worksheet 1.2.2: 16 or 32 bits ?

7. Storing a JPEG image in a paradox BLOB field

8. DBList Control

9. Storing of JPEG images in to DB

10. How can I view JPEG images using VFP5.0

11. using images in a paradox table : jpeg

12. Inserting tiff and jpeg images into database.

13. How to insert Image File (JPEG or GIF) into the Database