Jump to content

How to create a thumbnail image in PHP?


malisa

Recommended Posts

Many times your site needs images to be uploaded, may be for display with submitted content, then you have to make sure that the images displayed should be of a suitable size. If a user uploads a particularly large image, it may destroy the layout of the page when it is displayed.

       

Thumbnail images guarantee you that the images displayed will never exceed certain height and width values.

           

Creating a basic thumbnail is a five-stage process:

 

1. Load the source image into a PHP variable.

2. Determine the height and width of the original image.

3. Create a blank thumbnail image of the correct size.

4. Copy the original image to the blank thumbnail.

5. Display the thumbnail using the correct content type.

 

For more details you can go through http://phptechhelp.com/index.php?option=com_content&task=view&id=15&Itemid=32

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.