Skip to content

Fix inconsistent image aspect ratio in PictureCard#8

Open
madhvirathor14 wants to merge 1 commit into
wagtail:mainfrom
madhvirathor14:fix-image-aspect-ratio
Open

Fix inconsistent image aspect ratio in PictureCard#8
madhvirathor14 wants to merge 1 commit into
wagtail:mainfrom
madhvirathor14:fix-image-aspect-ratio

Conversation

@madhvirathor14

Copy link
Copy Markdown

Fixes #6

Description

I was going through the bakerydemo-nextjs
project and noticed that images on the
Locations and Gallery pages looked different
from each other. Some images were stretched
and some were cropped unevenly which made
the cards look inconsistent.

I looked into the PictureCard component and
found that there was no object-fit or fixed
aspect ratio applied to the images. So I
added those styles to fix the issue.

Changes Made

  • Added objectFit cover to the Image component
  • Added aspectRatio to the figure based on
    portrait or landscape mode
  • Added overflow hidden to the figure element

Testing

I tested this on both the Locations page and
the Gallery page. The images now look
consistent and the card heights are uniform.

AI usage

None

@madhvirathor14

Copy link
Copy Markdown
Author

Hi! I wanted to share a quick update — I have shifted my GSoC
2026 focus to the "AI-Powered Self-Explaining & Adaptive Learning
Demo Platform for Wagtail CMS" project. This PR was part of my
early contributions to get familiar with the codebase.

I have also submitted my participant profile in wagtail/gsoc
(PR #228) and would really appreciate a review when possible.

Thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent image aspect ratio and cropping across location and gallery pages

1 participant