Skip to content

Commit

Permalink
make mypy happy, update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesBuchner committed May 26, 2024
1 parent 3800592 commit 98b1e7d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: echo "DATE=$(date +'%Y%m')" >> $GITHUB_ENV
- name: Conda download cache
id: myconda-download-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /usr/share/miniconda/pkgs/
key: ${{ matrix.python-version }}-conda-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
Expand Down
5 changes: 2 additions & 3 deletions imagehash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

import numpy
from PIL import Image, ImageFilter

try:
ANTIALIAS = Image.Resampling.LANCZOS
except AttributeError:
Expand Down Expand Up @@ -635,7 +636,7 @@ def _find_all_segments(pixels, segment_threshold, min_segment_size):

def crop_resistant_hash(
image, # type: Image.Image
hash_func=None, # type: HashFunc
hash_func=dhash, # type: HashFunc
limit_segments=None, # type: int | None
segment_threshold=128, # type: int
min_segment_size=500, # type: int
Expand All @@ -659,8 +660,6 @@ def crop_resistant_hash(
:param min_segment_size: Minimum number of pixels for a hashable segment
:param segmentation_image_size: Size which the image is resized to before segmentation
"""
if hash_func is None:
hash_func = dhash

orig_image = image.copy()
# Convert to gray scale and resize
Expand Down
3 changes: 2 additions & 1 deletion tests/test_hex_conversions_multihash.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from __future__ import (absolute_import, division, print_function)
from __future__ import absolute_import, division, print_function

import unittest

import imagehash

from .utils import TestImageHash


Expand Down
1 change: 1 addition & 0 deletions tests/test_readme.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

import six


Expand Down

0 comments on commit 98b1e7d

Please sign in to comment.