Before this change, any image transform is just orphan as default.
This change introduces a new file API called:
PhabricatorFileTransform#executeTransformExplicit(PhabricatorFile)
This new API creates the transform, plus, it creates a PhabricatorTransformedFile,
so that the transformed file is related to the original one.
In this phase, if the original file is a builtin, we don't persist that relationship,
just like before. Just as additional caution.
This new API executeTransformExplicit() is adopted by well-known calls of executeTransform():
- PhabricatorPeopleProfilePictureController
- ManiphestTaskCoverImageTransaction (D25475) - just a refactor
- PhabricatorProjectEditPictureController
- PhameBlogProfilePictureController
- PhortuneMerchantPictureController
For example, in PhabricatorPeopleProfilePictureController:
Now the original picture is mentioned from the cropped thumbnail.
So, you can now at least "more easily" find the original picture and delete that,
starting from that thumbnail.
Deletion considerations:
Before and after this change, you were able to delete the parent file.
It was just a bit tricky to find it out. For example, from the Manage Profile
you see only the mention to the thumbnail, not the original file.
After this change, the parent file is related to transforms, so the phd
daemon will delete them as well as usual for transforms.
This is just a preliminary improvement on the deletion workflow reported
from T15407. Any other improvement is welcome.
WARNING SPECIFIC TO PROFILE IMAGES DELETION:
It seems profile images are handled differently, maybe for performance reasons.
So, if you delete your profile image, you may see 404 errors in the UX, instead
of seeing a default image. This is true until the user uploads a new profile image.
Ref T15407
Ref T15814