Re: Storing and Retreiving JPG images using ADO and StoredProcedures
- From: Brian Bushay TeamB <BBushay@xxxxxxxxx>
- Date: Sun, 24 Jul 2005 20:58:17 -0500
>I have scoured the newsgroups and read several articles and tried
>several things but all to no avail.
>
>No matter what I do, it seems that an image is stored in the database
>as a BMP and thus causes problems when I try to retrieve and display
>the image.
>
>D7, ADO, SQL Server 2000
>All data is passed to and from the database via Stored Procedures.
>
>As a test, I wrote the following two methods to see what exactly would
>occur. I save the scanned image to an actual JPG file on disk. Then
>I load this image directly into the parameter via a loadfromfile.
>When I retrieve the data, if I read from the save disk file(s) all is
>well. If I read the data from the database and save it to a file
>directly, the file format is a BMP, not a JPG and therefore causes an
>error when I try to load it into the TImage. I have tried to load it
>directly into the TImage and that does not work either, thus the disk
>file test to see exactly what is going on.
>
>When I examine the file created by the SaveImageData method, the file
>has the appropriate JPG file signature ($FF$D8) as the first two bytes
>of the file. When I examine the file created in the
>BrokenLoadImageData method, the file has a BMP file signature (BM).
>Stored procedures are at the end of the message.
>
>We will be saving thousands upon thousands of rows of data and we
>really need to use as little space as possible, thus the need to save
>the images as JPEG. Since the image is actually being saved as BMP we
>are using 20x the storage space. We could save the images directly to
>disk but that is not really a desired option.
>
>Any assistance would be greatly appreciated.
>
>Bill
>
>
>
>// Save the scanned image to a JPG file and th
It sounds to me like you are using a TdbImage component in your
SaveImageData method.
That or the conversion is happening in your storedProcedures.
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx
.
- References:
- Prev by Date: Re: add index to linked table
- Next by Date: Re: Locking of individual records in a table?
- Previous by thread: Storing and Retreiving JPG images using ADO and StoredProcedures
- Next by thread: Re: Storing and Retreiving JPG images using ADO and StoredProcedures
- Index(es):
Relevant Pages
|
|