Copied to clipboard

Flag this post as spam?

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


  • Robert Foster 459 posts 1820 karma points MVP 3x admin c-trib
    Feb 04, 2014 @ 08:11
    Robert Foster
    0

    Invalid preview Crops with ImageResizer backend

    I've installed ImageResizer (using NuGet) as the backend to this on Umbraco 7.0.3 and attempted to crop an image that's originally 1344px wide by 756 px high.

    I zoomed in on the face in the image and applied a crop of 250x250 and the preview retrieved a url like so:

    http://localhost:52673/media/1003/nick_trigg_02_web.png?crop=801,45,541,541&width=250&quality=100

    the problem is that ImageResizer specifies the crop as follows:

    crop=(x1,y1,x2,y2)

    where all values are coordinates (the last two should not be the cropped image width or height).  This differs from ImageProcessor and ImageGen which uses the Rectangle paradigm (x, y, width, height) in which case the above url would work.

    Because the preview image url above has x1 < x2, ImageCropper is ignoring the crop directive but applying everything else.

    The correct url should be:

    http://localhost:52673/media/1003/nick_trigg_02_web.png?crop=801,45,1342,596&width=250&quality=100

    I'm about to go check the actual saved crop to see if it's any different (through the API on an MVC form).

    - Rob.

     

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Feb 04, 2014 @ 09:18
    Jeavon Leopold
    0

    Hi Rob,

    Yes you are right, you need to update the formats in the data type settings for ImageResizer as shown here you will then need to move any existing crops to update the save JSON to the new format.

    Jeavon

  • Robert Foster 459 posts 1820 karma points MVP 3x admin c-trib
    Feb 04, 2014 @ 10:57
    Robert Foster
    0

    Yup, discovered that after actually reading the documentation :)

    ... Thought I'd deleted this thread...

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Feb 04, 2014 @ 11:10
    Jeavon Leopold
    0

    Ah great!

Please Sign in or register to post replies

Write your reply to:

Draft