Skip to content

Commit

Permalink
Heic & Avif support
Browse files Browse the repository at this point in the history
  • Loading branch information
titusz committed Jan 22, 2024
1 parent a6d630a commit c3a866c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 31 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Changelog

## 0.6.0 - Unreleased
- Add avif and heif image format support
- Add avif and heic image format support
- Update to Exiv2 0.27.7
- Update to Tika 2.9.1
- Add Python 3.12 Support
Expand Down
2 changes: 1 addition & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Changelog

## 0.6.0 - Unreleased
- Add avif and heif image format support
- Add avif and heic image format support
- Update to Exiv2 0.27.7
- Update to Tika 2.9.1
- Add Python 3.12 Support
Expand Down
6 changes: 3 additions & 3 deletions iscc_sdk/mediatype.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from loguru import logger as log
from typing import List, Optional, Union
import mimetypes
import magic
from py_file_type import magic
import iscc_sdk as idk


Expand Down Expand Up @@ -198,7 +198,7 @@ def mediatype_to_mode(mime_type):
"application/vnd.openxmlformats-officedocument.wordprocessingml.document", ".docx"
)
mimetypes.add_type("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", ".xlsx")
mimetypes.add_type("image/heif", ".heif")
mimetypes.add_type("image/heic", ".heic")
mimetypes.add_type("image/avif", ".avif")

SUPPORTED_MEDIATYPES = {
Expand Down Expand Up @@ -246,7 +246,7 @@ def mediatype_to_mode(mime_type):
"image/vnd.adobe.photoshop": {"mode": "image", "ext": "psd"},
"application/postscript": {"mode": "image", "ext": "eps"},
"image/avif": {"mode": "image", "ext": "avif"},
"image/heif": {"mode": "image", "ext": "heif"},
"image/heic": {"mode": "image", "ext": "heic"},
# Audio Formats
"audio/mpeg": {"mode": "audio", "ext": "mp3"},
"audio/wav": {"mode": "audio", "ext": "wav"},
Expand Down
36 changes: 12 additions & 24 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ python = ">=3.9,<4.0"
cython = "*"
iscc-core = "^1.0.7"
iscc-schema = "^0.4.1"
python-magic-bin = { version = "^0.4", markers = "sys_platform == 'win32' or (sys_platform == 'darwin' and platform_machine == 'x86_64')" }
python-magic = { version = "^0.4", markers = "sys_platform == 'linux' or (sys_platform == 'darwin' and platform_machine == 'arm64')" }
py-file-type = "^0.1"
install-jdk = "^0.3"
platformdirs = "*"
jmespath = "^1.0"
Expand Down

0 comments on commit c3a866c

Please sign in to comment.