Re: Storing and Retreiving JPG images using ADO and StoredProcedures




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



Relevant Pages

  • Re: modfy the desktopbackground
    ... Windows can not display a jpeg directly on screen, ... Why don't you just convert the jpg file to bmp and set ... Windows has to load and present it anyway. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: modfy the desktopbackground
    ... Why don't you just convert the jpg file to bmp and set ... Windows has to load and present it anyway. ... Private Const SPI_SETDESKWALLPAPER As Integer = 20 ...
    (microsoft.public.dotnet.languages.vb)
  • Re: modfy the desktopbackground
    ... Why don't you just convert the jpg file to bmp and set ... Windows has to load and present it anyway. ... Private Const SPI_SETDESKWALLPAPER As Integer = 20 ...
    (microsoft.public.dotnet.languages.vb)
  • THE ANSWER
    ... instructions about deleting the temp files in explorer ... the only format I can save it in is BMP. ... I cannot save any picture file in anything ... >I can save a JPG as a JPG file. ...
    (microsoft.public.windowsxp.photos)
  • RE: ActiveSync : Unable to copy file
    ... Try running a scan disk just ... They are all .bmp. ... there is enough disk space on the mobile, that the file is not write only ...
    (microsoft.public.windowsce.app.development)