Problem
On the project page, the "related projects" thumbnails render at 160×90 (16:9) while Project.cropping is an ImageRatioField locked to 5:3 (PROJECT_THUMBNAIL_SIZE = 500×300). Because the render aspect ratio differs from the crop-box aspect ratio, easy_thumbnails applies a second center-crop on top of the editor's crop box — silently trimming the top/bottom of the chosen crop (same bug class we just fixed for the news detail image).
Source: website/templates/website/project.html:554
{% thumbnail related_project.gallery_image '160x90' box=related_project.cropping crop=True upscale=True %}
Why it matters
The admin crop preview (5:3) is not what ships in this thumbnail — editors can't predict the extra crop. Low severity (small thumbnail), but it's the identical WYSIWYG-breaking defect.
Fix
Render at the crop aspect ratio; only vary pixel size. 160×90 → 160×96 (5:3). No model change, no re-cropping needed.
Guard
website/tests/test_news_crop_aspect.py (added in the news fix, v2.26.1) enforces this invariant for news renders. Consider generalizing it to project renders too when fixing this.
Invariant
Any {% thumbnail X box=Y.cropping ... crop %} must use Y's crop aspect ratio; only the pixel size may vary. Otherwise easy_thumbnails re-crops.
Context: found while fixing the news-image head-clipping bug (branch news-crop-aspect-mismatch, v2.26.1).
Problem
On the project page, the "related projects" thumbnails render at 160×90 (16:9) while
Project.croppingis anImageRatioFieldlocked to 5:3 (PROJECT_THUMBNAIL_SIZE = 500×300). Because the render aspect ratio differs from the crop-box aspect ratio,easy_thumbnailsapplies a second center-crop on top of the editor's crop box — silently trimming the top/bottom of the chosen crop (same bug class we just fixed for the news detail image).Source:
website/templates/website/project.html:554Why it matters
The admin crop preview (5:3) is not what ships in this thumbnail — editors can't predict the extra crop. Low severity (small thumbnail), but it's the identical WYSIWYG-breaking defect.
Fix
Render at the crop aspect ratio; only vary pixel size.
160×90→160×96(5:3). No model change, no re-cropping needed.Guard
website/tests/test_news_crop_aspect.py(added in the news fix, v2.26.1) enforces this invariant for news renders. Consider generalizing it to project renders too when fixing this.Invariant
Any
{% thumbnail X box=Y.cropping ... crop %}must useY's crop aspect ratio; only the pixel size may vary. Otherwise easy_thumbnails re-crops.Context: found while fixing the news-image head-clipping bug (branch
news-crop-aspect-mismatch, v2.26.1).