Copied to clipboard

Flag this post as spam?

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


  • Craig Agnew 22 posts 138 karma points
    Sep 15, 2014 @ 16:37
    Craig Agnew
    0

    Image Cropper results in 1px height

    Hi there,

    I'm experiencing a strange issue in Umbraco 7.1 using the Image Cropper data type.

    I've set my cropper up and use it the way it is shown in the following guide.

    http://our.umbraco.org/documentation/Using-Umbraco/Backoffice-Overview/Property-Editors/Built-in-Property-Editors-v7/Image-Cropper

    This works fine provided I don't make any attempt to use the control to actually crop or set the focus point. When I do this and then publish all I get it an image of the right width, but only 1px in height.

    Has anyone come across this issue before or has any suggestions? I'm using Umbraco 7.1.6, which came bundled with ImageProcessor 1.9.5.

    Thanks,

    Craig

     

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Sep 15, 2014 @ 16:41
    Jeavon Leopold
    0

    Hi Craig,

    could you please post your code and also the resulting URL (including the querystring) of the output image?

    Thanks,

    Jeavon

  • Craig Agnew 22 posts 138 karma points
    Sep 15, 2014 @ 16:44
    Craig Agnew
    0

    Hi Jeavon,

    My code looks like this

    var crop = CurrentPage.GetCropUrl("headerImage", "Header Image");
    
    mastheadImage = " style=\"background-image: url(" + crop + ");\"";
    

    Which I then use in the markup like so:

    <header class="@mastheadClass"@Html.Raw(mastheadImage)>
    

    Which ends up procuding the following image URL:

    <header class="masthead" style="background-image: url(/media/1156/optimized-img_9202-1.jpg?crop=0,0.29666666666666669,0,0.41817708333333331&amp;cropmode=percentage&amp;width=1920&amp;height=365&amp;rnd=130552688930000000);">
    
  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Sep 15, 2014 @ 16:53
  • Craig Agnew 22 posts 138 karma points
    Sep 15, 2014 @ 16:56
    Craig Agnew
    0

    If I browse to the image itself it gives my an image with dimensions 1920x1. It just looks like a 1px black line.

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Sep 15, 2014 @ 16:58
    Jeavon Leopold
    0

    Is that without the querystring?

  • Craig Agnew 22 posts 138 karma points
    Sep 15, 2014 @ 17:01
    Craig Agnew
    0

    Sorry, that is with the querystring. If I take the querystring off I get the original image, which in this case is 1920x1280.

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Sep 15, 2014 @ 17:31
  • Craig Agnew 22 posts 138 karma points
    Sep 15, 2014 @ 17:36
    Craig Agnew
    0

    Hi Jeavon,

    No luck with that either. You can see how it looks here... (values have changed as I've been trying to get it to work)

    http://thorntoun-cms.proof.microtechsupport.com/media/1156/optimized-img_9202-1.jpg?crop=0,0.299375,0,0.41546875&cropmode=percentage&width=1920&height=365&rnd=130552725180000000&upscale=true

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Sep 15, 2014 @ 18:02
    Jeavon Leopold
    0

    Hmm, and you have a predefined crop (alias "Header Image") of 1920x365?

  • Craig Agnew 22 posts 138 karma points
    Sep 15, 2014 @ 18:06
    Craig Agnew
    0

    Yes I've got a data type for this which has two crops available, one for use as a "hero" image where applicable and another for the basic header image.

    Screenshot

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Sep 15, 2014 @ 18:32
    Jeavon Leopold
    0

    Very strange, I have recreated your setup with your image and it works perfectly!

    Could you try stopping your application pool and deleting the /App_Data/Cache folder and then restart the application pool?

    I'll also see if James (creator of Image Processor) has any idea on this

  • Craig Agnew 22 posts 138 karma points
    Sep 15, 2014 @ 18:38
    Craig Agnew
    0

    I've done this locally first of all. After stopping the app pool, deleting the cache folder and then re-trying the crop and publish, I'm now getting an exception if I try and view the image.

    enter image description here

    The query string for this looked like this: ?crop=0.028098407791517083,0.27991935081771041,0.22399572862651251,0.50681061777024328&cropmode=percentage&width=1920&height=365&rnd=130552761170000000

  • James Jackson-South 489 posts 1747 karma points c-trib
    Sep 15, 2014 @ 18:41
    James Jackson-South
    101

    Have you?.... Have you got ImageResizer installed? sheds a single tear

    It's that that is breaking. ImageProcessor is a different bag baby!

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Sep 15, 2014 @ 18:44
    Jeavon Leopold
    0

    Ah ha, GetCropUrl is not compatible with ImageResizer only ImageProcessor

  • Craig Agnew 22 posts 138 karma points
    Sep 16, 2014 @ 10:02
    Craig Agnew
    0

    I do, indeed! Now I've had this look under the hood and know about ImageProcessor this makes sense.

    I'll remove ImageResizer this morning and test and let you guys know how it goes.

  • Craig Agnew 22 posts 138 karma points
    Sep 16, 2014 @ 10:23
    Craig Agnew
    2

    Thanks a lot for your help guys - ImageResizer was the problem. We'd used that before in Umbraco projects and have recently made the jump to Umbraco 7. ImageProcessor looks like a great library.

  • James Jackson-South 489 posts 1747 karma points c-trib
    Sep 16, 2014 @ 12:16
    James Jackson-South
    0

    Good man, and thanks! :)

    There's fairly comprehensive docs on imageprocessor itself here.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies