Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Dan 1250 posts 3745 karma points admin c-trib
    Feb 05, 2010 @ 11:47

    Use ImageGen to create cropped thumbnails?


    Is it possible to use ImageGen to automatically create image thumbnails - keeping the main image intact?  My ideal scenario would be to have ImageGen automatically create a copy of the uploaded image, scale it down to a maximum of 50px wide or 50px high (depending on whether it's a portrait or landscape format) then crop it to a square of 50x50px.  I then have the original image and the tiny square version available.

    Is this doable?  If so, does it require the pro version?  How (/where) would it save the thumbnails?


  • Douglas Robar 3570 posts 4670 karma points MVP 6x admin c-trib
    Feb 05, 2010 @ 12:20
    Douglas Robar

    This is exactly the kind of situation ImageGen is designed for!

    There are many options to get exactly the output you want so read the docs for more details. The general idea would be:


    That will give you a thumbnail that is 50px in it's longest dimension while retaining the aspect ratio of the original image.

    If you want to further make the image 50x50 you have two options:

    1. You can 'pad' the extra space with &pad=true, using the &bgcolor= to specify the color to use in any padded area around the resized image. This is all part of the free version of ImageGen and you can either pad the thumbnail or use it without padding and let CSS do the work of aligning your thumbnails for you.


    2. Or, you can crop the image to get exactly what you described in your original post. Cropping is powerful Professional feature. You would use a command like:


    Hope this helps!


  • Dan 1250 posts 3745 karma points admin c-trib
    Feb 05, 2010 @ 12:40

    Brilliant, thanks Doug.  I've never used this package before but it looks amazing so I'm looking forward to really getting to grips with it.

  • Kalle Ekstrand 181 posts 259 karma points c-trib
    Aug 15, 2010 @ 13:25
    Kalle Ekstrand

    Hi there,

    I am looking for a similar way to create thumbnails, but i would like a combination of constrain and crop.

    For example:

    I have 5 big images, all in different sizes. I want all of them to be displayed as thumbnails but in the exact same outer measures to keep the layout nice and clean.

    I would like to use the command:


    In this case, it will fill upp a image with 140x100 px with constraines proportions, and then crop the rest of the image in the bottom.

    Or is there already a way to achieve this?

    //Kalle Ekstrand

  • Kalle Ekstrand 181 posts 259 karma points c-trib
    Aug 15, 2010 @ 13:37
    Kalle Ekstrand

    Think I solved it by myself:

  • Biagio Paruolo 1492 posts 1633 karma points c-trib
    Aug 16, 2010 @ 11:00
    Biagio Paruolo

    but you have pro ver.

  • Kalle Ekstrand 181 posts 259 karma points c-trib
    Aug 18, 2010 @ 13:09
    Kalle Ekstrand

    Yes, thats correct! I use PRO version in almost every website I produce.

  • Michael Lawrence 128 posts 200 karma points
    Mar 12, 2011 @ 00:34
    Michael Lawrence

    Hmm, I'm experiencing something weird:




    Both produce the same thing. My source image is 1680x1050 and the output is an image that is 80x50 in both cases. What I expect to happen when I pass "crop=resize" is that the image will be 80x80 with the excess chopped off. However, it's basically just scaling it down. How would I achieve the desired effect?

    I'm currently using 2.5.1 Pro.


  • Craig Cronin 303 posts 502 karma points
    Apr 01, 2013 @ 14:17
    Craig Cronin

    Hi Michael did you have any luck with this?  I'm having the same issue with version 2.5.2?





  • Biagio Paruolo 1492 posts 1633 karma points c-trib
    Apr 18, 2013 @ 10:23
    Biagio Paruolo

    I use this good library

  • Michael Lawrence 128 posts 200 karma points
    Apr 18, 2013 @ 16:01
    Michael Lawrence

    @Craig I don't believe I did have success. I'll have to loop back and double check what I did. Sorry for the late reply. :(

  • Dmitrij Jazel 86 posts 179 karma points
    Oct 26, 2013 @ 18:18
    Dmitrij Jazel

    Hello guys, I have a short question here...

    I am using ImageGen 2.5.7 + on top of that installed 2.5.7_uopdates

    I have a bunch of pictures in my media folder. All different size taken with different photocameras.

    I am trying to make a thumbnail of those images in a Razor macro -

    This thumbnail must fit to all images. And it has to cover all of the placeholder, and is no blank white spaces etc...
    Thumbnail size must be 200x200 px.

    I think it is pretty much straight forward... but for some reason I still can't get it..

    • image must keep original aspect ration (no squeeze or stretch)
    • fill in all the thumbnail placeholder (no white spaces)
    • be of size 200x200px.

    Could someone please help me to get a correct URL to this one?

    cause my current URL(http:// IMGURL...&width=200&height=200&constrain=true&crop=resize) does not seem to work - it leaves some blank space of placeholder, keeps white spacesin top and bottom.



Please Sign in or register to post replies

Write your reply to: