Page MenuHomePhabricator

Improve error and large file handling in thumbnailing
ClosedPublic

Authored by epriestley on Mar 14 2014, 5:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 9, 5:38 PM
Unknown Object (File)
Sat, Apr 6, 8:59 PM
Unknown Object (File)
Sat, Apr 6, 8:59 PM
Unknown Object (File)
Sat, Apr 6, 8:37 PM
Unknown Object (File)
Sat, Apr 6, 8:14 PM
Unknown Object (File)
Sat, Apr 6, 2:47 AM
Unknown Object (File)
Mar 10 2024, 4:07 AM
Unknown Object (File)
Feb 27 2024, 8:40 PM
Subscribers

Details

Reviewers
btrahan
Maniphest Tasks
Restricted Maniphest Task
T4406: Allow for 100x100 images in profile and projects
Commits
Restricted Diffusion Commit
rP6b4887ab224a: Improve error and large file handling in thumbnailing
Summary

Ref T2479, T4406. We should do a better job of (a) handling image processing errors and (b) declining to process large image files.

This fixes the worst of it, which is that users can upload huge GIFs with a large number of frames and hang a convert process for a long time, eating a CPU and a pile of memory.

This code is still pretty iffy and needs some more work. A near-term product goal for it is supporting 100x100 profile images.

Test Plan

Uploaded large and small GIFs, after setting the definition of "enormous" to be pretty small. Saw the small GIFs thumbnail into animated GIFs, and the large ones thumbnail into static images.

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

epriestley retitled this revision from to Improve error and large file handling in thumbnailing.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.

We're still vulnerable to users uploading really huge PNGs, in that we'll spend far more resources processing them than the attacker requires to upload them, but I'd like to update this code more comprehensively before trying to fix that.

btrahan edited edge metadata.
This revision is now accepted and ready to land.Mar 14 2014, 5:54 PM
epriestley updated this revision to Diff 20257.

Closed by commit rP6b4887ab224a (authored by @epriestley).