Skip to content

Limit the size of SVGs when viewing them as blobs

yorickpeterse-staging requested to merge svg-render-size-limit into master

What does this MR do?

This MR prevents rendering of SVG blobs larger than 2 MB.

Are there points in the code the reviewer needs to double check?

I couldn't figure out how to properly test the view for this as this requires a large SVG (inflating the repository size) or stubbing, the latter doesn't really seem possible using Spinach and all the stuff potentially involved.

Why was this MR needed?

When rendering large SVG blobs (e.g. 20 MB files) a request may time out and consume a lot of memory.

What are the relevant issue numbers?

#1435 (closed)

Screenshots (if relevant)

svg_notice

Does this MR meet the acceptance criteria?

cc @jschatz1 @annabeldunstone (there are some UI changes, see the above screenshot).

Merge request reports