Open seano-vs opened 1 day ago
We treat animated GIFs as a special case in the code as libvips
does not support resizing them and they are processed with ffmpeg
instead.
That is probably because the gif is not square (228x286 according to ffmpeg) and our code forces ffmpeg
height and width to be a square of the larger dimension (286x286), resulting in this error:
Invalid too big or non positive size for width '286' or height '286'
I am not sure why this is happening, as our code seems to pick the smallest dimension, so I dont understand why it passes 286
as the height and width to ffmpeg: https://github.com/mastodon/mastodon/blob/main/lib/paperclip/vips_lazy_thumbnail.rb#L54
I am not sure why this is happening, as our code seems to pick the smallest dimension
It picks the smallest between target_width
and target_height
, but in this case, those are not numeric values but iw
and ih
:
https://github.com/mastodon/mastodon/blob/766358e52b86ca0dc6cf9bb091565e97af00b19a/lib/paperclip/vips_lazy_thumbnail.rb#L41-L43
I am slightly confused by this part of the code so I'm not completely sure what we should do here.
Steps to reproduce the problem
Also, side note: if I run this gif through a png converter it uploads just fine
Expected behaviour
the gif can be uploaded
Actual behaviour
user sees a 500
Detailed description
logs:
Mastodon instance
masto.nyc
Mastodon version
v4.3.1
Technical details
Infra: https://github.com/Five-Borough-Fedi-Project/masto.nyc-docean/tree/main