Skip to content

Fix Pillow ANTIALIAS deprecation warning #295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2022
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
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ norecursedirs=venv env .eggs
DJANGO_SETTINGS_MODULE=tests.settings
addopts = --cov=stdimage --nomigrations --tb=short
filterwarnings =
ignore:DeprecationWarning
error

[coverage:run]
source = .
Expand Down
3 changes: 2 additions & 1 deletion stdimage/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
ImageFileDescriptor,
)
from PIL import Image, ImageFile, ImageOps
from PIL.Image import Resampling

from .validators import MinSizeValidator

Expand Down Expand Up @@ -186,7 +187,7 @@ class StdImageField(ImageField):
"width": None,
"height": None,
"crop": False,
"resample": Image.ANTIALIAS,
"resample": Resampling.LANCZOS,
}

def __init__(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

import pytest
from PIL import Image
from PIL.Image import Resampling

from stdimage.utils import render_variations
from tests.models import ManualVariationsModel
Expand All @@ -24,7 +24,7 @@ def test_render_variations(self, image_upload_file):
"width": 150,
"height": 150,
"crop": True,
"resample": Image.ANTIALIAS,
"resample": Resampling.LANCZOS,
}
},
)
Expand Down