Page MenuHomePhabricator

Implement new profile transform with amazing "error handling" feature
ClosedPublic

Authored by epriestley on May 12 2015, 5:55 PM.
Tags
None
Referenced Files
F14416750: D12811.diff
Tue, Dec 24, 11:00 PM
Unknown Object (File)
Sun, Dec 8, 4:44 PM
Unknown Object (File)
Thu, Dec 5, 6:11 AM
Unknown Object (File)
Sun, Dec 1, 1:22 AM
Unknown Object (File)
Wed, Nov 27, 9:47 AM
Unknown Object (File)
Wed, Nov 27, 3:41 AM
Unknown Object (File)
Nov 22 2024, 11:06 PM
Unknown Object (File)
Nov 19 2024, 10:33 AM
Subscribers
Tokens
"Doubloon" token, awarded by btrahan.

Details

Summary

Ref T7707. Ref T4406. Ref T2479. This implements the profile-style (fixed width and height) transforms in a modern way.

  • Added a "regnerate" feature to the support UI to make testing easier and surface errors.
  • Laboriously check errors from everything.
  • Fix the profile thumbnailing so it crops properly instead of leaving margins.
  • Also defuses the "gigantic white PNG" attack.

This doesn't handle the imagemagick case (for animated GIFs) yet.

Test Plan
  • Uploaded a variety of wide/narrow/small/large files and converted them into sensible profile pictures.
  • Tried to thumbnail some text files.
  • Set the pixel-size and file-size limits artificially small and hit them.
  • Used "regenerate" a bunch while testing the rest of this stuff.
  • Verified that non-regenerate flows still produce a default/placeholder image.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Implement new profile transform with amazing "error handling" feature.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
btrahan edited edge metadata.
btrahan added inline comments.
src/applications/files/transform/PhabricatorFileImageTransform.php
38

nice

49–50

forgot about the details of this trap stuff. very boss!

This revision is now accepted and ready to land.May 12 2015, 6:32 PM

error handling is a great feature btw

This revision was automatically updated to reflect the committed changes.