Expose get_tint_colour as a public function
- ID
76e9021- date
2025-12-08 07:15:37+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
281f405- message
Expose `get_tint_colour` as a public function- changed files
3 files, 8 additions, 3 deletions
Changed files
CHANGELOG.md (2043) → CHANGELOG.md (2134)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0c0083b..13bab8d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# CHANGELOG
+## v18 - 2025-12-08
+
+Expose `get_tint_colour()` as a public function from `chives.media`.
+
## v17 - 2025-12-07
Account for [EXIF orientation](https://alexwlchan.net/til/2024/photos-can-have-orientation-in-exif/) when getting the width/height of image entities.
src/chives/__init__.py (391) → src/chives/__init__.py (391)
diff --git a/src/chives/__init__.py b/src/chives/__init__.py
index 40dd9bd..70a31b1 100644
--- a/src/chives/__init__.py
+++ b/src/chives/__init__.py
@@ -11,4 +11,4 @@ I share across multiple sites.
"""
-__version__ = "17"
+__version__ = "18"
src/chives/media.py (10644) → src/chives/media.py (10665)
diff --git a/src/chives/media.py b/src/chives/media.py
index 4b649b9..71551ad 100644
--- a/src/chives/media.py
+++ b/src/chives/media.py
@@ -28,6 +28,7 @@ __all__ = [
"create_image_entity",
"create_video_entity",
"get_media_paths",
+ "get_tint_colour",
"is_av1_video",
"ImageEntity",
"MediaEntity",
@@ -196,7 +197,7 @@ def create_image_entity(
entity: ImageEntity = {
"type": "image",
"path": str(path),
- "tint_colour": _get_tint_colour(path, background=background),
+ "tint_colour": get_tint_colour(path, background=background),
"width": transposed_im.width,
"height": transposed_im.height,
}
@@ -295,7 +296,7 @@ def _has_transparency(im: "PIL.Image.Image") -> bool:
return False
-def _get_tint_colour(path: str | Path, *, background: str) -> str:
+def get_tint_colour(path: str | Path, *, background: str) -> str:
"""
Get the tint colour for an image.
"""