在magento中压缩上传的图像

发布于 2024-10-05 17:53:42 字数 110 浏览 0 评论 0原文

是否可以在magento中上传时压缩原始产品图像? Magento 以完整尺寸保存原始上传的图像。 商店管理员有 3MB 图像和 20K 产品。 我想自动将图像大小调整为 ~150K。

谢谢

Is it possible to compress the original product image on upload in magento?
Magento saves the original uploaded image in full size.
The store admin have 3MB images and 20K products.
I want to automatically resize the images to ~150K.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦回梦里 2024-10-12 17:54:09

使用 Photoshop 或其他相关工具将图像大小调整为商店可用的最大尺寸可能是最快的。这应该是一个相对较小的 JPG,并且可以在很大程度上消除该问题。另一个好处是,上传新图像的速度会快很多倍。

It may be fastest to use Photoshop or some related to resize the images to the largest useful size for the store. This should be a relatively small JPG, and will largely obviate the issue. As a side benefit, uploading new images will be many times faster.

画离情绘悲伤 2024-10-12 17:54:05

如果您确实必须通过管理员调整大小,您也许可以绑定到产品保存的事件观察器并编写脚本来减小原始图像的大小。

If you really have to do the resizing through the admin, you might be able to tie into the event observer for the product save and write a script to reduce the size of the original image.

韵柒 2024-10-12 17:54:01

Magento 在前端显示产品图像之前会自动重新压缩产品图像。

由于压缩技术的性质,您无法轻松地确定特定的文件大小,因为它在很大程度上取决于图片中的细节量。普通的“大”(宽和高)图像可能会比复杂的“小”(窄和短)图像产生更小的文件。首先检查向客户提供的文件大小,然后决定是否值得追求。

Magento automatically re-compresses product images before displaying them on the frontend.

Due to the nature of compression techniques you cannot easily target a specific file size as it depends a lot on the amount of detail in a picture. A plain "large" (wide and tall) image can result in a smaller file than a complex "small" (narrow and short) image. First check the file sizes being served to customers and then decide if it's worth pursuing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文