Copied to clipboard

Flag this post as spam?

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


  • Dan 1236 posts 3678 karma points admin c-trib
    Feb 05, 2010 @ 11:47
    Dan
    1

    Use ImageGen to create cropped thumbnails?

    Hi,

    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?

    Thanks

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

    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:

    /umbraco/imagegen.ashx?image=bigImage.jpg&width=50&height=50&constrain=true

    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.

    /umbraco/imagegen.ashx?image=bigImage.jpg&width=50&height=50&constrain=true&pad=true&bgcolor=white

    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:

    /umbraco/imagegen.ashx?image=bigImage.jpg&width=50&height=50&constrain=true&crop=resize

    Hope this helps!

    cheers,
    doug.

  • Dan 1236 posts 3678 karma points admin c-trib
    Feb 05, 2010 @ 12:40
    Dan
    0

    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
    0

    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:

    /umbraco/imagegen.ashx?image=bigImage.jpg&width=140&height=100&constrain=true&crop=bottom

    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
    0

    Think I solved it by myself:

    umbraco/ImageGen.ashx?image=bigimage.jpg&width=140&height=100&crop=resize&valign=top 
  • Biagio Paruolo 1435 posts 1552 karma points
    Aug 16, 2010 @ 11:00
    Biagio Paruolo
    0

    but you have pro ver.

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

    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
    0

    Hmm, I'm experiencing something weird:

    /imagegen.ashx?image=image.jpg&width=80&height=80&valign=top&constrain=true

    and 

    /imagegen.ashx?image=image.jpg&width=80&height=80&valign=top&constrain=true&crop=resize

    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.

    Thanks.

  • Craig Cronin 296 posts 495 karma points
    Apr 01, 2013 @ 14:17
    Craig Cronin
    0

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

     

    Thanks

     

    Craig

  • Biagio Paruolo 1435 posts 1552 karma points
    Apr 18, 2013 @ 10:23
    Biagio Paruolo
    0

    I use this good library http://imageresizing.net/

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

    @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
    0

    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.

     

    //Dmitrij

Please Sign in or register to post replies

Write your reply to:

Draft