diff --git a/.github/workflows/test_and_coverage.yml b/.github/workflows/test_and_coverage.yml index 9a477727..43ff36fa 100644 --- a/.github/workflows/test_and_coverage.yml +++ b/.github/workflows/test_and_coverage.yml @@ -11,7 +11,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9, "3.10"] steps: - uses: actions/checkout@v2 @@ -32,7 +32,7 @@ jobs: isort . black . - name: Report to coverall # by the package as the action is broken, but won't work on external forks! - if: matrix.python-version == 3.7 + if: matrix.python-version == 3.7 && github.repository == 'jonasundderwolf/django-image-cropping' env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} run: | diff --git a/example/requirements.txt b/example/requirements.txt index b91ae317..86c4f949 100644 --- a/example/requirements.txt +++ b/example/requirements.txt @@ -1,5 +1,5 @@ -e . -easy_thumbnails==2.8.1 +easy_thumbnails==2.8.5 WebTest==3.0.0 django-webtest==1.9.9 coverage==5.5 diff --git a/image_cropping/widgets.py b/image_cropping/widgets.py index cce88f05..98f5b9e5 100644 --- a/image_cropping/widgets.py +++ b/image_cropping/widgets.py @@ -38,8 +38,9 @@ def get_attrs(image, name): try: # open image and rotate according to its exif.orientation width, height = get_backend().get_size(image) - except AttributeError: - # invalid image -> AttributeError + except BaseException: + # invalid image -> AttributeError or DecompressionBombError + logger.warning("Error while getting image size", exc_info=True) width = image.width height = image.height return { diff --git a/tox.ini b/tox.ini index 6708bab7..6220f325 100644 --- a/tox.ini +++ b/tox.ini @@ -5,18 +5,18 @@ [tox] envlist = - py{36,37,38,39}-django22 - py{36,37,38,39}-django30 - py{36,37,38,39}-django31 - py{36,37,38,39}-django32 - py{38,39}-django40 + py{37,38,39}-django22 + py{37,38,39}-django30 + py{37,38,39}-django31 + py{37,38,39,310}-django32 + py{38,39,310}-django40 [gh-actions] python = - 3.6: py36 3.7: py37 3.8: py38 3.9: py39 + 3.10: py310 [testenv] commands =