Copied to clipboard

Flag this post as spam?

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


  • Gordon Saxby 1347 posts 1608 karma points
    May 02, 2012 @ 01:26
    Gordon Saxby
    0

    User image upload and crop

    I need to create a UserControl to allow signed in Umbraco members to upload an image to the site - from the front end, not using Umbraco. I need to allow the user to crop their image (i.e. user select an area and then crop / resize image). Ideally I would want the image to be stored properly in the Media Library.

    So, is there by chance an existing control that will do that? If not, can I use and combine an Upload control and the Umbraco Image Cropper control?

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    May 02, 2012 @ 12:40
    Jeroen Breuer
    0

    I've never used a cropper in the frontend, but I did create media. Maybe this part of DAMP can help you: http://damp.codeplex.com/SourceControl/changeset/view/86116#1967018

    There I create media items and crops while installing a package.

    Jeroen

  • Gordon Saxby 1347 posts 1608 karma points
    May 02, 2012 @ 14:41
    Gordon Saxby
    0

    Thanks for the pointer to that code, Jeroen.

    It's the first / main bit of using an Umbraco control in my UserControl that I am not sure about ... I thought I had seen posts about it but can't find it / them !?

    The website needs the image to be a specific pixel size, width and height, so I need to be able to enforce that. I could use something like ImageGen to dynamically resize but that might not work if the proportions are not correct, hence the need to crop.

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    May 02, 2012 @ 14:43
    Jeroen Breuer
    0

    If you use ImageGen pro you can also crop images. It works pretty well :).

    Jeroen

  • Gordon Saxby 1347 posts 1608 karma points
    May 02, 2012 @ 14:49
    Gordon Saxby
    0

    Yes, but if the image needs to be 400px wide by 300px high - and the uploaded image is 2000px by 2000px then automatically resizing and cropping it will either lose some or leave a part blank / missing. Also, the user does not get to decide which part of the image to keep / lose.

    The user will be the "general public" so insisting that the source image is the correct size or proportions is not an option ;-)

  • Gordon Saxby 1347 posts 1608 karma points
    May 02, 2012 @ 14:57
    Gordon Saxby
    0

    Ah, just found this ... looks interesting!

    http://deepliquid.com/content/Jcrop.html

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    May 02, 2012 @ 14:59
    Jeroen Breuer
    0

    I understand :). Custom cropping is the best solution than. Umbraco has another cropper which might be better suited. It's part of the skinning feature. Have a look at the first part of this video: http://umbraco.com/help-and-support/video-tutorials/umbraco-fundamentals/creating-a-skin-for-umbraco/image-dependency-type/TVPlayer

    Jeroen

  • 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