Copied to clipboard

Flag this post as spam?

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


  • egeek 40 posts 177 karma points
    Jun 15, 2015 @ 13:54
    egeek
    0

    Image Cropper can not pick from Media

    When using Image Cropper on a content node, it is only possible to upload a image from local machine and not choose a image from the Media Section.

    Using Media Picker data type instead, I can both upload a local image and choose a image from the Media Section.

    Am I missing something, or what is the reason for this?

  • Shannon Deminick 1481 posts 4979 karma points hq
    Jun 15, 2015 @ 15:55
    Shannon Deminick
    0

    When we chatted at CG, the solution was to change your Media "Image" media type to use an Image Cropper instead of an Upload property editor....

  • egeek 40 posts 177 karma points
    Jun 15, 2015 @ 16:22
    egeek
    0

    I remember, and I did that, which makes the Image Cropper available from the Media Section, but it doesn't solve our issue.

    Eg. I create a article doc type with a Image Cropper property. From the content tree I create a new article, click "Upload" in the Image Cropper, and I can only choose files from local disk, not from the Media Section. When you use a Media Picker, you get a pane on the right with your Media Section and the option to upload from local disk.

    By using the Image Cropper, the result is I can not reuse pictures on multiple content nodes, but have to upload and store them each and every time.

    See screenshots. Thanks :)

    enter image description here

    enter image description here

    enter image description here

  • Carl Jackson 139 posts 477 karma points
    Jun 15, 2015 @ 16:27
    Carl Jackson
    1

    You need to just use the "Media Picker" in your content items. not the cropper.

    You add the crop sizes to the main image cropper that you changed in the media section.

    Then in your view you can get the image in any of the crop sizes.

    The only disadvantage / quirk to this is that you have to then set the crop sizes against the image in the media section and can't do it in the content area. I don't see that as a massive issue though as media is easily managed and the default crop willl get used most of the time.

    Thanks

    Carl

  • Carl Jackson 139 posts 477 karma points
    Jun 15, 2015 @ 16:31
    Carl Jackson
    1

    I think I originally found the explanation from another post which mentioned this video

    https://www.youtube.com/watch?v=bQsvGmnYaUU

    Its pretty long but think you can skip a bit to find the important part.

  • egeek 40 posts 177 karma points
    Jun 15, 2015 @ 17:20
    egeek
    2

    What I wanted was to use the Image Cropper directly on a content node, but with the possibility to to have the right pane like with the Media Picker, where I can choose already uploaded images from the Media Section.

    It seems like it's not possible though. A workaround as I understand it, is to set media type; image to Image Cropper, and on the content node you'll have to use the Media Picker instead. The disadvantage is you can not crop from your content node, and have to go to the media section, which changes the workflow our editors are used to.

    The solution can be achieved by:

    1. Go to Developer > Data Types > Media Picker. Be sure the property editor is set to "Legacy Media Picker", otherwise you'll not be able to choose media.
    2. Go to Settings > Media Types > Image > Generic properties and set "umbracoFile" to use "Image Cropper" instead of "Media Picker"
    3. Go Developer > Document Types > Choose the doc type you want to pick a image from. Inset a Media Picker and call the property name "image".

    You'll now have a Media Picker on your content node and can both upload a image or choose a already existing image from the Media Section. To adjust the crops, you'll have to go to the Media Section and find the corresponding image to achieve that.

    In your Razor view you render the image this way:

    <img src="@Umbraco.TypedMedia(node.GetPropertyValue("image")).GetCropUrl("umbracoFile", "main")" alt=""/>
    

    Where as before - IF you used the Image Cropper directly on your content node, you would render the image this way:

    <img src="@node.GetCropUrl(propertyAlias: "image", cropAlias: "main")" alt=""/>
    

    Note that if you in the first place used the Image Cropper directly on your content nodes, created a lot of content with images picked via the Image Cropper, and later change the property on your document type to use Media Picker instead, you will have to republish your content nodes, which makes your nodes no longer reference to the old images. If you don't republish, trying to render your image with Umbraco.TypedMedia (example above) will result in a null pointer exception.

    This literally means you'll have to go through all your content nodes and choose the images again from the Media Section.

    Soution works, but I don't understand why I should not be able to use the Image Cropper directly on a content node, and have the possibility to choose a already uploaded image? @shannon

  • Halima Koundi 8 posts 79 karma points
    Feb 03, 2016 @ 14:10
    Halima Koundi
    0

    Hi ,

    thanks for explaining in details your finding of how to use the image cropper with the option to get images from the media library as well as the local drive.

    It works now as we need it.

    Thanks a lot.

  • Shannon Deminick 1481 posts 4979 karma points hq
    Jun 16, 2015 @ 08:15
    Shannon Deminick
    1

    Right, so you want a media picker where you can pick or upload (AND then edit/crop) in the dialog, correct?

    This is not possible currently afaik, you can log a feature request for this or would have to create a custom property editor to achieve this.

  • egeek 40 posts 177 karma points
    Jun 16, 2015 @ 10:12
    egeek
    0

    Exactly Shannon :)

    That was what I thought, but couldn't see the reason behind. Might have to do one myself.

  • Per Ploug 865 posts 3461 karma points MVP admin
    Jun 16, 2015 @ 08:32
    Per Ploug
    3

    The reason the cropper is built the way it is - eg. not supporting pointing it at other images in the media library is that each image should really only exist once, and then be cropped / resized as needed.

    So, you upload a single image to the cropper, configure sizes and center. Then this single image is used everywhere - making it a responsive image.

    The cropper is not meant to be a cropped version of some other file, it is meant to be one file + cropping data.

    So one image, multiple crops / uses.

    It doesnt solve what you want to do, but that is how it was thought out to work :)

  • egeek 40 posts 177 karma points
    Jun 16, 2015 @ 10:37
    egeek
    0

    Hi Per,

    Thanks for explaining. I get your way of thinking and the ideas behind, but let's imagine the cropper did reference to a image in the Media Section. Uploading a image from the content node, through the cropper, should then save the image in the Media Section, with associated crops in media library on disk. The cropped images should only live one place, as should the original image, and be accessible through the cropper on my content node, making it possible to change them (center point / sizes) both on my content node and in the Media Section.

    I literally want to achieve what you describe, but having the possibility to upload / adjust my image and crops from a content node - only having the images to live one place (Media Section) though.

    Makes sense? :)

  • Steve Bridges 51 posts 72 karma points
    Jul 19, 2015 @ 21:53
    Steve Bridges
    0

    Totally for this change - the lack of ability to set the focal point from the content node is really disruptive to the way editors are used to working.

    It's forced me to avoid using image cropper in favor of imagegen in many cases.

    It would be great if an editor could have a choice of picking from existing media OR uploading new media...and then set the focal point...all in one place. Forcing them to switch to the media section simply to add the focal point is awkward.

  • Shannon Deminick 1481 posts 4979 karma points hq
    Jul 20, 2015 @ 07:33
    Shannon Deminick
    0

    Still haven't seen anyone log a feature request on the tracker for this though ;)

  • egeek 40 posts 177 karma points
    Jul 20, 2015 @ 07:58
    egeek
    0

    That's because I created it as a bug in the first place. :)

    Edited: http://issues.umbraco.org/issue/U4-6223

  • Shannon Deminick 1481 posts 4979 karma points hq
    Jul 20, 2015 @ 08:01
    Shannon Deminick
    0

    That's the same link as this topic ;)

    Found the right link though: http://issues.umbraco.org/issue/U4-6223

  • egeek 40 posts 177 karma points
    Jul 20, 2015 @ 08:08
    egeek
    0

    Doh, I'm asleep ;)

  • M N 120 posts 204 karma points
    Aug 02, 2017 @ 15:48
    M N
    0

    Hey fellas,

    Anyone aware of any movement or general solution to this problem as of 7.6? We keep a folder in our repo's specifically for the cropper since you can't choose from the media library.

    Or any 3rd party package that has made this process more consistent to what editors are expecting?

    Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft