Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/actions/setup-venv/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ runs:
uses: astral-sh/setup-uv@v4
with:
# Install a specific version of uv.
version: "0.5.8"
version: "0.8.16"
enable-cache: true
cache-dependency-glob: "uv.lock"
cache-dependency-glob: "pyproject.toml"

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"

- name: Install the project
run: uv sync --all-extras --dev
run: uv sync --all-extras --all-groups
shell: bash
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pgbackups
slim.report.*
.infisical.json
backups
uv.lock
#
#
# Byte-compiled / optimized / DLL files
Expand Down
15 changes: 0 additions & 15 deletions docs/cli.md

This file was deleted.

6 changes: 3 additions & 3 deletions examples/compare_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,9 @@ def create_sample_comparison():
"https://wsrv.nl/lichtenstein.jpg",
"https://wsrv.nl/puppy.jpg",
"https://wsrv.nl/transparency_demo.png",
# "https://upload.wikimedia.org/wikipedia/commons/2/2c/Kalahari_lion_%28Panthera_leo%29_male_cub_4_months.jpg",
# "https://raw.githubusercontent.com/cshum/imagor/master/testdata/dancing-banana.gif",
# "https://media.inkscape.org/media/resources/file/Art_Bot.svg",
"https://upload.wikimedia.org/wikipedia/commons/2/2c/Kalahari_lion_%28Panthera_leo%29_male_cub_4_months.jpg",
"https://raw.githubusercontent.com/cshum/imagor/master/testdata/dancing-banana.gif",
"https://media.inkscape.org/media/resources/file/Art_Bot.svg",
]

log.info("Setting up directories...")
Expand Down
10 changes: 4 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ classifiers = [
]

dependencies = [
"click>=8.2.1",
"requests>=2.28.0",
]

[project.scripts]
imgora = "imgora.cli:main"
#[project.scripts]
#imgora = "imgora.cli:main"

[project.urls]
Repository = "https://github.com/burgdev/imgora"
Expand Down Expand Up @@ -65,7 +65,6 @@ test = [
"pytest>=8.3.4",
"pytest-cov>=4.1.0",
"pytest-docker>=1.0.0",
"requests>=2.28.0",
]


Expand All @@ -82,11 +81,10 @@ extend_exclude = ["tasks/__init__.py"]
DEP004 = [
"toml",
"rich",
"icecream",
"invoke",
"environs",
"humanize",
"mkdocs_gen_files",
"jinja2","loguru"
] # only in dev
DEP003 = ["imgora"] # transitive dependencies

Expand Down
2 changes: 2 additions & 0 deletions src/imgora/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
VALIGN, # noqa: F401
BaseImage, # noqa: F401
Filter, # noqa: F401
ImageFormats, # noqa: F401
Operation, # noqa: F401
Signer, # noqa: F401
)
Expand All @@ -40,4 +41,5 @@
"Operation",
"HALIGN",
"VALIGN",
"ImageFormats",
]
6 changes: 4 additions & 2 deletions src/imgora/_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ def color_html_to_rgb(html_color: str) -> tuple[int, int, int]:
hex_color = hex_match.group(1)
if len(hex_color) == 3:
hex_color = "".join(c * 2 for c in hex_color)
return tuple(int(hex_color[i : i + 2], 16) for i in (0, 2, 4))
out = tuple(int(hex_color[i : i + 2], 16) for i in (0, 2, 4))
return (out[0], out[1], out[2])

# Try to match rgb(r, g, b)
rgb_match = re.match(
r"^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$", html_color_stripped
)
if rgb_match:
return tuple(int(x) for x in rgb_match.groups())
out = tuple(int(x) for x in rgb_match.groups())
return (out[0], out[1], out[2])

# Try named colors
named_colors = {
Expand Down
Loading
Loading