How to work with images

thread: 3 messages  |  last: a year ago  |  started: tuesday, march 23, 2010, 11:19 am pdt


#1  |  Spikesiegel Spain
Tuesday, March 23, 2010, 11:19 AM PDT

Hi,

I'm working with a DataBase wich manage information about people. One table has one blob field to storage the picture of any user in the system.
Anybody can help me and tell me how I can work with this image files and how I update them in the table and display it in my Qforms.

Thank you, any information will be usefull for me

#2  |  VexedPanda (Calgary, AB) Canada
Tuesday, March 23, 2010, 12:29 PM PDT

It depends on your database adapter. You would use the same functions as you would use without QCodo involved to deal with the column content, such as those described here:
http://www.phpriot.com/articles/images-in-mysql

#3  |  Mike Ho (Sunnyvale, CA) United States of America Qcodo Administrator
Wednesday, March 24, 2010, 8:58 PM PDT

Are you for-sure wanting to store images as blob data in the database?  Or would storing it in the filesystem be an option?

There are pros and cons to both, but I've always tended to believe that the benefits of storing in the filesystem outweigh the benefits of storing in the database.

For a good example of doing this, I'd recommend looking at the code for qcodo.com, itself.

Images (and uploaded file assets in general) are stored in a very clean, consistent way, with ties back to the database.

You can take a look on the repository on github -- specifically at the code dealing with uploaded images in the wiki (the WikiImage object) as well as uploaded images for the Showcase (the ShowcaseItem object).



Copyright © 2005 - 2012, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.