Store JPEGs in RB Database structure 
Author Message
 Store JPEGs in RB Database structure

I am using a digital camera. Now, with more than 4000 photo's, I like to
store the JPEGs in a database.

So, is it possible to place a JPEG (or a Picture) in the RB database (as a
BLOB field). In O'Reilly's RB Book it is mentioned as undocumented but
further no information to use it.

Or, I read the JPEG in as a String (with BinaryStream) but how do i convert
it then to a Picture?

Any suggestions, please?



Sat, 15 Mar 2003 03:00:00 GMT  
 Store JPEGs in RB Database structure
Hi Peter,

About this:

Quote:
> So, is it possible to place a JPEG (or a Picture) in the RB database (as a
> BLOB field). In O'Reilly's RB Book it is mentioned as undocumented but
> further no information to use it.

> Or, I read the JPEG in as a String (with BinaryStream) but how do i convert
> it then to a Picture?

I was not able to get that to work directly.  I think I remember reading
somewhere that this feature is not implemented yet.  

I was able to store/retrieve Pictures to/from a REALbasic database, but
I had to do the work myself.  I found two methods of doing this that
both work fine:

For Storing:

1. Create a temp file and write the picture to the temp file.  Then open
the temp file, read it in, and store it into the database.  NOTE: The
max size of a REALbasic database record is about 8K bytes, so you have
to break it into pieces and store the pieces into separate records.

... or ...

2. Store the Picture into a MemoryBlock, and then write the memory block
into the database.  Same considerations apply with regards to record
size.  NOTE: I had to write my own routine for converting the Picture to
a Memory block.

Both of these methods work on both Mac and Windows platforms.

For Retrieving.... just do the reverse of 1. or 2. above.

Also note... I found that the REALbasic database got REAL slow when you
had lots of things stored in it.




Sat, 15 Mar 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. RB 3.1 and JPEGs in Windows

2. RB: row order by RB database

3. Looping over a directory and reading Jpegs into a database -- Realbasic 4.5

4. How do you use jpegs in a realbasic database on the PC

5. how to STORE multi-headed tree-like structures

6. How to store a value for later use in a structure

7. storing and retrieving program data structures

8. Persistent Store w/ Stringified Data Structure

9. defining setf method for storing in structure slot

10. Memory structure of a picture object in RB

11. Need information about the StORE database scheme

12. Pictures and storing them in a database

 

 
Powered by phpBB® Forum Software