// Teknoloji

Image Optimization for Your Website with TimThumb

Bir web sitemiz var, yüksek kalitede birçok görselimiz mevcut ve bu görselleri manuel olarak tek tek optimize etmekle uğraşmak istemiyoruz. İşte bu aşamada Tim Thumb ile web sitenize resim optimizasyonu yapabilirsiniz. Kullanımı kolay, faydası çok. Şimdi gelelim sitemize entegre etmeye.

  1. Step: First, we download the timthumb.php file from HERE and upload it to our site. (e.g. http://www.WEB_SITENIZ.com/timthumb.php )

Step 2: You may skip this step; the script should create this folder by itself. If it can’t, create a folder named cache on your site and give it full read and write permissions (for Linux: 777)

 

It’s that simple; now we can call images in whatever optimized form we want.

Before doing this, to call an image we used the <img src=”images/resim.jpg”> code; now <img src=”timthumb.php?src=images/resim.jpg“/> we will use.

<img src=”timthumb.php?src=http://www.WEBSITESI.com/image/manzara.png&w=200&h=300&q=50“/>

In the example above, we sent 4 parameters to our timthumb script.

Src -> with this parameter we send the path of our image.

w -> with this parameter we send the width value of our image

h -> with this parameter we set the height of our image.

q -> this parameter determines our image quality, that is, our optimization rate.

 

What can we do with this script?

We can resize image dimensions.
We can modify image quality.
We can crop images.
We can specify the crop position while cropping images.
We can zoom in on images.
We can apply effects to images.
We can sharpen images.
We can color the background outside the main object in the image.
In my opinion, its most amazing feature is that it performs caching, which provides a huge speed-up when the page is reloaded.

// FEEDBACK

Was this useful?

Your rating shows how helpful this note is to other readers.

Was this useful?

Click the stars to rate.

Average rating 0 / 5. Total votes: 0

No one has rated this post yet. Be the first!

Sorry this post was not helpful.

Your feedback is valuable to us.

How can we make this post more helpful?

// JOIN THE CONVERSATION

Share your experience

Got a question, a different solution or a note to add?

// KEEP READING

One more note.

All posts ↗︎