{"id":19082251,"url":"https://github.com/waikato-datamining/python-image-complete","last_synced_at":"2026-02-07T01:30:57.407Z","repository":{"id":57457093,"uuid":"181777040","full_name":"waikato-datamining/python-image-complete","owner":"waikato-datamining","description":"Python 3 library for checking whether an image is complete or not (looking for EOF markers or checking file length).","archived":false,"fork":false,"pushed_at":"2024-12-20T00:50:47.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-07T19:48:45.734Z","etag":null,"topics":["imaging","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waikato-datamining.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-16T22:30:28.000Z","updated_at":"2024-12-20T00:50:51.000Z","dependencies_parsed_at":"2025-01-02T20:28:35.788Z","dependency_job_id":"79a3f7b5-efeb-485f-9498-ca9a95c4cf4c","html_url":"https://github.com/waikato-datamining/python-image-complete","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.1428571428571429,"last_synced_commit":"c6420ecbff91ce1342c1642d273908e0881ab3fd"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/waikato-datamining/python-image-complete","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fpython-image-complete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fpython-image-complete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fpython-image-complete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fpython-image-complete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waikato-datamining","download_url":"https://codeload.github.com/waikato-datamining/python-image-complete/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fpython-image-complete/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29183943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T00:44:15.062Z","status":"ssl_error","status_checked_at":"2026-02-07T00:35:01.758Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["imaging","python3"],"created_at":"2024-11-09T02:42:43.467Z","updated_at":"2026-02-07T01:30:57.388Z","avatar_url":"https://github.com/waikato-datamining.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-image-complete\n\nPython 3 library for checking whether an image is complete or not. \nIt is either looking for EOF markers or checking the length of the file against one stored in the file.\n\nCan also operate on bytes or BytesIO objects. \n\nBy default, the library operates in **strict** mode, i.e., no trailing junk data \nis tolerated. However, by supplying the parameters `strict` and `check_size` this\ncan be turned into **lenient** mode. The parameter `check_size` (i.e., the number of \nbytes to read from the end of the file) is only used for formats gif, jpg, png.\n\n## Installation\n\n```bash\npip install python_image_complete\n```\n\n\n## Supported image formats\n\n* BMP (extension: .bmp)\n* GIF (extension: .gif)\n* JPG (extension: .jpg, .jpeg)\n* PNG (extension: .png)\n* WebP (extension: .webp)\n\n\n## File structures\n\n* BMP (checks file length)\n\n  * https://en.wikipedia.org/wiki/BMP_file_format#File_structure\n\n* GIF (checks EOF marker)\n\n  * https://en.wikipedia.org/wiki/GIF#File_format\n\n* JPG (checks EOF marker)\n\n  * http://en.wikipedia.org/wiki/JPEG#Syntax_and_structure\n\n* PNG (checks EOF marker)\n\n  * https://en.wikipedia.org/wiki/Portable_Network_Graphics#Critical_chunks\n  * http://www.libpng.org/pub/png/spec/1.2/PNG-Structure.html#Chunk-layout\n  * http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html#C.IEND\n\n* WebP (compares data length after RIFF header with file length)\n\n  * https://developers.google.com/speed/webp/docs/riff_container\n\n  \n## Examples\n\n### Auto detection\n\n```python\nfrom image_complete.auto import is_image_complete\n\n# using file names\nprint(is_image_complete(\"/some/where/hello_world.jpg\"))\nprint(is_image_complete(\"/some/where/image.png\"))\n\n# using bytes or BytesIO\nwith open(\"/some/where/image.bmp\", \"rb\") as fp:\n    b = fp.read()\nprint(is_image_complete(b))\n```\n\n\n### JPG specific\n\n```python\nfrom image_complete.jpg import is_jpg_complete, is_jpg\n\nf = \"/some/where/hello_world.jpg\"\nif is_jpg(f):\n    print(is_jpg_complete(f))\nelse:\n    print(\"Not a JPG!\")\n```\n\n\n### Lenient mode (i.e., tolerating trailing junk data)\n\n```python\nfrom image_complete.auto import is_image_complete\n\n# using file names\nprint(is_image_complete(\"/some/where/hello_world.jpg\", strict=False, check_size=100))\nprint(is_image_complete(\"/some/where/image.png\", strict=False, check_size=100))\n\n# using bytes or BytesIO\nwith open(\"/some/where/image.bmp\", \"rb\") as fp:\n    b = fp.read()\nprint(is_image_complete(b, strict=False))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaikato-datamining%2Fpython-image-complete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaikato-datamining%2Fpython-image-complete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaikato-datamining%2Fpython-image-complete/lists"}