Twitter prefers a 1:1.9 aspect ratio for attached images. The current code crops the generated logo, whose width and height can vary depending on the wiki title. This leads to inconsistent/suboptimal display in twitter feeds, which will zoom in on the image to fill the content area.
This PR modifies _trimWhitespace() in lib/images.py to do additional processing, creating a 1:1.9 aspect ratio output image based on the cropped TMNT-style logo. It also adds 30 pixels of horizontal margin, yielding final images that look like this:
Twitter prefers a 1:1.9 aspect ratio for attached images. The current code crops the generated logo, whose width and height can vary depending on the wiki title. This leads to inconsistent/suboptimal display in twitter feeds, which will zoom in on the image to fill the content area.
This PR modifies
_trimWhitespace()
inlib/images.py
to do additional processing, creating a 1:1.9 aspect ratio output image based on the cropped TMNT-style logo. It also adds 30 pixels of horizontal margin, yielding final images that look like this: