Subject | Re: Converting a JPEG to a blob... |
---|---|
Author | Adam |
Post date | 2006-09-21T23:43:36Z |
--- In firebird-support@yahoogroups.com, "killerion" <killerion@...>
wrote:
update statement with a BLOB field, Firebird will assume it to be
text. There is a limit of 32KB though for this automatic conversion.
When you ask about manipulating it as a string, well of course if you
were to encode it with base64 or something you could store that as a
long piece of text, but my guess is that your JPEGs will be larger
than this.
Most if not all languages have a way of inserting and retrieving BLOB
data regardless of size or type, but as you have not said which
language and connection components you are using, no specific advise
could be given.
If you are not using a particular language, and just wanted a tool to
do the conversion and inserting for you, you could use FSQL.
http://www.volny.cz/iprenosil/interbase/fsql.htm
Note that BLOBs are stored AS IS with no compression. For JPEGs that
probably is not an issue, but other file types could benefit from
client side compression before storage and decompression post storage.
Adam
wrote:
>What Martijn means is that there if you try to use an insert or an
> > Firebird only supports direct blob inserts into text blobs, not
> binary data.
>
>
> so no even manipulating the image as a giant string would work? and
> possibly as a varchar?
update statement with a BLOB field, Firebird will assume it to be
text. There is a limit of 32KB though for this automatic conversion.
When you ask about manipulating it as a string, well of course if you
were to encode it with base64 or something you could store that as a
long piece of text, but my guess is that your JPEGs will be larger
than this.
Most if not all languages have a way of inserting and retrieving BLOB
data regardless of size or type, but as you have not said which
language and connection components you are using, no specific advise
could be given.
If you are not using a particular language, and just wanted a tool to
do the conversion and inserting for you, you could use FSQL.
http://www.volny.cz/iprenosil/interbase/fsql.htm
Note that BLOBs are stored AS IS with no compression. For JPEGs that
probably is not an issue, but other file types could benefit from
client side compression before storage and decompression post storage.
Adam