{"id":21710684,"url":"https://github.com/mbrav/heifmgur","last_synced_at":"2026-05-16T20:34:49.298Z","repository":{"id":149795003,"uuid":"442872469","full_name":"mbrav/heifmgur","owner":"mbrav","description":"Experimental Image upload service API in Django using the HEIF image format","archived":false,"fork":false,"pushed_at":"2022-01-09T16:25:26.000Z","size":155,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-20T17:54:30.941Z","etag":null,"topics":["api","conversion","django","django-rest-framework","heic","heif","python","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbrav.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2021-12-29T19:36:00.000Z","updated_at":"2022-01-21T18:30:03.000Z","dependencies_parsed_at":"2023-06-02T16:15:18.781Z","dependency_job_id":null,"html_url":"https://github.com/mbrav/heifmgur","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mbrav/heifmgur","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrav%2Fheifmgur","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrav%2Fheifmgur/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrav%2Fheifmgur/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrav%2Fheifmgur/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbrav","download_url":"https://codeload.github.com/mbrav/heifmgur/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrav%2Fheifmgur/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33117934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T18:38:32.183Z","status":"ssl_error","status_checked_at":"2026-05-16T18:38:29.903Z","response_time":115,"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":["api","conversion","django","django-rest-framework","heic","heif","python","rest-api"],"created_at":"2024-11-25T23:16:53.073Z","updated_at":"2026-05-16T20:34:49.285Z","avatar_url":"https://github.com/mbrav.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Django and Pytest CI](https://github.com/mbrav/heifmgur/actions/workflows/django.yml/badge.svg)](https://github.com/mbrav/heifmgur/actions/workflows/django.yml)\n[![wakatime](https://wakatime.com/badge/user/54ad05ce-f39b-4fa3-9f2a-6fe4b1c53ba4/project/f52550ff-f468-4b17-834d-fecce184459a.svg)](https://wakatime.com/badge/user/54ad05ce-f39b-4fa3-9f2a-6fe4b1c53ba4/project/f52550ff-f468-4b17-834d-fecce184459a)\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/mbrav/heifmgur\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n        \u003cimg width=\"400\" src=\"media/logo.png\" title=\"heifmgur\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eImage upload service API in Django using High Efficiency Image File Format (HEIF)\u003c/p\u003e\n\n## Motivation\n\nThis project is a continuation of a job interview assignment. The intention was to create an image service REST API out of it, but not just any API, but one that uses more efficient image formats such as HEIF. Unfortunately however, HEIF format is not well supported in open source projects due to its [proprietary licensing](https://github.com/nokiatech/heif/blob/master/LICENSE.TXT) by Nokia. This includes in image libraries like Django and Pillow, which Django relies on for image validation:\n\n-   [ Support for HEIF #2806 ](https://github.com/python-pillow/Pillow/issues/2806)\n\nWhile there are existing python libraries that can decode HEIF files, there are none that **encode** into HEIF. Fortunately, there is an exception by using the Python [Wand library](https://pypi.org/project/Wand/) which is a wrapper for ImageMagick command tool. Although it must be system installed in order for the Python library to work, it does contain contain a HEIF decoder. This is why the project uses Wand and [Pillow-SIMD](https://python-pillow.org/pillow-perf/) to [bounce back files](api/utils/img.py) between them. Although Wand is faster than Pillow, it is slower than the x86 performance-optimized Pillow-SIMD.\n\nDue to lack of HEIF support in Pillow, Django's ImageField does not support the format since it uses Pillow for image validation. As a result, a custom field based on Django's FileField had to be written with image validation using the Wand library, which leverages ImageMgick's usage of [libheif](https://github.com/strukturag/libheif) library.\n\nAlthough writing this project was interesting, I rather wish Nokia Corporation to go bankrupt unless it open sources the HEIC format and allow it to flourish.\n\n## Instructions\n\nBefore proceeding make sure [ImageMagick](https://imagemagick.org/script/download.php) is installed on your system and command `magick identify -list format` includes HEIC and HEIF fomrats.\n\n```\n$ git clone https://github.com/mbrav/heifmgur.git\n$ cd heifmgur\n```\n\nSetup a local python environment:\n\n```\n$ python3 -m venv venv\n$ source venv/bin/activate\n```\n\nInstall dependencies with poetry:\n\n```\n$ poetry install\n```\n\nSetup Django database and migrations:\n\n```\n$ python3 manage.py makemigrations\n$ python3 manage.py migrate\n```\n\nSetup an admin user (not required):\n\n```\n$ python3 manage.py createsuperuser\n```\n\nRun server\n\n```\n$ python3 manage.py runserver\n```\n\nGo to [http://127.0.0.1:8000/](http://127.0.0.1:8000/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrav%2Fheifmgur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbrav%2Fheifmgur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrav%2Fheifmgur/lists"}