14 March, 2022
Song of the Day: In Hell I’ll Be In Good Company - The Dead South
I finally figured out what issue I was encountering with the images page for the site.
As a reminder, the site has it’s images page reconfigured via a python script that I run whenever I add more photos to the site. Up until now, the two columns of images never lined up quite right, ending up being several images longer on one side or the other.
Last time around, I realized that what I was encountering an issue using image libraries to determine the sizes of some images. Occasionally, and seemingly randomly at the time, the height and width would be switched, with no warning at all.
Today, I realized that this happens whenever I add an image I took on my phone in portrait mode. I ended up opening them in an image viewer, rotating, saving, reopening, rotating back, and saving again. After that, the libraries were able to correctly identify the dimensions. Alessandro mentioned that he figures it would have something to do with the metadata for the image from the phone that the filesystem reads to display the image correctly, but that the libraries do not, which leads to their confusion over the actual rotation.