Computing.Net > Forums > Web Development > Resizing image with PHP

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Resizing image with PHP

Reply to Message Icon

Name: cernov
Date: July 12, 2006 at 17:53:30 Pacific
OS: Windows
CPU/Ram: AMD
Comment:

I want to do a list of thumbnails with images. But i don't want to resize all images and send to homepage.

Is there a PHP script that resize the image automatically? I don't want to use "" because it will need to load all the image.

thanks!



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: July 13, 2006 at 08:07:37 Pacific
Reply:

Be sure to properly modify your code when posting so it isn't processed. Make sure you view the post int he preview page before submitting.

Here is the code you posted:

[SCRIPT LANGUAGE="Javascript"]
if(GetCookie('computingnet_image') == 'yes') {
document.write('');
}
[/SCRIPT]

Not sure I entirely understand your question. Are you wanting 1) the PHP code to display the images at thumbnail size or are you wanting 2) the PHP code to create the thumbnail images?

If you are wanting #1, that is a bad idea since it would take a long time to load the page.

So, if you are meaning #2 I would have to ask are these images that you are uploading or are they user submitted photos.

If you are uploading the photos there are many free desktop applications that can create the thumbnails for you very easily (MS provides the free ImageResizer for XP).

If the users are uploading the images then a PHP solution would make sense. In that case you would need to use some of the image functions in PHP: http://us2.php.net/gd

And/Or you could find a class someone has written to implement onto your site:

http://www.phpclasses.org/browse/package/1450.html

http://www.programmers-corner.com/sourcecode/254

Michael J


0

Response Number 2
Name: cernov
Date: July 13, 2006 at 15:47:18 Pacific
Reply:

it's the second option :)

The code was:


0

Response Number 3
Name: cernov
Date: July 13, 2006 at 15:48:12 Pacific
Reply:

ahhhhhhhh

The code is:

(img src=image width=xxx height=yyy)



0

Response Number 4
Name: Laler
Date: July 15, 2006 at 15:28:54 Pacific
Reply:

So you want: 2) the PHP code to create the thumbnail images?

Other than classes above, this is what I use often: phpThumb

It'll probably take some time to understand, but once you do you can do almost anything, to any images - from user uploads or from remote sites. You can resize, keep proportion, create thumb with zoom&crop, add dropshadows, etc...


Here's one site using it, when the administrator upload a new image, it'll resize it and create a thumb. The thumb is zoomcropped so it all looks the same without forcing the image heights/widths.

---


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Resizing image with PHP

Upload resized image in PHP www.computing.net/answers/webdevel/upload-resized-image-in-php/1502.html

Animating images in PHP www.computing.net/answers/webdevel/animating-images-in-php/2268.html

Instant Messages with PHP? www.computing.net/answers/webdevel/instant-messages-with-php/1245.html