V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
ayang23
V2EX  ›  Python

PIL 打开某些图片后会自动90度旋转?

  •  
  •   ayang23 ·
    ayang23 · 2013-06-24 14:46:16 +08:00 · 5179 次点击
    这是一个创建于 3930 天前的主题,其中的信息可能已经有所发展或是发生改变。
    5 条回复    1970-01-01 08:00:00 +08:00
    jjplay
        1
    jjplay  
       2013-06-24 15:01:42 +08:00
    我用ACDsee 打开一些本事是横着人像的图片 也会自动旋转,很智能 难道是通过openCV人脸识别 然后旋转? 不解,求答案
    ayang23
        2
    ayang23  
    OP
       2013-06-24 15:07:36 +08:00
    @jjplay 那这个pil智能就弱智了,我的图片本来是正常人像,这个我用很多看图软件和photoshop打开过,没问题,可用pil打开就躺下了。
    jjplay
        3
    jjplay  
       2013-06-24 15:26:35 +08:00
    @ayang23 哈哈,你的照片躺抢... 换个图片浏览器吧
    timonwong
        4
    timonwong  
       2013-06-24 15:33:55 +08:00   ❤️ 1
    查看一下EXIF信息,看看有没有 Orientation
    ayang23
        5
    ayang23  
    OP
       2013-06-24 17:15:11 +08:00
    @timonwong 果然这里有情况 Mac的预览程序详情显示 方向 6(逆时针旋转90℃);ImageMagick identify 结果:exif:Orientation: 6 。看来得改缩略图算法,搜了一下,参考:
    http://stackoverflow.com/questions/1606587/how-to-use-pil-to-resize-and-apply-rotation-exif-information-to-the-file?rq=1
    http://stackoverflow.com/questions/4029353/how-can-i-restore-exif-data-after-resizing-an-image-with-pil?rq=1
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3173 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 12:19 · PVG 20:19 · LAX 05:19 · JFK 08:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.