Imagecache have a 'crop' action which is needed for additional parameters to be saved with imagefield.
This will be very useful to create undistorted fixed-size thumbnails from differently sized (and oriented) images.
Then we need some jquery plugin (i didn't find yet the suitable) like this (Prototype & script.aculo.us) but simpler: no image operations is needed, just saving interactively chosen top-left and bottom-right corners coordinates.
The aspect ratio of selectable area is fixed and derives from final 'scale' action parameters of selected imagecache preset.
Altogether we need for:
- X-offset
- Y-offset
- Width (before the final scale)
- Height (? - we can calculate it)
- Imagecache preset name
If there are several presets available we can choose and store the data above separately for each one.
Stored parameters can be transmitted to imagecache as URL arguments:
'/files/imagecache/[name-of-preset]/[X-offset]/[Y-offset]/...'
Comments
Comment #1
dopry commentedI abandoned addressing things through the url like that since its a big DOS waiting to happen. Quicksketch has added the necessary features to do zoom cropping to imagecache, and imagefield now directly intereacts with imagecache. I don't expect I'll be building the JS interface just yet, but someone else is working on it.
Comment #2
dopry commented