Copied to clipboard

Flag this post as spam?

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


  • Brian Reimer 30 posts 120 karma points
    Mar 24, 2014 @ 15:14
    Brian Reimer
    0

    Crop (again)

    Almost working - but doing this:

    img src="@CurrentPage.GetCropUrl("billede", "Nyhed")"

    gives me the image i the HTML - but not cropped ??

    This is the HTML - it renders the image - but full size.

    img src="/media/1013/desert.jpg?crop=0.093749999999999958,0.35102739726027382,0.64940068493150693,0.30650684931506877 &cropmode=percentage&width=200&height=200&rnd=635312706924570312"

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Mar 24, 2014 @ 17:58
    Jeroen Breuer
    0

    Hmm Image Processor (which is part of 7.1) should do that for you. Are you using the RC of 7.1? Maybe it's better to report it here: http://issues.umbraco.org/dashboard#newissue=yes

    Jeroen

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 24, 2014 @ 18:35
    Jan Skovgaard
    0

    Hi Brian

    The following to examples are working in 7.1

    If you're using the media picker on your document type where you have defined the cropper on your media item. @if (string.IsNullOrWhiteSpace(CurrentPage.crop.ToString()) == false){

    var image = Umbraco.Media(CurrentPage.crop.ToString());
    var path = image.umbracoFile;
    
    <img src="@image.GetCropUrl("crop", "box")" />
    

    }

    If you're using the cropper on your document type then this should work. @if (string.IsNullOrWhiteSpace(CurrentPage.cropLoad.ToString()) == false){ var image = Umbraco.Media(CurrentPage.cropLoad.ToString()); }

    Hope this helps.

    /Jan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 24, 2014 @ 18:37
    Jan Skovgaard
    0

    Ok, the formatting just messed up.

    I'm posting both examples seperate now.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 24, 2014 @ 18:37
    Jan Skovgaard
    0

    @if (string.IsNullOrWhiteSpace(CurrentPage.crop.ToString()) == false){

    var image = Umbraco.Media(CurrentPage.crop.ToString());
    var path = image.umbracoFile;
    
    <img src="@image.GetCropUrl("crop", "box")" />
    

    }

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 24, 2014 @ 18:37
    Jan Skovgaard
    0

    @if (string.IsNullOrWhiteSpace(CurrentPage.cropLoad.ToString()) == false){ var image = Umbraco.Media(CurrentPage.cropLoad.ToString()); }

  • Brian Reimer 30 posts 120 karma points
    Mar 25, 2014 @ 09:54
    Brian Reimer
    0

    Strange - it's like my local IIS is not picking up on the crop-info.

    Everything looks ok - but the picture is full-size

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 25, 2014 @ 10:09
    Jan Skovgaard
    0

    Hi Brian

    Are you using 7.1 beta or 7.1rc?

    And are you using the image cropper on a document type, which you call directly (Which the code in your first post implies) or are you using a media picker to pick an image where the image cropper is defined?

    Perhaps some screendumps of your setup could help.

    Cheers,
    Jan 

  • Brian Reimer 30 posts 120 karma points
    Mar 25, 2014 @ 14:32
    Brian Reimer
    0

    Yep - 7.1 RC and the cropper directly on the document type.

    I'll try an external host and se if it me or the IIS :)

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 25, 2014 @ 15:18
    Jan Skovgaard
    0

    Hi Brian

     

    Ok, looking forward to hearing about your progress.

     

    Having a glance at the code samples I posted earlier I can see one of them don't really make sense and that's the one for the scenario you describe.

     

    So I'll try posting it agian but this time written so it should work

     

    @if (string.IsNullOrWhiteSpace(CurrentPage.cropLoad.ToString()) == false){

    var image = Umbraco.Media(CurrentPage.cropLoad.ToString());

    <img src="@image.GetCropUrl("billede","nyhed")" />

    }

     

    Hope this helps - Please notice I'm using ToString()...not sure why it's neccesary but it made the difference for working/not working.

     

    /Jan

  • Brian Reimer 30 posts 120 karma points
    Mar 27, 2014 @ 09:14
    Brian Reimer
    0

    Ok - it's my local IIS - hmm??

    Tried on a external host and it worked.

    Back to the local IIS or Umbraco installation?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 27, 2014 @ 09:48
    Jan Skovgaard
    0

    Hi Brian

    Ok...what is your local setup? Are you using IIS or IIS express?

    Not sure what the issue could be, but it's always a good idea to clear the browser cache since there is some pretty hefty cache in Umbraco 7 - Do you have the same issue if you try in other browsers?

    /Jan

  • Brian Reimer 30 posts 120 karma points
    Mar 28, 2014 @ 13:28
    Brian Reimer
    0

    It's IIS on a Windows 7.

    It's the same in different browsers.

    I'll try some changes to the IIS.....

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 28, 2014 @ 13:30
    Jan Skovgaard
    0

    Ok, please share if you figure out what is going on :)

    /Jan

  • Brian Reimer 30 posts 120 karma points
    Mar 28, 2014 @ 13:36
    Brian Reimer
    0

    Thinking it could be the .net package that Umbraco uses for cropping - it's like the parameters attached to the .jpg-file is not getting interpret.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 28, 2014 @ 17:37
    Jan Skovgaard
    0

    Hi Brian

    If you are able to describe step-by-step how this error happens I think you should try reporting an issue at the issue tracker or perhaps if you have bought a support license then try adding a zendesk ticket about this issue.

    I hope this helps.

    /Jan

  • Mark Downie 8 posts 28 karma points
    Jan 28, 2015 @ 13:08
    Mark Downie
    0

    Hi,

    I had this same issue.

    I created the site Localy using Webmatrix and Umbraco 7.--    The Crops worked fine.  I then uploaded the site to my server using IIS and the crops failed.  The crops also failed on my local IIS.

    The solution was to perform windows updates to resolve the .net issue.   This resolved the issue localy and remotly.

    Thanks,

    Mark

Please Sign in or register to post replies

Write your reply to:

Draft