You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Related-project thumbnail on project page clips the crop (aspect mismatch, 160×90 vs 5:3) #1416
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).
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).
Activity