[jQuery] Cropping images plugin
I'd like to crop images to the maximum available space if the image is
too large. I've looking around for a plugin which does just that but
none seems to do. In case none exists I propose to create one which
has the following API:
cropImage (width, height)
- If width, height are empty the image is resized to the max allowed
space of the parent element but only if larger, if smaller no resizing
is done.
- If either width or size is specified the image is resized always
with the same ratio of width/height.
- If both width and height are specified the image is resized
accordingly.
- Parameter width and height might be given as e.g. "200px", "95%",
"20em", etc.
Does this API make sense? Or would the following be better?
cropImage (width, height, mode)
- Parameter mode is either "larger", "always", "width" (width
determinds ratio), "height".
Is there already s crop plugin which could be adapted? Is anybody else
interested in such a plugin and wants to help me?
O. Wyss