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
14 changes: 6 additions & 8 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,11 @@ jobs:
include:
- os: ubuntu-24.04
arch: x86_64
- os: macos-13
arch: x86_64
- os: macos-14
arch: arm64
- os: windows-2019
- os: windows-2022
arch: x86
- os: windows-2019
- os: windows-2022
arch: AMD64
steps:
- name: Checkout
Expand All @@ -85,15 +83,15 @@ jobs:
run: |
perl -i -pe "s/version\s*=\s*\"(.*?)(\.rc.*|\.a.*|\.post.*)?\"/version=\"\1.dev0+${GITHUB_SHA::8}\"/" pyproject.toml
- name: Note version
if: matrix.os != 'windows-2019'
if: matrix.os != 'windows-2022'
shell: bash
run: |
python3 -m venv .yq-venv
. .yq-venv/bin/activate
pip install yq
echo "PACKAGE_VERSION=$(tomlq '.project.version' pyproject.toml -r)" >> $GITHUB_ENV
- name: Note version (Windows)
if: matrix.os == 'windows-2019'
if: matrix.os == 'windows-2022'
run: |
pipx install yq
$env:PACKAGE_VERSION = tomlq.exe '.project.version' pyproject.toml -r
Expand All @@ -110,12 +108,12 @@ jobs:
python-version: "3.12"
- name: Download GNU Tar
uses: suisei-cn/actions-download-file@v1.6.0
if: "matrix.os == 'windows-2019'"
if: "matrix.os == 'windows-2022'"
with:
url: https://skytemple.org/build_deps/tar.exe
target: "C:\\tarout"
- name: Prepend GNU Tar to Path
if: "matrix.os == 'windows-2019'"
if: "matrix.os == 'windows-2022'"
shell: powershell
run:
echo "C:\tarout" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Expand Down
12 changes: 6 additions & 6 deletions tilequant/image_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ def __init__(
:param tile_height: Height of a tile
:param dl_name: Path to the DLL or SO file for Tilequant, if not given, will auto-detect.
"""
assert (
img.width % tile_width == 0
), f"The image width must be divisible by {tile_width}"
assert (
img.height % tile_height == 0
), f"The image height must be divisible by {tile_height}"
assert img.width % tile_width == 0, (
f"The image width must be divisible by {tile_width}"
)
assert img.height % tile_height == 0, (
f"The image height must be divisible by {tile_height}"
)
self._img = img.convert("RGBA").convert("RGBa")
self._transparent_color: tuple[int, int, int, int] | None = None
if transparent_color is not None:
Expand Down
12 changes: 6 additions & 6 deletions tilequant/legacy/image_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ def __init__(
:param transparent_color: A single color value that should be treated as transparent, when doing
the conversion with transparency enabled.
"""
assert (
img.width % tile_width == 0
), f"The image width must be divisible by {tile_width}"
assert (
img.height % tile_height == 0
), f"The image height must be divisible by {tile_height}"
assert img.width % tile_width == 0, (
f"The image width must be divisible by {tile_width}"
)
assert img.height % tile_height == 0, (
f"The image height must be divisible by {tile_height}"
)
self._img = img.convert("RGB")
self._tile_width = tile_width
self._tile_height = tile_height
Expand Down
Loading