FIX: Prevent thumbnail gen if image too large (PR #10247)

It’s possible through an import or other means to have images larger than the current max allowed image size in the db.

If this happens the thumbnail generation job will keep running indefinitely trying to download a new copy of the original but discarding it because it is larger than the max_file_size eventually causing this error

Job exception: undefined method path’ for nil:NilClass`

because the newly downloaded image is now nil.

This fix stops the enqueuing of the GenerateTopicThumbnails job for all images that happen to be larger than the max image size.

GitHub

Looks good to me

should be SiteSetting.max_image_size_kb * 1024 or smth like that - original.filesize is in bytes

ooo yea, I’ll check it out and update it. Thanks!