{ "info": { "author": "github.com/scardine", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "\u26a0\ufe0f This is a fork of scardine/image_size simply to create a distributable package on PyPI. Will be rendered unnecessary if `image_size/issues/13`__ is addressed.\n\n.. _issue13: https://github.com/scardine/image_size/issues/13\n__ issue13\n\n================\nget_image_size\n================\n| Src: https://github.com/scardine/image_size\n| PyPI:\n\n.. image:: https://raw.github.com/scardine/image_size/master/lookmanodeps.png\n :alt: Look, Ma! No deps!\n\n\nGet image width and height given a file path using minimal dependencies\n(no need for PIL, libjpeg, libpng, etc).\n\n\nWhy don't you just use PIL?\n---------------------------\n\nPIL is huge and has lots of dependencies, perhaps an overkill if you\nwant just the image dimensions. If you already have PIL installed, then\nsure, use it instead.\n\nThis was written in answer for the question \"`Get Image size WITHOUT\nloading image into memory\n`__\"\n(using Python) in stackoverflow. The OP said:\n\n @PauloScardine hey thanks Paulo, this is great! It's always so nice\n to have code that can be easily deployed without bringing in\n dependencies, and this fits the bill! As you say, avoiding PIL is\n worth it for its own sake.\n\nUsage\n-----\n\nRight now only for PNG, JPEG, GIF, BMP and TIF. Very untested, fork and\nsend PRs.\n\nPython ``get_image_size.get_image_size`` usage:\n\n.. code:: python\n\n import get_image_size\n try:\n width, height = get_image_size.get_image_size('/path/to/image.ext')\n except get_image_size.UnknownImageFormat:\n width, height = -1, -1\n\n\nPython ``get_image_size.get_image_metadata`` usage:\n\n.. code:: python\n\n import get_image_size\n try:\n img = get_image_size.get_image_metadata('/path/to/image.ext')\n width, height = img.width, img.height\n print(img._asdict())\n except get_image_size.UnknownImageFormat:\n width, height = -1, -1\n\nCommandline ``get-image-size`` usage:\n\n.. code:: bash\n\n $ python -m get_image_size --help\n $ get-image-size --help\n Usage: get-image-size [-v|--verbose] [--json|--json-indent] []\n\n Print metadata for the given image paths (without image library bindings).\n\n Options:\n -h, --help show this help message and exit\n --json\n --json-indent\n -v, --verbose\n -q, --quiet\n -t, --test\n\n $ get-image-size ./lookmanodeps.png\n 251\t208\t22228\tPNG\t./lookmanodeps.png\n\n $ get-image-size --json-indent ./lookmanodeps.png\n {\n \"path\": \"./lookmanodeps.png\",\n \"type\": \"PNG\",\n \"file_size\": 22228,\n \"width\": 251,\n \"height\": 208\n }\n\n\n\n\nUpdates\n-------\n\nOver the time people sent updates for \".ico\", \".bmp\" and other\nimprovements. It is interesting to have all those algorithms in the same\nplace so people can reimplement them using other languages, so thanks\nfor all the pull requests (you can see the list of contributions in the\nhistory).\n\n I added support for BMP file types, respecting different types of\n DIB headers. Should work on all current bitmap types, tested for old\n OS/2 and BITMAPCOREHEADER files, too. You might try it and consider\n it for merging if you find it useful. **No longer under 100 LOC\n though, sorry ;)**\n\n\nLicense\n--------\n\nMIT License\n\n\nThanks\n------\n\nThanks everyone who inspired this, contributed with code or sent bug\nreports. You know who you are, THANK YOU!\n\n\n\nHISTORY\n=========", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/opsdroid/image_size", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "opsdroid-get-image-size", "package_url": "https://pypi.org/project/opsdroid-get-image-size/", "platform": "", "project_url": "https://pypi.org/project/opsdroid-get-image-size/", "project_urls": { "Homepage": "https://github.com/opsdroid/image_size" }, "release_url": "https://pypi.org/project/opsdroid-get-image-size/0.2.2/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.2.2" }, "last_serial": 5247112, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "f87aa9723e01bc25e5915e466fe16b82", "sha256": "53b55f122346e959a6ba8316be3606c852e5bbe147d1932b4c42ab8cdf027972" }, "downloads": -1, "filename": "opsdroid_get_image_size-0.2.0.tar.gz", "has_sig": false, "md5_digest": "f87aa9723e01bc25e5915e466fe16b82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6683, "upload_time": "2019-04-02T09:21:06", "url": "https://files.pythonhosted.org/packages/72/9f/664df7464feb2b2ba9a4c31678c2d143b83c6e6d2b4c64b4704acae154f2/opsdroid_get_image_size-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "7adca9940f6ffd0b4a1c79c4a3c15403", "sha256": "97b4aa2db4f4f7fad5920c1c3e96dcecff591d270efd1c3333f814c38bc0f17a" }, "downloads": -1, "filename": "opsdroid_get_image_size-0.2.1.tar.gz", "has_sig": false, "md5_digest": "7adca9940f6ffd0b4a1c79c4a3c15403", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19101, "upload_time": "2019-05-09T10:52:55", "url": "https://files.pythonhosted.org/packages/19/33/3bbce763f59d413561d6c5df579387be4d18511ad06b8771e225ef78736e/opsdroid_get_image_size-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "e5519ba09225478577e7bd181fcb4555", "sha256": "0a9dadbec74267effce8317b151370c7976219c5162d8705c109ecee76179288" }, "downloads": -1, "filename": "opsdroid_get_image_size-0.2.2.tar.gz", "has_sig": false, "md5_digest": "e5519ba09225478577e7bd181fcb4555", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22823, "upload_time": "2019-05-09T12:07:27", "url": "https://files.pythonhosted.org/packages/c5/98/1ac0cb475f90dee4d9c11a2ef3fe715438d569f71dc239ff8431f14f28fd/opsdroid_get_image_size-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e5519ba09225478577e7bd181fcb4555", "sha256": "0a9dadbec74267effce8317b151370c7976219c5162d8705c109ecee76179288" }, "downloads": -1, "filename": "opsdroid_get_image_size-0.2.2.tar.gz", "has_sig": false, "md5_digest": "e5519ba09225478577e7bd181fcb4555", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22823, "upload_time": "2019-05-09T12:07:27", "url": "https://files.pythonhosted.org/packages/c5/98/1ac0cb475f90dee4d9c11a2ef3fe715438d569f71dc239ff8431f14f28fd/opsdroid_get_image_size-0.2.2.tar.gz" } ] }