jonom / jquery-focuspoint

jQuery plugin for 'responsive cropping'. Dynamically crop images to fill available space without cutting out the image's subject. Great for full-screen images.
Other
3.15k stars 211 forks source link

specify x1, y1, x2, y2 (define area that should always be visible) #22

Closed Langmans closed 8 years ago

Langmans commented 9 years ago

Should be tagged feature request :)

luruke commented 9 years ago

Probably is easier to set a radius area

Langmans commented 9 years ago

But what if I want to define an area where width is larger then the height. For example, a photo of a school class, except I want to set focus on two people.

It would be awesome if this plugin could do that. I realize that it might be out of the scope however.

jonom commented 9 years ago

This is probably out of scope. FocusPoint is designed to let you fill any container completely with an image. If you wanted to keep two points visible in the container at all times, this would not always be possible - in some situations you would have to reduce the image size to be not as tall or not as wide as the container, creating a letter-boxing effect. The closest thing you could do at the moment is use the point in between your two subjects as the focus point and ensure your container always has an aspect ratio that includes both subjects.

However something that could be cool is if you supplied more than one focuspoint, the plugin could use an average of the points if it's possible to include all the points in the crop, or if it's not possible to display them all it could fall back to using less, or ultimately just the first focuspoint. Could be a good compromise?

Langmans commented 9 years ago

However something that could be cool is if you supplied more than one focuspoint, the plugin could use an average of the points if it's possible to include all the points in the crop, or if it's not possible to display them all it could fall back to using less[...]

That sounds like something I would use.

alfredo-cp commented 9 years ago

+1

BenjaminBeck commented 8 years ago

+1

jonom commented 8 years ago

I've implemented the original request, will be available in v2. Feel free to try it out on the v-2-dev branch.