简体   繁体   中英

How to crop large image in small form without trimming before crop?

Does someone knows the image-crop which correctly works with the 'dynamically changed in the CSS image size (I mean width and height)'?

All image-crops works fine if there is original image size (for example size: 400px x 400px) and width:100%;

But if show to user picture with sizes 1500px x 1500px and make it smaller just with css to 100px x 100px (because 1500px - usually to much for screen and looks not pretty) - in this case image-croppers what i saw before issued an error or makes a thumbnail with initial values (top-left corner). I need to pull out pictures from Facebook albums, and usually they are too large.

I know that it is possible to reduce the image before crop, but then deteriorates the quality.

By the way, looks like there is way to make this, because in jCrop preview thumbnail looks fine even if i 'dynamically' change size of image in css. Just preview! Completed cropped image is not correct, as I said there would be the upper left corner of the image.

如果您要查找的是响应式或流畅的图像裁剪器(适合屏幕),则应尝试使用Guillotine ,查看演示并调整浏览器窗口的大小以查看其适应方式。

Okay, the solution was: divide the original image size to "smaller in the css" size. We obtain the coefficient, before sending it to crop - multiply x1, y1, height, width to this coefficient. profit!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM