如何显示JPEG文件的方向? [英] How can I display the orientation of a JPEG file?

查看:160
本文介绍了如何显示JPEG文件的方向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么ImageMagick命令将显示JPG文件的方向?

What ImageMagick command will display the orientation of a JPG file?

推荐答案

您可以使用

identify -format '%[EXIF:Orientation]' <image.jpg>

根据 identify -format docs (关于exif元数据的内容还有些不足).

as per identify -format docs (It's the bit further down about exif metadata).

尝试

identify -verbose <image.jpg>

要查看图像中的元数据是什么(例如,如果图像不是用相机拍摄的,则不会设置方向标签).

To see what metadata is in the image (for example if the image was not taken with a camera, the orientation tag will not be set).

或者,您可以做类似的事情

Alternatively you could do something like

identify -format '%wx%h' <image.jpg>

给出宽度的高度(例如'800x598','1936x2592'),并使用这些值确定图像是否垂直(不确定该图像的可靠性如何-有时您用相机拍摄人像图像并且EXIF数据将正确记录方向,但是图像可能仍然出现横向).

which gives you the width by height (e.g. '800x598', '1936x2592') and use these to determine whether the image is upright or not (not sure how reliable this is though - sometimes you take a portrait image with a camera and the EXIF data will correctly record the orientation, but the image may still appear landscape).

这篇关于如何显示JPEG文件的方向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆