Imagemagick - 错误地识别 .jpg 的尺寸
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否使用 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... :-)