Closed fishcharlie closed 3 months ago
This might be like six lines of code if the async promises garbage plays nice?
Take the existing ImageGenerator class, rename it, and have it return a buffer, not a file.
Build a wrapper ImageGenerator class that calls the original, evaluates the length of the buffer, determines if it's over 1mb, if so calls jimp to scale at 70% and gets you a new buffer, then whatever the final buffer is gets the same return as what's in place now ... ?
If it's marginal now, a 70% rescale should cut the file size in half and always get you over the finish line. Your dimensions both multiply evenly by .7.
@stucka Great idea. Will try that out.
Looks like this is resolved: https://bsky.app/profile/airportstatusbot.bsky.social/post/3kzuqiwxm5626
d5f54a5
Closing.
Every once in a while an image that is able to be posted on Mastodon fails on Bluesky due to image size limitations.
We should think about how to fix this.