ASP Returning a DIB Image (I think) from SQL , Netscape doesn't display it 
Author Message
 ASP Returning a DIB Image (I think) from SQL , Netscape doesn't display it

I've been working on an ASP to return an image from a SQL 6.5 table.

Everything works in IE.  This ASP is called and it gets the image and the
browser displays it.  However netscape wouldn't display it.

I could save it with netscape then doubleclick on the file and one of my
photo programs would view it.

When I added the picture to the SQL table it was a JPG type.  But when I
look at the HEX codes in the picture that I get back, its totally different.

The SQL table that I am pulling it from is a PeopleSoft table.  The field
type is IMG and Format is DIB.    So I am thinking that when a picture is
added to this table the type is changed to a DIB.  Which I don't know much
about.

I've read that DIB is device-independent bitmap.

So I am guessing that Netscape doesn't recongnize this type of image.

So is there a way in my VBScript ASP file to convert this image back to a
standard JPEG or BMP?

My ASP code is currently:


   <%

   dim ImageID
   ImageID = request.querystring("ID")

   ' Clear out the existing HTTP header information
   Response.Expires = 0
   Response.Buffer = TRUE
   Response.Clear

   ' Change the HTTP header to reflect that an image is being passed.
   Response.ContentType = "image/jpeg"

   Set cn = Server.CreateObject("ADODB.Connection")
   cn.Open "DSN=HSYS3;UID=sa;PWD=sapwd"
   Set rs = cn.Execute("SELECT EMPLOYEE_PHOTO FROM PS_EMPL_PHOTO WHERE
EMPLID='" & ImageID & "'")

 size = rs.Fields("EMPLOYEE_PHOTO").ActualSize
 blob = rs.Fields("EMPLOYEE_PHOTO").GetChunk(size)
 Response.binarywrite blob
   Response.End
   %>

Thanks

-Colin



Sun, 08 Dec 2002 03:00:00 GMT  
 ASP Returning a DIB Image (I think) from SQL , Netscape doesn't display it
Netscape might like it with the correct content-type, try changing it from
image/jpeg to

image/bitmap
image/bmp
image/dib

or any others you can find. look around in the IIS configs theres huge list
of all the support ones.

--
Dominic



Sun, 08 Dec 2002 03:00:00 GMT  
 ASP Returning a DIB Image (I think) from SQL , Netscape doesn't display it
Tried them all and it doesn't work.

If I look in Netscape options for the Bitmap file type, it says there:

BMP DIB
image/bmp

But the option to let Netscape handle it is disabled.  So this is telling me
that it won't display any Bitmaps.

So I tried that.  I did a page with an embeded bitmat and it won't display
it?!?!?


Quote:
> Netscape might like it with the correct content-type, try changing it from
> image/jpeg to

> image/bitmap
> image/bmp
> image/dib

> or any others you can find. look around in the IIS configs theres huge
list
> of all the support ones.

> --
> Dominic



Sun, 08 Dec 2002 03:00:00 GMT  
 ASP Returning a DIB Image (I think) from SQL , Netscape doesn't display it
So:

1. You can't return anything but bitmaps.
2. Netscape refuses to display the bitmaps.

Maybe you could use an intermediate component to convert the binary in the
database into another image format?

--
Dominic



Sun, 08 Dec 2002 03:00:00 GMT  
 ASP Returning a DIB Image (I think) from SQL , Netscape doesn't display it
If your image stored in blob is of BMP (DIB) type, you can convert your
bitmap to jpeg on the fly without temporary file using ShotGraph component:
http://shotgraph.aspcafe.com

Best regards,
Mikhail.


Quote:
> I've been working on an ASP to return an image from a SQL 6.5 table.

> Everything works in IE.  This ASP is called and it gets the image and the
> browser displays it.  However netscape wouldn't display it.

> I could save it with netscape then doubleclick on the file and one of my
> photo programs would view it.

> When I added the picture to the SQL table it was a JPG type.  But when I
> look at the HEX codes in the picture that I get back, its totally
different.

> The SQL table that I am pulling it from is a PeopleSoft table.  The field
> type is IMG and Format is DIB.    So I am thinking that when a picture is
> added to this table the type is changed to a DIB.  Which I don't know much
> about.

> I've read that DIB is device-independent bitmap.

> So I am guessing that Netscape doesn't recongnize this type of image.

> So is there a way in my VBSCRIPT ASP file to convert this image back to a
> standard JPEG or BMP?

> My ASP code is currently:


>    <%

>    dim ImageID
>    ImageID = request.querystring("ID")

>    ' Clear out the existing HTTP header information
>    Response.Expires = 0
>    Response.Buffer = TRUE
>    Response.Clear

>    ' Change the HTTP header to reflect that an image is being passed.
>    Response.ContentType = "image/jpeg"

>    Set cn = Server.CreateObject("ADODB.Connection")
>    cn.Open "DSN=HSYS3;UID=sa;PWD=sapwd"
>    Set rs = cn.Execute("SELECT EMPLOYEE_PHOTO FROM PS_EMPL_PHOTO WHERE
> EMPLID='" & ImageID & "'")

>  size = rs.Fields("EMPLOYEE_PHOTO").ActualSize
>  blob = rs.Fields("EMPLOYEE_PHOTO").GetChunk(size)
>  Response.binarywrite blob
>    Response.End
>    %>

> Thanks

> -Colin



Mon, 09 Dec 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. ASP Returning a DIB Image (I think) from SQL , Netscape doesn't display it

2. parameter doesn't return value to ASP or VB

3. OLE object linked to an image doesn't display anything

4. Dll returns a Handle to a DIB how can I display in picture box

5. You'd think this works, but it doesn't

6. Displaying DIB's

7. Displaying DIB's

8. Data Missing on Returning To ASP page using Netscape:

9. Data Missing on Returning To ASP page using Netscape

10. regsvr32 doesn't think much of me

11. SmartViewerHTMLFrame.asp sorta works, SmartViewerActiveXPage.asp doesn't

12. ShellExecute with html document doesn't work reliably with Netscape

 

 
Powered by phpBB® Forum Software