Playing with images has become quite a core functional requirement of so many applications and not just Image/Photo apps. Resizing an image becomes one of the fundamental things in handling and displaying images, be it in Blog Themes, Custom Photo Galleries or just website designs and layout.

Here is a very simple way to do it:

Step One: Download this script and put it in your root "/" server directory.

Step Two: Create a folder named "Cache" and set its permissions as "777"

So the script "timthumb.php" will be located at: https://www.yourdomain.com/timthumb.php

And the Cache folder will be created in the root "/" with "777" permission.

Step Three: Now you're ready to use it! Say for example, you want to resize an image located at: "yourdomain.com/images/Sample.jpg". The Width you want to resize it to is "100" (The script will take care of the aspect ratio so don't need to provide relevant height)

You just need to do the following with your <img> tag in html file:

<img src="/timthumb.php?src=/images/Sample.jpg?w=100&zc=1" alt="" />

This is it! Incase you need more help for your custom needs, feel free to leave a comment here and I will reach back.

Here is a sample:

Original image : <img src=https://www.programmerfish.com/wp-content/uploads/2009/12/02.jpg alt="" />
02

Resized to width = 150 : <img src="/timthumb.php?src=/wp-content/uploads/2009/12/02.jpg&w=150" alt="" />
02