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?
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.
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 ;-)
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?
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
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.
If you use ImageGen pro you can also crop images. It works pretty well :).
Jeroen
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 ;-)
Ah, just found this ... looks interesting!
http://deepliquid.com/content/Jcrop.html
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
is working on a reply...