Skip to content
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

[BUG] Galleries test failure due to thumbnail returning original URL #2065

Open
1 task done
molokov opened this issue Dec 22, 2023 · 3 comments
Open
1 task done

[BUG] Galleries test failure due to thumbnail returning original URL #2065

molokov opened this issue Dec 22, 2023 · 3 comments

Comments

@molokov
Copy link
Contributor

molokov commented Dec 22, 2023

Is there an existing issue for this?

  • I have searched the existing Issues

Current Behavior

The test case test_galleries.py will fail, due to this error:

tests/test_galleries.py:45: in test_thumbnail_generation
    self.assertEqual(os.path.normpath(thumb_image.lstrip("/")), thumb_name)
E   AssertionError: 'image.jpg' != '.thumbnails/image.jpg/image-24x24.jpg'
E   - image.jpg
E   + .thumbnails/image.jpg/image-24x24.jpg

On investigation, this turns out to be in the final step of thumbnail where the image is saved, which gives this exception (when traceback is printed):

Traceback (most recent call last):
  File "/workspace/mezdev/mezzanine/mezzanine/core/templatetags/mezzanine_tags.py", line 451, in thumbnail
    image = ImageOps.fit(image, to_size, Image.ANTIALIAS, 0, to_pos)
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'

The name ANTIALIAS was removed in PIL 10.0.0 and should be replaced with LANCZOS (ref: https://stackoverflow.com/a/76616129/653093 )

Expected Behavior

Test case to pass

Steps To Reproduce

Run the test_galleries.py test case

Environment

- Operating System: Ubuntu 22.04
- Python version: 3.10.12
- Django version: 4.1
- Database engine and version: default used by tox
- Mezzanine version: master

Anything else?

No response

@molokov
Copy link
Contributor Author

molokov commented Dec 22, 2023

I've applied the fix in my fork at molokov@a89ef45

Having trouble opening a PR - but that may be my fault, I've got other commits on my master branch unrelated to this.

@Samet1994
Copy link

[](url

@18ga7JY5DeQrGxms1k6k4Qh2DDX43ntiZU

@Samet1994
Copy link

18ga7JY5DeQrGxms1k6k4Qh2DDX43ntiZU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants