Apply crop size changes to media items automatically v7
Hi all,
I've run into a predicament with Umbraco v7.1.4 and I was wondering if anyone has any ideas of how to get around it. Basically my end user would like to modify an image crop and apply it to all images in their media directory. The problem is, they have 2000 images in their media folder. As far as I know, the recommendation at the moment when adding a new image crop or modifying one is to manually resave the image so that the crop is applied. I thought this would work programmatically using the mediaservice so I wrote the following function that can be called using a url with an appended querystring:
I have run this function but unfortunately it doesn't appear to work. The crops are used in a rotating gallery that is stored as a RTE macro in Umbraco. This gallery has a cache time of 10 seconds. Could this be the reason why I am not seeing the new image crops after running this method?
Any help or alternative methods would be greatly appreciated.
Apply crop size changes to media items automatically v7
Hi all,
I've run into a predicament with Umbraco v7.1.4 and I was wondering if anyone has any ideas of how to get around it. Basically my end user would like to modify an image crop and apply it to all images in their media directory. The problem is, they have 2000 images in their media folder. As far as I know, the recommendation at the moment when adding a new image crop or modifying one is to manually resave the image so that the crop is applied. I thought this would work programmatically using the mediaservice so I wrote the following function that can be called using a url with an appended querystring:
I have run this function but unfortunately it doesn't appear to work. The crops are used in a rotating gallery that is stored as a RTE macro in Umbraco. This gallery has a cache time of 10 seconds. Could this be the reason why I am not seeing the new image crops after running this method?
Any help or alternative methods would be greatly appreciated.
J
No one has respond for awhile...
Media crops are automatic in v7.. no crop files are created so adding a new crop shouldn't be an issue.
Jeavon has created a package for this. This hooks in to the save event to of the crop datatype and resaves all crops.
https://github.com/Jeavon/Umbraco-Crop-Healer
is working on a reply...