Skip to content

Commit

Permalink
Add HEIC/HEIF image support
Browse files Browse the repository at this point in the history
- Add support for HEIC/HEIF image thumbnails and previews
- Replace dependency "pillow_avif_plugin" with "pi-heif"
- Remove unused dependencies in ts_cli.py
  • Loading branch information
CyanVoxel committed May 19, 2024
1 parent 18becd6 commit be3992f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
humanfriendly==10.0
opencv_python>=4.8.0.74,<=4.9.0.80
Pillow==10.3.0
pillow_avif_plugin>=1.3.1,<=1.4.3
PySide6>=6.5.1.1,<=6.6.3.1
PySide6_Addons>=6.5.1.1,<=6.6.3.1
PySide6_Essentials>=6.5.1.1,<=6.6.3.1
typing_extensions>=3.10.0.0,<=4.11.0
ujson>=5.8.0,<=5.9.0
rawpy==0.21.0
pi-heif==0.16.0
11 changes: 7 additions & 4 deletions tagstudio/src/cli/ts_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@

import datetime
import math
from multiprocessing import Value

# from multiprocessing import Value
import os
import subprocess

# import subprocess
import sys
import time
from PIL import Image, ImageOps, ImageChops, UnidentifiedImageError
from PIL import Image, ImageChops, UnidentifiedImageError
from PIL.Image import DecompressionBombError
import pillow_avif

# import pillow_avif
from pathlib import Path
import traceback
import cv2
Expand Down
4 changes: 3 additions & 1 deletion tagstudio/src/qt/widgets/thumb_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import cv2
import rawpy
from pillow_heif import register_heif_opener, register_avif_opener

Check failure on line 13 in tagstudio/src/qt/widgets/thumb_renderer.py

View workflow job for this annotation

GitHub Actions / Run MyPy

[mypy] reported by reviewdog 🐶 Cannot find implementation or library stub for module named "pillow_heif" [import-not-found] Raw Output: /home/runner/work/TagStudio/TagStudio/tagstudio/src/qt/widgets/thumb_renderer.py:13:1: error: Cannot find implementation or library stub for module named "pillow_heif" [import-not-found]
from PIL import (
Image,
UnidentifiedImageError,
Expand All @@ -36,8 +37,9 @@
WARNING = "[WARNING]"
INFO = "[INFO]"


logging.basicConfig(format="%(message)s", level=logging.INFO)
register_heif_opener()
register_avif_opener()


class ThumbRenderer(QObject):
Expand Down

0 comments on commit be3992f

Please sign in to comment.