Skip to content

Commit dc5cfa7

Browse files
committed
Preserve original aspect ratio for uploaded photos
- Removed aspect-square constraint to allow natural image proportions - Changed object-cover to object-contain to show full image without cropping - Added min-h-[150px] and max-h-[300px] for reasonable height bounds - Added flex centering to properly align images within container Photos now display their full content with original aspect ratio while maintaining the responsive card grid layout.
1 parent c197d6d commit dc5cfa7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

client/app/components/PhotoDisplay.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ export function PhotoDisplay({ photoUrl, onClear }: PhotoDisplayProps) {
2727
return (
2828
<>
2929
<div className="w-full max-w-[200px]">
30-
<div className="relative w-full aspect-square bg-gray-100 rounded-lg overflow-hidden">
30+
<div className="relative w-full min-h-[150px] max-h-[300px] bg-gray-100 rounded-lg overflow-hidden flex items-center justify-center">
3131
{!hasError ? (
3232
<Image
3333
src={photoUrl}
3434
alt="Uploaded photo"
3535
fill
3636
sizes="(max-width: 640px) 100vw, (max-width: 768px) 50vw, 33vw"
37-
className={`object-cover transition-opacity duration-200 ${
37+
className={`object-contain transition-opacity duration-200 ${
3838
isLoaded ? "opacity-100" : "opacity-0"
3939
}`}
4040
onLoad={() => setIsLoaded(true)}

0 commit comments

Comments
 (0)