{ "info": { "author": "Henrik Blidh", "author_email": "henrik.blidh@nedomkull.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "\nimdirect\n========\n\n|Build Status| |Coverage Status|\n\nPIL extension performing automatic rotation of opened JPEG images.\n\nDescription\n-----------\n\nThe orientation of the photographed object or scene with respect to the\ndigital camera is encoded in the resulting image's Exif [1]_ data\n(given that it is saved as a JPEG). When working with such digital\ncamera images, this orientation might lead to problems handling the\nimage and is very often desired to be counteracted.\n\nThis module is a small extension to `Pillow `_ that\n`monkey patches `_\nthe `PIL.Image.open `_ method\nto automatically rotate the image [2]_ (by lossless methods) and update\nthe Exif tag accordingly, given that image is a JPEG.\n\nThe package also features a save method that includes the Exif data\nby default when saving JPEGs.\n\nInstallation\n------------\n\n::\n\n pip install imdirect\n\nUsage\n-----\n\nDemonstration of the monkey patching and how it works:\n\n.. code:: python\n\n >>> from PIL import Image\n >>> import imdirect\n >>> img = Image.open('image.jpg')\n >>> print(\"{0}, Orientation: {1}\".format(img, img._getexif().get(274)))\n , Orientation: 6\n >>> imdirect.monkey_patch()\n >>> img_autorotated = Image.open('image.jpg')\n >>> print(\"{0}, Orientation: {1}\".format(img_autorotated, img_autorotated._getexif().get(274)))\n , Orientation: 1\n\n\nThe package can also be used without monkey patching, by applying the\n``imdirect.imdirect_open`` method directly:\n\n.. code:: python\n\n >>> from imdirect import imdirect_open\n >>> img = imdirect_open('image.jpg')\n\nor by using the ``imdirect.autorotate`` on a ``PIL.Image.Image`` object:\n\n.. code:: python\n\n >>> from PIL import Image\n >>> import imdirect\n >>> img = Image.open('image.jpg')\n >>> img_rotated = imdirect.autorotate(img)\n\nThe last method does not return a ``PIL.JpegImagePlugin.JpegImageFile``, but can still be used\nif the Exif information of the original image is undesired.\n\nTests\n~~~~~\n\nTests can be run with `pytest `_:\n\n.. code:: sh\n\n Testing started at 13:28 ...\n ============================= test session starts ==============================\n platform linux2 -- Python 2.7.12, pytest-3.0.1, py-1.4.31, pluggy-0.3.1\n rootdir: /home/hbldh/Repos/imdirect, inifile:\n collected 4 items\n\n test_autorotate.py ...\n test_monkey_patching.py .\n\n =========================== 4 passed in 0.08 seconds ===========================\n\nReferences\n----------\n\n.. [1] Exif on Wikipedia (https://en.wikipedia.org/wiki/Exif)\n\n.. [2] Exif orientation (http://sylvana.net/jpegcrop/exif_orientation.html)\n\n\n.. |Build Status| image:: https://travis-ci.org/hbldh/imdirect.svg?branch=master\n :target: https://travis-ci.org/hbldh/imdirect\n.. |Coverage Status| image:: https://coveralls.io/repos/github/hbldh/imdirect/badge.svg?branch=master\n :target: https://coveralls.io/github/hbldh/imdirect?branch=master\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hbldh/imdirect", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "imdirect", "package_url": "https://pypi.org/project/imdirect/", "platform": "", "project_url": "https://pypi.org/project/imdirect/", "project_urls": { "Homepage": "https://github.com/hbldh/imdirect" }, "release_url": "https://pypi.org/project/imdirect/0.5.0/", "requires_dist": [ "Pillow", "piexif" ], "requires_python": "", "summary": "PIL extension performing automatic rotation of opened JPEG images", "version": "0.5.0" }, "last_serial": 3341168, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "e9edb77915c6b48ee3ac3d4424054583", "sha256": "a7881e69e92e866447d65707ed29c004a9e5c33c67d14c629f41aa0052f4492c" }, "downloads": -1, "filename": "imdirect-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e9edb77915c6b48ee3ac3d4424054583", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8889, "upload_time": "2017-11-17T12:17:28", "url": "https://files.pythonhosted.org/packages/66/bb/95f2fdf0e5733809e7d157ecf622790af7cd14f38624e8760976b1a6a89c/imdirect-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6a41c8d7d2230bcd4a42d13693fb01b7", "sha256": "aec6499af317ce673dd3f65ab1a2bd6bbdd2d3ebcdb1fbcdab25c41dc32f2440" }, "downloads": -1, "filename": "imdirect-0.5.0.tar.gz", "has_sig": false, "md5_digest": "6a41c8d7d2230bcd4a42d13693fb01b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6837, "upload_time": "2017-11-17T12:17:30", "url": "https://files.pythonhosted.org/packages/37/6e/02bbb050ccbc7ff87b89c8b310c9bb9b0bfa074084deb0afd13f361c9973/imdirect-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e9edb77915c6b48ee3ac3d4424054583", "sha256": "a7881e69e92e866447d65707ed29c004a9e5c33c67d14c629f41aa0052f4492c" }, "downloads": -1, "filename": "imdirect-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e9edb77915c6b48ee3ac3d4424054583", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8889, "upload_time": "2017-11-17T12:17:28", "url": "https://files.pythonhosted.org/packages/66/bb/95f2fdf0e5733809e7d157ecf622790af7cd14f38624e8760976b1a6a89c/imdirect-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6a41c8d7d2230bcd4a42d13693fb01b7", "sha256": "aec6499af317ce673dd3f65ab1a2bd6bbdd2d3ebcdb1fbcdab25c41dc32f2440" }, "downloads": -1, "filename": "imdirect-0.5.0.tar.gz", "has_sig": false, "md5_digest": "6a41c8d7d2230bcd4a42d13693fb01b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6837, "upload_time": "2017-11-17T12:17:30", "url": "https://files.pythonhosted.org/packages/37/6e/02bbb050ccbc7ff87b89c8b310c9bb9b0bfa074084deb0afd13f361c9973/imdirect-0.5.0.tar.gz" } ] }