如何使用graphicsmagick C 库将图像置于固定的指定裁剪框内居中

发布于 2024-10-01 12:13:39 字数 531 浏览 0 评论 0原文

嘿,我想知道是否有人知道在保持纵横比的同时缩放图像的好方法,然后将其相对于指定的固定裁剪区域居中。

第一部分很简单(在保持比例的同时调整大小),只需要第二部分的帮助。

这是使用 php 和 image gd 执行此操作的链接。 PHP 裁剪图像以固定宽度和高度而不丢失尺寸比例

我想要实现的另一个链接是此页面上的“裁剪”策略: http://transloadit.com/docs/image-resize#resize-strategies

我想使用graphicsmagick C 库来完成此操作。

多谢。

Hey, I was wondering if someone knows a good way to scale an image while maintaining aspect ratio, and then center it with respect to a specified fixed crop area.

The first part is straight forward (resizing while maintaining ratio), just need help with the second part.

Here is a link to something that does this with php and image gd.. PHP crop image to fix width and height without losing dimension ratio

Another link to what I want to achieve is the "Crop" strategy on this page:
http://transloadit.com/docs/image-resize#resize-strategies

I want to do this using the graphicsmagick C library.

Thanks a lot.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文