I am working on a site that will have quite a few images, which will be uploaded by the client.
Is there a control that will allow either the client manually, or me programmatically, to resize the images as part of putting them into the Media Library - probably as part of adding a document / node, rather than direct to the Media Library?
I know there is ImageGen (very good, used it before!) but I want the images resized before they get saved to the Media Library. The source images are promotional shots from manufacturers and will typically be much too large for use on the website.
This is a serious limitation of Umbraco. Most of the time you do not want users uploading 10 megapixel photos to your website, but rather resize them to a more sensible size. This is unfortunately very difficult to do in Umbraco. It's no use hooking up to the Media.AfterSave event, which would be the most logical place to do this resizing, because Umbraco has locked to uploaded file when this event is called. The only alternative is a complete reimplementation of the Upload datatype, which I'm not looking forward to. All it would have taken is a Media.UploadFinished event...
If anyone is interested, I have written an improved version of the standard Umbraco upload control that allows setting a max width/height for uploaded photos (only works with JEPG files at the moment, but can be expanded to other image types, if needed). Let me know, if you're interested, and I will post some source code and a dll file.
Why not create a package and reease it in the Projects section of Our? This way others can benefit from your efforts as well (if you don't mind sharing).
You're probably right. That would be the best way. Though right now it feels a bit too much like a dirty hack than a proper package. But then again, it would be usefull, I think. I will have to look into making an umbraco package... Any good resources on that?
Meanwhile, here is the dll file (just drop it in the Bin folder) as well as the source code. You should then be able to create a new data type with a render control called "Upload field with resize".
I would recomend the core team consider adding an AfterFinished event (or something like that) so us developers can handle the file once it's complete when doing a bulk upload using something like the Desktop Media uploader.
Suggested feature to add to your imager resizer: restrict the KB of the file size. Not only does it come in handy to restrict image dimensions, but most important often times is to prevent users from uploading 12MB images straight from their camera.
I have tested Image resizer. It is very good but when user is adding images in the RTE using media file uploader, we need to select the resized one as its not a good idea to allow 10Mp photos in it.
Guys, have you found something to update the exsisting fileupload to do the trick?
Resize image when loading to Media Lirary
I am working on a site that will have quite a few images, which will be uploaded by the client.
Is there a control that will allow either the client manually, or me programmatically, to resize the images as part of putting them into the Media Library - probably as part of adding a document / node, rather than direct to the Media Library?
I know there is ImageGen (very good, used it before!) but I want the images resized before they get saved to the Media Library. The source images are promotional shots from manufacturers and will typically be much too large for use on the website.
Hi,
you could try zip-upload for this. It has the ability to create different sizes of the image while you upload them.
http://our.umbraco.org/projects/zip-upload
Regards,
Peter
Umm, I can't see where the size might be defined?
I think I will push them towards sizing the images before uploading!
Hi Gordon,
Not had chance to use it yet, but the new SUMO project looks like it'll do just what you need...
There's a config file for that package. In that file, you can define the sizes you want.
It will then create all images in the sizes you defined.
Just found it myself this week, worked liek a charm.
Peter
Hi Dan,
SUMO looks like it is going to be something rather good, however the current version only says it supports "rotate, flip & crop" - i.e. not resize
Peter, can you share the config for this as I don't think it is part of the original package.
Thanks,
Nik
Sure! (Forgot about that, I read it on Tim's blog in the comments)
Add this to the zipUpload.config:
The numbers are the different widths you want for the images. The width will be appended to the filename:
image.jpg (original)
image_61.jpg
image_200.jpg etc
Peter
This is a serious limitation of Umbraco. Most of the time you do not want users uploading 10 megapixel photos to your website, but rather resize them to a more sensible size. This is unfortunately very difficult to do in Umbraco. It's no use hooking up to the Media.AfterSave event, which would be the most logical place to do this resizing, because Umbraco has locked to uploaded file when this event is called. The only alternative is a complete reimplementation of the Upload datatype, which I'm not looking forward to. All it would have taken is a Media.UploadFinished event...
If anyone is interested, I have written an improved version of the standard Umbraco upload control that allows setting a max width/height for uploaded photos (only works with JEPG files at the moment, but can be expanded to other image types, if needed). Let me know, if you're interested, and I will post some source code and a dll file.
Why not create a package and reease it in the Projects section of Our? This way others can benefit from your efforts as well (if you don't mind sharing).
Thanks!
Thanks Peter for posting that. Good to know!
You're probably right. That would be the best way. Though right now it feels a bit too much like a dirty hack than a proper package. But then again, it would be usefull, I think. I will have to look into making an umbraco package... Any good resources on that?
Meanwhile, here is the dll file (just drop it in the Bin folder) as well as the source code. You should then be able to create a new data type with a render control called "Upload field with resize".
I've written an Image resizer datatype. Although it doesn't work for a bulk upload it does allow resizing images when the media is saved.
You link the datatype to a specific media field (i.e. umbradoFile) and it will resize the image on save.
You can add multiple resizers to a document or media type.
You can look at it here: http://our.umbraco.org/projects/developer-tools/image-resizer
I would recomend the core team consider adding an AfterFinished event (or something like that) so us developers can handle the file once it's complete when doing a bulk upload using something like the Desktop Media uploader.
Suggested feature to add to your imager resizer: restrict the KB of the file size. Not only does it come in handy to restrict image dimensions, but most important often times is to prevent users from uploading 12MB images straight from their camera.
Hi Dan,
I have tested Image resizer. It is very good but when user is adding images in the RTE using media file uploader, we need to select the resized one as its not a good idea to allow 10Mp photos in it.
Guys, have you found something to update the exsisting fileupload to do the trick?
Thanks
Muhammad
is working on a reply...