Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#224)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.3.3 → v0.3.4](astral-sh/ruff-pre-commit@v0.3.3...v0.3.4)

* fixed ruff's SIM103 warning

Signed-off-by: Alexander Piskun <[email protected]>

---------

Signed-off-by: Alexander Piskun <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alexander Piskun <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and bigcat88 authored Mar 26, 2024
1 parent d4679d6 commit e928d33
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
- id: pyproject-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.3
rev: v0.3.4
hooks:
- id: ruff

Expand Down
4 changes: 1 addition & 3 deletions libheif/linux_build_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ def check_install_nasm(version: str):

def is_musllinux() -> bool:
_ = run("ldd --version".split(), stdout=PIPE, stderr=STDOUT, check=False)
if _.stdout and _.stdout.decode("utf-8").find("musl") != -1:
return True
return False
return bool(_.stdout and _.stdout.decode("utf-8").find("musl") != -1)


def is_library_installed(name: str) -> bool:
Expand Down
15 changes: 1 addition & 14 deletions pillow_heif/as_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,7 @@ def _is_supported_heif(fp) -> bool:
magic = _get_bytes(fp, 12)
if magic[4:8] != b"ftyp":
return False
if magic[8:12] in (
b"heic",
b"heix",
b"heim",
b"heis",
b"hevc",
b"hevx",
b"hevm",
b"hevs",
b"mif1",
b"msf1",
):
return True
return False
return magic[8:12] in (b"heic", b"heix", b"heim", b"heis", b"hevc", b"hevx", b"hevm", b"hevs", b"mif1", b"msf1")


def _save_heif(im, fp, _filename):
Expand Down

0 comments on commit e928d33

Please sign in to comment.