I'm trying to extend the V7 image cropper by creating a new physical image on the server.
The existing package works fine and saves the property data just fine, but I'd prefer crops to generate new files on the server without the overheard of image resizing and cropping in real time.
Now, I've downloaded the source file and installed it correctly, but I cannot find the save button in the package views. So assuming that the save button comes from Umbraco. Is there any way to override what the save button does and if so are there any examples out there?
I tried quite a few hours of googling, but could not find anything conclusive. This is my first time creating/extending packages, so any pointers would be awesome.
Image processor comes standard with caching so once it has cropped once it keeps a cache of the crop for the length specified in the config. If the image changes it updates the cache. So its not cropping everytime it loads, but only on first load.
Hope that helps... Otherwise if you are still keen to create physical assets of each crop size you could look at adding an event to Umbraco that on save it takes the crop data and uses it to create the cropped versions you need using ImageProcessor http://jimbobsquarepants.github.io/ImageProcessor/imageprocessor.html
Thanks for replying. Yes, I'm aware, but it's really a project requirement that I'm dealing with. Is there any documentation on how to add an event to Umbraco? Sorry to be a pain, but this is really my first package... growing/starting pains! ;-)
There was a change in recent version to remove the RAMMFAR declaration to improve performance so the HttpModules could no longer be dynamically created. For some reason Nuget is sometimes (rarely) not transforming the web.config on update.
Also, probably a daft question but what version of Umbraco are you running? I think it only got added from v7.1
It's been awhile so I'm not 100% certain, but I believe it was because Umbraco uses the ImageProcessor and ImageProcessor.Web NuGet packages, but you also need to include the ImageProcessor.Web.Config package.
But like I said, it's been awhile so I may be mistaken.
Override save button in custom package
Hi guys
I'm trying to extend the V7 image cropper by creating a new physical image on the server.
The existing package works fine and saves the property data just fine, but I'd prefer crops to generate new files on the server without the overheard of image resizing and cropping in real time.
Now, I've downloaded the source file and installed it correctly, but I cannot find the save button in the package views. So assuming that the save button comes from Umbraco. Is there any way to override what the save button does and if so are there any examples out there?
I tried quite a few hours of googling, but could not find anything conclusive. This is my first time creating/extending packages, so any pointers would be awesome.
Thank you
Hey Joao
I'm probably telling you something you already know but are you aware that the Umbraco 7 is using ImageProcessor behind the scenes? http://jimbobsquarepants.github.io/ImageProcessor/imageprocessor-web.html
Image processor comes standard with caching so once it has cropped once it keeps a cache of the crop for the length specified in the config. If the image changes it updates the cache. So its not cropping everytime it loads, but only on first load.
Hope that helps... Otherwise if you are still keen to create physical assets of each crop size you could look at adding an event to Umbraco that on save it takes the crop data and uses it to create the cropped versions you need using ImageProcessor http://jimbobsquarepants.github.io/ImageProcessor/imageprocessor.html
Hey Peter
Thanks for replying. Yes, I'm aware, but it's really a project requirement that I'm dealing with. Is there any documentation on how to add an event to Umbraco? Sorry to be a pain, but this is really my first package... growing/starting pains! ;-)
Thanks all!
Yep sure is..
check out http://our.umbraco.org/documentation/Reference/Events-v6/
It applies to V7 Also. You want to look at the MediaService events :)
Thanks Peter! You're a star!
Glad to help :)
Hey Peter, you mention that Umbraco uses the ImageProcessor behind the scenes. Is there anything in particular I need to do to use this?
The link you refer to http://jimbobsquarepants.github.io/ImageProcessor/imageprocessor-web.html says that all you need to do is add some querystring variables to the image url, but when I use an image in the media section it doesn't do anything.
For instance, when I change the url http://localhost/media/1001/someimage.png to http://localhost/media/1001/someimage.png?width=100 it doesn't do anything.
Thanks in advance.
Anyone else maybe?
I would double check that the HttpModule declarations are in the web.config as described here
http://imageprocessor.org/imageprocessor-web/#webconfig
There was a change in recent version to remove the
RAMMFAR
declaration to improve performance so the HttpModules could no longer be dynamically created. For some reason Nuget is sometimes (rarely) not transforming the web.config on update.Also, probably a daft question but what version of Umbraco are you running? I think it only got added from v7.1
It's been awhile so I'm not 100% certain, but I believe it was because Umbraco uses the ImageProcessor and ImageProcessor.Web NuGet packages, but you also need to include the ImageProcessor.Web.Config package.
But like I said, it's been awhile so I may be mistaken.
You only need the configuration package if you are changing settings.
I would check the Umbraco version if you can and also the installed ImageProcessor package versions. I wrote the thing so I should be able to help.
is working on a reply...