Page 1 of 1

New to PHP - Photo Gallery

Posted: Thu Jun 25, 2009 3:32 pm
by jamkelvl
Hey

Here is my explanation of what I want to do, this is as simple as it gets. Actually, it can be even more simple..

- Search a directory of images

- Resize images to 600px wide (Can PHP actually resize the file or does it just shrink it for the browser?)

- Display the images

There is a lot more to this that I want to do but i'm leaving all of that out.

My main concern is I'm sick of manually resizing images and manually creating thumbs and I want to know if PHP can do this for me?

My first step would be to just iterate thru the a directory checking or even getting the image sizes for starters...

I have some code already but the getimagesize function isn't working for me I get this error: Warning: getimagesize(/newsite/impact/HPIM1816 thumb.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /mnt/w0002/d13/s02/b02d93c5/www/newsite/news.php on line 72

Any help?

Re: New to PHP - Photo Gallery

Posted: Tue Jun 30, 2009 9:45 am
by akuji36
try this link:

http://www.bitrepository.com/resize-an- ... nd-gd.html

This link refers to php GD Library class.

Re: New to PHP - Photo Gallery

Posted: Tue Jun 30, 2009 10:11 am
by pickle
The reason getimagesize() isn't working for you is hinted in the error. You're asking for "/newsite/impact/HPIM1816 thumb.jpg", but I think you forgot to add the document root to that. Try running getimagesize() on "/mnt/w0002/d13/s02/b02d93c5/www/newsite/impact/HPIM1816 thumb.jpg" and it should work.