简体   繁体   English

如何在裁切前裁切不裁切的大尺寸图像?

[英]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)'? 有人知道正确使用“动态更改CSS图像大小(我是指宽度和高度)”的图像裁剪吗?

All image-crops works fine if there is original image size (for example size: 400px x 400px) and width:100%; 如果有原始图像尺寸(例如,尺寸:400px x 400px)和宽度: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). 但是,如果向用户显示尺寸为1500px x 1500px的图片,并使其缩小,仅使用css即可达到100px x 100px(因为1500px-通常在屏幕上很大,而且看起来不太漂亮)-在这种情况下,图像裁剪器我之前看到的内容发出了错误或制作带有初始值的缩略图(左上角)。 I need to pull out pictures from Facebook albums, and usually they are too large. 我需要从Facebook相册中提取图片,通常它们太大了。

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. 顺便说一句,似乎有办法做到这一点,因为即使我“动态地”更改css中图像的大小,在jCrop中预览缩略图也很好。 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. 好的,解决方法是:将原始图像大小划分为“较小的CSS”大小。 We obtain the coefficient, before sending it to crop - multiply x1, y1, height, width to this coefficient. 我们获得系数,然后将其发送给作物-将x1,y1,高度,宽度乘以该系数。 profit! 利润!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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