How do you use this with PHP?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Bonzo
Posts: 2970
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Post by Bonzo » 2006-06-17T14:51:36-07:00

ImageMagick can help in a couple of ways - resize images; add watermarks, frames and shadows.

Note there is a good chance anything to do with text may not work - loads of people have problems with this.

It will not work anyway if you are in "Safe mode".

As to uploading the photos and displaying the photos I would say ImageMagick is not really of any help. It can create a page showing all the images in a gallery but there is no way of linking without making an imagemap or similar as they are all actualy in one big image.

I have some examples that may give you some ideas here: http://www.rubblewebs.co.uk/imagemagick/

P.S. You do not need to use Mysql depending on what you want to do with your gallery. The one I am working on at the moment - no ImageMagick envolved either - does not use a database: http://www.rubble.info/gallery/gallery.php

Bonzo
Posts: 2970
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Post by Bonzo » 2006-06-18T04:30:24-07:00

All my code examples run using php; you would need to modify the variables to what you want to use.

The best bet is just to copy one of my examples and give it a go as it is; then try modifying it once you get it to work. Depending if you are uploading the photos or letting others upload you may need more validation to stop hackers etc.

The photos folder the code uses is on the server as that is where the photos need to be if you are building a website ( you will need to CHMOD the folder to 777 ).
When using the upload for that pics out the photo from your hard drive then puts it on the server when resizing it.

Yes php can get folder names as well. You probably want to look at somewhere like http://www.sitepoint.com/forums/ where there are loads of questions and answers on things like this.

ridera

Post by ridera » 2006-06-19T09:21:32-07:00

Don't waste your time reinventing a gallery program, there are dozens of free ones available.

Here is a very popular one http://sourceforge.net/projects/gallery

Post Reply