Copied to clipboard

Flag this post as spam?

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


  • Christopher Pascual 25 posts 273 karma points
    Nov 25, 2015 @ 15:09
    Christopher Pascual
    0

    Image Cropper - Is there a way to use media instead of file upload?

    I'm using umbraco7 and ucomponents is not an option as it does not support it.

  • Marc Goodson 2146 posts 14350 karma points MVP 8x c-trib
    Nov 25, 2015 @ 21:47
    Marc Goodson
    105

    Hi Christopher

    The way I normally add the Image Cropper functionality to images uploaded to the Media Section, is to update the existing Image Media Type's 'umbracoFile' property to use a Data Type based on the Image Cropper.

    enter image description here

    Now when files are uploaded to the media section I can see their crops

    enter image description here

    And if I have a document type that has picked a media Item say for a property called relatedImage, I can get it's CroppedUrl using GetCropUrl...

    @{
    string croppedImageUrl = String.Empty;
     var relatedImage = Umbraco.TypedMedia(model.Content.GetPropertyValue("relatedImage"));
                                if (relatedImage != null)
                                {
                                    croppedImageUrl = relatedImage.GetCropUrl("CropAlias");
                                }
    }
    
  • Christopher Pascual 25 posts 273 karma points
    Nov 26, 2015 @ 08:49
    Christopher Pascual
    0

    Many thanks. I'm trying to use image cropper as hotspot

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Nov 26, 2015 @ 09:04
    Jeavon Leopold
    0

    Chris, you might by interested to watch uHangOut Episode 30 which is when I introduced the v7 Image Cropper and walked through how to use it

    Jeavon

  • Comment author was deleted

    Nov 26, 2015 @ 02:36

    +1 to Marc's answer!

Please Sign in or register to post replies

Write your reply to:

Draft