After uploading an image, I needed to adjust its dimensions. The original image was 450x700, while the parent container was 400x400. Using 'object-fit' helped fit the image to its parent container while maintaining its aspect ratio.
However, I realized that I needed to display the image in full and 'object-fit' was not the best solution. Removing 'object-fit' and setting 'width' and 'height' to '100%' made the image fully visible, but the quality decreased.
You can see the difference in the images below:
In the last image, you can view the original dimensions of the image.
UPDATED
Although I can solve the issue with 'object-fit: contain', it doesn't provide the perfect solution for me. The image may not align well with the background color of the container. Is there a better way to address this issue?