Imagemagick - 错误地识别 .jpg 的尺寸

发布于 2024-12-15 03:25:54 字数 306 浏览 3 评论 0原文

Imagemagick 无法识别 .jpg 图像的正确宽度 x 高度。我使用的是 OSX(10.6 Snow Leopard)。我有一个 .jpg 图像。在 Finder 中查看图像信息时,它指出尺寸为 2592 x 3888。当我使用“识别图像.jpg”时,它返回 3888 x 2592。如果我在预览中打开图像并另存为 .png,则执行“识别图像”。 png' 它正确返回 2592 x 3888。有人知道发生了什么吗?

主要问题是我在 Ruby on Rails 网站中使用 Imagemagick 作为 Paperclip Gem 的一部分。

谢谢, 麦克风

Imagemagick is not identifying the correct width x height for .jpg images. I'm on OSX (10.6 Snow Leopard). I have a .jpg image. When viewing the image information in Finder it states that the Dimensions are 2592 x 3888. When I use 'identify image.jpg' it returns 3888 x 2592. If I open the image in Preview and save as .png then do 'identify image.png' it correctly returns 2592 x 3888. Does anybody know what is going on?

The primary issue is that I'm using Imagemagick as part of the Paperclip Gem in a Ruby on Rails website.

Thanks,
Mike

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

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

发布评论

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

评论(1

大海や 2024-12-22 03:25:54

您是否使用 Preview.app 旋转 JPEG 进行查看?

即使您在几天、几周或几个月前执行了此操作,并且没有保存旋转的图像,Preview.app 也会记住此旋转(并告知 Finder)并继续以旋转模式显示此图像。

当您将其转换为 PNG 时,它将创建一个旋转的 PNG。

所以,ImageMagick 一直都是正确的,Finder/Preview.app 确实对你玩了一个很好的把戏......:-)

Did you use Preview.app to rotate the JPEG for viewing?

Even if you did this days, weeks or months ago, and if you didn't save the rotated image, Preview.app will remember this rotation (and also tell Finder about it) and continue to display this image in rotated mode.

When you convert this to PNG, it will create a rotated PNG.

So, ImageMagick is correct all the way through, and Finder/Preview.app did play a nice trick on you... :-)

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