Open JackIsAlive opened 4 months ago
I want to add that this has been very inconsistent for me. It may be anecdotal but I've had a few times where it seemed like an image SHOULD have been cut off and it wasn't.
This appears to be fixed by changing the ImageFitCover
arguments to ImageFitContains
on my local dev copy.
for _, post := range imagePosts {
if post.ID == postID {
img := record.Image()
img.PostScan()
img.AppendCopy("tiny", 120, 120, images.ImageFitCover, "")
img.AppendCopy("small", 325, 250, images.ImageFitCover, "")
img.AppendCopy("medium", 720, 1440, images.ImageFitContain, "")
img.AppendCopy("large", 1080, 2160, images.ImageFitContain, "")
img.AppendCopy("large", 2160, 4320, images.ImageFitContain, "")
post.Image = img
break
}
}
Link to original image for testing.
I'm not 100% certain how the image scaling is handled at this point, so if anyone is brave enough to make PR, it'd be great to fix this long-standing bug. Otherwise I'll slowly work my way through the code to see if the fix makes sense.
Current State: Images of a small, tall resolution are not displayed correctly. This may simply be due to the small image size, not necessarily the resolution. Embeds of the post link dispaly the full image.
Future State: Images of 'Tall' resolutions, roughly 9:16, are displayed correctly. Consideration needs to be made for obnoxiously tall posts, in such a case it may be beneficial to enforce a max height and allow a user to click into an image to view the full image within another tab.
Justification: Certain posts are cropped on site and when inspecting the image itself resulting in an issue with creating 'tall' contnt.
Acceptance Criteria: