I have followed another tutorial for an upload form so the user can input a product name, product description and a product image (which I have done already) but this one also saves a thumbnail image of the uploaded image as well as the full image. The only problem I had with this tutorial is when I had uploaded an image, I looked at the thumbnail I had created and it was square so the top and the bottom of the image was missing. I knew there was somewhere within the php code that I could change to make the size of the thumbnail that was being created. The bit of code that I needed to change was:
$thumb_width = 150;
$thumb_height = 150;

This was the original size so I just changed the width to 120 and kept the height the same so the thumbnail wasn't too big to be a thumbnail so in the php code I now have:
$thumb_width = 120;
$thumb_height = 150;

This was something really simple and easy to do but I did not know this before so I have now learnt how to do this.
No comments:
Post a Comment