Create Rake task that will re-resize images based on changes to IMAGE_SIZES
Reported by Walter McGinnis | July 3rd, 2009 @ 10:25 AM | in 1.3
Create a rake task that will do the following:
- take uploaded original and resize bases on IMAGE_SIZES constant's hash of size specifications
- update the metadata for each ImageFile instance that matches a size specification accordingly (height, width, content_size, etc.)
- add new ImageFile instances if a new size specification has been added to IMAGES_SIZES
Possible improvements:
- be able to specify which size should be redone rather than doing all size specifications in IMAGE_SIZES
- be able to specify if ImageFile instances that are no longer associated with a IMAGE_SIZES spec should be destroyed, if so destroy them
Things to keep in mind:
- we don't want to break existing URLs for people if possible, I don't think this should be an issue, but keep that in mind
- you'll probably need to call AttachementFu's Rmagick processing directly to do the resizing
Comments and changes to this ticket
-
Kieran P July 6th, 2009 @ 12:08 PM
- → State changed from new to resolved
The rake task has been completed and tested on two sites. Both worked as expected.
The possible improvements aren't required at this point, so will be put on hold?
This work is available in the 1-3-prep-work branch (will be in master soon)
Documentation for the task is available at http://kete.net.nz/documentation/topics/show/255-how-can-i-change-t...
Resolving ticket.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Kete was developed by Horowhenua Library Trust and Katipo Communications Ltd. to build a digital library of Horowhenua material.
