37 thoughts on “Complete TimThumb Parameters Guide Leave a comment

    1. Have you took into account that transparency cannot be set for JPEG images, transparency is possible only in GIF and PNG images.

      1. Yes – that’s accounted for. I am well aware of the limitations of different image file formats πŸ™‚

  1. Why not in Parameters max min ?

    if jpg pixels 300x300px = timthumb = 100×200
    if jpg pixels 300x100px = timthumb = 100×100

    but make w&h paramer -> jpg pixel 300×100 = timthumb = 100×200 (zoom)

      1. Any plans to allow percentages instead of Pixels?

        I’ve migrated to the LessIsMore framework which adjusts page width for the device/resolution viewed on…

        Timthumb is kinda redundant unless it can do something similar with percentages…

        Modern designers no longer design for a fixed width on screen then different pages for different media…and most webpages aren’t viewed on a screen at all nowadays…

      2. Hi – using percentage widths won’t help with what you want to do. I’m a web designer – so I am well aware of responsive designs (try resizing your browser) however making TimThumb accept percentages won’t change anything. You should read up on responsive images – I would recommend the max-width css property. No images in responsive design change actual dimensions – they are scaled in the browser.

      3. Hi Ben,
        Any plan for max-width and max-height parameter?
        I was thinking that it could be helpful when I load pictures using ajax request. so it will render resized image based on browser size instead of full image. Well, I can pass value as width param, but I can never sure that all images will be larger than given width.


  2. Great script! Love it!
    But could you please add a parameter to stop upscaling small images and keep the original size of an image if it’s smaller than the size given at w or h?!

  3. Is there a way to remove the black spaces on top and at the bottom of the image like youtube thumbnail for example ?
    In general, can I cut parts of the image with TimThumb ?

  4. I see that TT crops images when supplied with both a width and height. Is there a way to make it proportionally fit the image to a container?

    IOW: if I have an image 500 x 500 and I have a space 250 x 500, the image should be resized to 250 x 250. Is this possible?

      1. I described the nature of the problem poorly, but it looks like the zc=3 will do what I’m after. Thanks!

  5. Does timthumb show image alt tags?

    The script is used on a number of websites I own and it does not appear to show image alts.

    1. TimThumb resizes images – it has nothing to do with the html used on the website. You will need to edit your template to make the alt tags display.

  6. Hi.

    When I work with external files (in the same server, but a different URL), the load of that images go very slowly.
    How can I fix?


    1. You should only use images on the same domain. It doesn’t matter what the server is – if the images are on a different domain then they will be copied over to the domain that hosts timthumb – and this is slow.

  7. Can you set a max height and max width so the picture will always fit between the dimensions, but will keep it’s proportions?

    Great work for the rest, I love your script!

  8. In my project your timthumb.php is working well.
    But I want to give the cache file name that is save in cache folder to my image src.
    Then is there any way to do it? Please suggest me!!!!!

  9. Hi
    Please, i have read the whole thing and comment and still ct equal to 0 or 1 or true does not work for gif images. It shows some black background where it was supposed to be transparent. Please, what to do ?

    1. I would guess the colour profile is being removed from the image.

      Keep in mind that I no longer use or recommend TimThumb.

  10. Ben, is’t it possible to replace your final script AND remote_addr checking to reject running of the sections of your script that has to do with edits? Since the developer would test his/her page on the page from a particular IP, he/she would be the only one creating those images and yet everyone else can read it.

    Practically speaking, this would prevent one from deleting the TT generated cache, but that’s a limitation I am willing to live by and find a diffferent solution for.

    2nd and last question, do we really install iMagicK to use your CT transparency param?

Leave a Reply

Your email address will not be published. Required fields are marked *