P Kishor <[EMAIL PROTECTED]> wrote:
folks, I have never worked with BLOBs, but am now going to. Feel a
bit nervous.

Here is a question -- what if I have a rather large image and I want
only a certain part of it? Let me give an example -- say, I want to
store an image of the entire US, but when I want to see only Hawaii, I
ask SQLite to fetch the portion of the image with a certain bounding
box, say, the rect of Hawaii.

SQLite of course knows nothing about images. As far as it's concerned, you are storing an array of bytes - it couldn't care less if it contains image data or not. So you cannot directly ask it to retrieve a portion of the image.

Recent versions of SQLite allow retrieving contiguous segments of the BLOB, given an offest and length. If you store your image as an uncompressed bitmap, then each scanline is stored as a contiguous segment. Given a rectangle, you can retrieve each scanline of the portion you are interested in, then compose them in memory into the final image.

Having said that, SQL database is probably a wrong tool for image manipulation.

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to