Investigating "mysql gone-away errors" I saw a huge backtrace (the whole file basically) in the HHVM fatal log of someone trying to parse an 80k line gallery. Probably would be nice to limit that.
Note, img_metadata for paged files is many orders of magnitude bigger than for "normal" files.
This follow-up task from an incident report has not been updated recently. If it is no longer valid, please add a comment explaining why. If it is still valid, please prioritize it appropriately relative to your other work. If you have any questions, feel free to ask me (Greg Grossmeier).