Skip to content

Commit 62dbd15

Browse files
committed
Fix Pillow ANTIALIAS deprecation warning
1 parent 7db3961 commit 62dbd15

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ norecursedirs=venv env .eggs
6363
DJANGO_SETTINGS_MODULE=tests.settings
6464
addopts = --cov=stdimage --nomigrations --tb=short
6565
filterwarnings =
66-
ignore:DeprecationWarning
66+
error
6767

6868
[coverage:run]
6969
source = .

stdimage/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
ImageFileDescriptor,
1212
)
1313
from PIL import Image, ImageFile, ImageOps
14+
from PIL.Image import Resampling
1415

1516
from .validators import MinSizeValidator
1617

@@ -186,7 +187,7 @@ class StdImageField(ImageField):
186187
"width": None,
187188
"height": None,
188189
"crop": False,
189-
"resample": Image.ANTIALIAS,
190+
"resample": Resampling.LANCZOS,
190191
}
191192

192193
def __init__(

tests/test_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22

33
import pytest
4-
from PIL import Image
4+
from PIL.Image import Resampling
55

66
from stdimage.utils import render_variations
77
from tests.models import ManualVariationsModel
@@ -24,7 +24,7 @@ def test_render_variations(self, image_upload_file):
2424
"width": 150,
2525
"height": 150,
2626
"crop": True,
27-
"resample": Image.ANTIALIAS,
27+
"resample": Resampling.LANCZOS,
2828
}
2929
},
3030
)

0 commit comments

Comments
 (0)