[GLLUG] PHP/images/MySQL

Brad Fears brad@mtsdev.com
04 Feb 2003 14:28:19 -0500


In the past, I've used ImageMagick to perform the functions you are
describing, so that everything is automated through the form, and all
manipulation of images is done during initial upload / form processing.

Basically, you have your form, with all the user input you need
contained in that form.  You'd also have a space for file upload fields
(for your original images), however many you decide that you need.  When
php processes the form, it can verify the type of file uploaded was an
image (important step), then manipulate the image (resize, copy, etc.)
as many times as you need to create your thumbnail / original image
sets, then add / modify an entry in the database accordingly.  You could
just name your files by upload time, split them up by directory or name
(scaled_640_480_1044386407.jpg), and either store them in the database
itself or just store their location in the database.

Difficult, and tedious, but not impossible.  I even have a working
example that I'll sell you for a six-pack. ;)

--Brad Fears



On Tue, 2003-02-04 at 13:21, Mike Szumlinski wrote:
> Okay...here is what I'm trying to do and I can't figure out a good 
> method.  Maybe someone else out there has a good idea on how to do this:
> 
> I have a user input through a form a bunch of random info (check boxes, 
> text fields, etc), but I also need up to 4 images to correspond to the 
> ID for that row.  Its for an inventory system.
> 
> The images also need to be thumbnailed and shrunk before they hit the 
> folder/database (haven't figured out what is better yet). So basically 
> each unique ID within the database has up to 8 images associated with 
> it (4 thumbs, 4 640x480 images).
> 
> I can't quite think of how to pull it off.  I've done single image 
> stores by just renaming the image the ID.jpg, but that won't work here. 
>   I've thought about putting them into the table in the database, but I 
> can't figure out how to use GD to shrink them down first if I do that.  
> I'm sorta clueless on how to pull this off for now.  Any ideas?
> 
> -Mike
> 
> 
> _______________________________________________
> linux-user mailing list
> linux-user@egr.msu.edu
> http://www.egr.msu.edu/mailman/listinfo/linux-user