Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

JackT06

macrumors 6502
Original poster
Jul 24, 2009
293
0
I am currently setting up my own photo website. Of course one thing which im going to need is to be able to put photos what i plan on doing is making little thumbnails but how do i do this at the moment i use this code
Code:
<a href="http://i457.photobucket.com/albums/qq292/JackT06/nz431722.jpg" target="_blank">
<img src="http://i457.photobucket.com/albums/qq292/JackT06/nz431722.jpg" width="100" height="131" border="0" alt="Photo of a big bunny rabbit!" />
</a>

But the problem is that when i put that code onto my website the little thumbnail doesnt look right because of the pixels. Can anyone recommend a better way?
 
The code looks right. What do you mean "because of the pixels"? I'm guessing the problem is that resizing a large image via code is causing it to not only load slowly, but look bad too.

What you should do is resize each image in photoshop first. Or you can use Automator and do a bunch of images at once.

There is PHP code that can create thumbnails for you and auto post. But I think it may be too complex at this stage.
 
The code looks right. What do you mean "because of the pixels"? I'm guessing the problem is that resizing a large image via code is causing it to not only load slowly, but look bad too.

What you should do is resize each image in photoshop first. Or you can use Automator and do a bunch of images at once.

There is PHP code that can create thumbnails for you and auto post. But I think it may be too complex at this stage.

Ye its loading slow and also looking bad because all the pixels have been squashed together.

Ye i will try and use Automator to resize a few and see what the output is.

Ye im not to familiar with PHP
 
Remove height and width code if that produces an image that is not the right ratio.

Also, you want to host the images on your own server. Photobucket will remove the images if too many hits / hot link.
 
Remove height and width code if that produces an image that is not the right ratio.

Also, you want to host the images on your own server. Photobucket will remove the images if too many hits / hot link.

Ye i put the images through atomater and then removed the height and width and its fine now thanks :D.

Oh right, thanks for telling me i didnt know that. Gota find somewhere to host my site now :D
 
Just thought I'd throw this in for good measure...

If you find a webhost supporting PHP and GD graphics library, you can automate thumbnail creation by following the advice on this page:

http://www.phptoys.com/e107_plugins/content/content.php?content.46

It includes instructions on GD, the PHP commands to the resize, and most importantly the proper formula to resize and maintain the aspect ratio of the image at the same time. For example, upload one or more images and process each image with a script that automatically creates the thumbnails for you as well as the gallery.

FYI

-jim
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.