views:

33

answers:

2

We have .bmp files (2M per file) which are stored in Sybase as long binary. we need to retrieve them from database and send to client for display via WebService.

Do we have to do some encoding to pack data before we put them onto the internet?

how to choose the encoding? thanks,

A: 

Serving Bitmaps over the web is not a recommended implementation. It would be desirable if you could convert that on-the-fly into a smaller format (GIF/JPG/PNG, depending on the content/color of the image data) and then serve that up to the user.

I currently store some images in the database and just use a simple script that sets the right Content-type header and dumps the binary out as the response.

Fosco
A: 

You can compress it in a data trasmission layer with Deflate or Gzip, you have implementation of it in .NET then you can simple do this, you must only have data in Stream interheited class. BMP files can get good compression rate because is a array of pixels only.

Svisstack