Getting a JPEG or PNG from a SQLite Blob onto the screen

View: New views
3 Messages — Rating Filter:   Alert me  

Getting a JPEG or PNG from a SQLite Blob onto the screen

by neveryone :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I know that I can save JPEG or PNG data as a blob in my SQLite
database, but i don't know how to get it back and display it as an
image. If I put in an <image src='?image'> or something similar, it
will treat the data in that field as the url, not the image data. Can
someone put me on the right track here?
_______________________________________________
dev-tech-xul mailing list
dev-tech-xul@...
https://lists.mozilla.org/listinfo/dev-tech-xul

Re: Getting a JPEG or PNG from a SQLite Blob onto the screen

by Igor Tandetnik :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

neveryone@... wrote:
> I know that I can save JPEG or PNG data as a blob in my SQLite
> database, but i don't know how to get it back and display it as an
> image.

We did it this way:

http://groups.google.com/group/mozilla.dev.embedding/browse_frm/thread/29b6a6ad59ba669c/f9490ff248aef1f3

You can register a protocol supporting URLs like, for example,
sqliteimage://dbname/tablename/columnname/rowid. Then use this URL in
your <image> tag.

Igor Tandetnik


_______________________________________________
dev-tech-xul mailing list
dev-tech-xul@...
https://lists.mozilla.org/listinfo/dev-tech-xul

Re: Getting a JPEG or PNG from a SQLite Blob onto the screen

by Tei-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Aug 21, 2008 at 12:30 AM,  <neveryone@...> wrote:
> I know that I can save JPEG or PNG data as a blob in my SQLite
> database, but i don't know how to get it back and display it as an
> image. If I put in an <image src='?image'> or something similar, it
> will treat the data in that field as the url, not the image data. Can
> someone put me on the right track here?

If everything else fails. You can always create a data url.
"data:image/gif," + allthebinarydatahere
_______________________________________________
dev-tech-xul mailing list
dev-tech-xul@...
https://lists.mozilla.org/listinfo/dev-tech-xul
LightInTheBox - Buy quality products at wholesale price!