Active Storage image download is truncated at 5000 kB

Our Rails 7.0.3 app high-res images are scaled down before rendering them for the user (using image_tag blob.representation(resize_to_limit: X)). However in our admin page we also want to be able to view the unscaled original version, so for that specific purpose we render it straight with image_tag my_blob. The problem is that if the image is too big, only the first 4.88 MB (= 5000 kB) are downloaded, no matter how fast the internet connection is (and visually, the jpg image is partly blank at the bottom). NB: The image can be downloaded fine when retrieving it directly from the underlying AWS S3 storage (not using the Rails app).

How to render images >5 MB with Active Storage?

OK there’s apparently a fix merged (not available in 7.0.3).

1 Like