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?
New to PHP - Photo Gallery
Moderator: General Moderators
- akuji36
- Forum Contributor
- Posts: 190
- Joined: Tue Oct 14, 2008 9:53 am
- Location: Hartford, Connecticut
Re: New to PHP - Photo Gallery
try this link:
http://www.bitrepository.com/resize-an- ... nd-gd.html
This link refers to php GD Library class.
http://www.bitrepository.com/resize-an- ... nd-gd.html
This link refers to php GD Library class.
Re: New to PHP - Photo Gallery
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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.