diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 48de6bd..71cbff6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,9 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ] + # Windows build is disabled, doesn't work without PyGObject. See: + # https://pygobject.readthedocs.io/en/latest/getting_started.html#windows-logo-windows + os: [ 'ubuntu-latest', 'macos-latest' ] # , 'windows-latest' ] py: [ '3.8', '3.11' ] # minimal and latest steps: - name: Install Python ${{ matrix.py }} @@ -24,6 +26,17 @@ jobs: with: python-version: ${{ matrix.py }} + - name: Install PyGObject dependencies (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get install libgirepository1.0-dev + + - name: Install PyGObject dependencies (Ubuntu) + if: matrix.os == 'macos-latest' + run: | + brew update + brew install pygobject3 gtk4 + - name: Checkout uses: actions/checkout@v2 diff --git a/hugophotoswipe/photo.py b/hugophotoswipe/photo.py index c0c2f29..db441ae 100644 --- a/hugophotoswipe/photo.py +++ b/hugophotoswipe/photo.py @@ -157,7 +157,9 @@ def create_rescaled(self, mode): ) # resize the image with PIL - nimg = self.original_image.resize((nwidth, nheight), Image.ANTIALIAS) + nimg = self.original_image.resize( + (nwidth, nheight), Image.Resampling.LANCZOS + ) pth = self.large_path if mode == "large" else self.small_path logging.info("[%s] Saving %s image to %s" % (self.name, mode, pth)) @@ -219,7 +221,7 @@ def create_thumb_py(self, mode=None, pth=None): # Do the actual crop nimg = self.original_image.crop(box) nimg.load() - nimg.thumbnail((nwidth, nheight), Image.ANTIALIAS) + nimg.thumbnail((nwidth, nheight), Image.Resampling.LANCZOS) # Create the filename and save the thumbnail logging.info("[%s] Saving SmartCrop.py thumbnail." % self.name)