Hi,
At the moment I am working on new website. A part of the site will have a photo gallery. Photo's can be stored in a database or folder on the web server to present on a webpage. I want to improve the photo upload process by using a script to automatically compress the photo's to a predefined resolution.
Can you please give me some directions how to find the right script for the job?
Moderator
From: Deland, FL
Registered: 2005-10-25
Posts: 1271
I've been thanked 20 times.
Offline
Guess it all depends on what you can and cannot do with your host.
ImageMagick is probably the way to go, if you can.
http://www.imagemagick.org/script/index.php
Very powerful tool. There's a learning curve of course, and the more knowledge you have of command-line (bash) and (most-likely PHP for the CMS) you should be able to integrate the two.
I've never used a CMS so I don't know if any have any kind of add-ons that'll do this. But, so long as you can install ImageMagick and work with it for a while, I'm sure you can use it for what you need.
Moderator
From: Deland, FL
Registered: 2005-10-25
Posts: 1271
I've been thanked 20 times.
Offline
Hm...I dont remember seeing this last time I checked out ImageMagick...but, here ya go:
http://www.magickwand.org/
There's the PHP module for ImageMagick. That's what you'll probably be using, should you be able to install (or have your host install) ImageMagick.
Like I said, very powerful...worth looking in to.
Member
From: Bega, Sapphire Coast Australia
Registered: 2005-08-18
Posts: 1485
I've been thanked 39 times.
Offline
G'day herbertc. Welcome to the forum, Mate! 
It's a very simple matter to batch process all your photos in one go before you upload them. I use IrfanView.
Regards,
Laurie.
Australian Exploration and Adventure on Horseback and Motorbike

Moderator
From: Yorkshire, UK
Registered: 2006-08-19
Posts: 2669
I've been thanked 63 times.
Offline
If you know any php then use the php function
http://uk.php.net/manual/en/function.im … ampled.php
you can get it to create any number of other images from the source image as well (eg thumbnails)
Although some people try to store images in a database, it's best not to - upload them, save with a unique name (eg some md5 hash based on original file name, timestamp and random number) and store this information in your database with the server-side filepath
Internet Marketing Books
Promote Yourself on Site Reference!
Member
From: South Africa, Port Elizabeth
Registered: 2006-08-23
Posts: 1803
I've been thanked 33 times.
Offline
Im with Northie on that one, you will end up slowing your database down incredibly. Its best to just generate a random file name for each picture as they are uploaded - send the renamed image to an uploads folder in your root and store the filename (10390234kjhdkfn.jpg) in the database. Also the php scripts to generate thumbnails are incredibly easy to use once you can play with php on a basic level (like me)
My up and coming... soon to be real website... www.thewebguy.co.za (one day i will finish it
)| Never |


