@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Raise a more tailored exception if transform/thumbnail support is missing for cover images

Summary: If "GD" doesn't support a particular image type, applying a cover image currently goes through but no-ops. Fail it earlier in the process with a more specific error.

Test Plan: Without PNG support locally, dropped a PNG onto a card on a workboard. Got a more useful error.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D20328

+27 -9
+27 -9
src/applications/maniphest/xaction/ManiphestTaskCoverImageTransaction.php
··· 82 82 83 83 if (!$file) { 84 84 $errors[] = $this->newInvalidError( 85 - pht('"%s" is not a valid file PHID.', 86 - $file_phid)); 87 - } else { 88 - if (!$file->isViewableImage()) { 89 - $mime_type = $file->getMimeType(); 90 - $errors[] = $this->newInvalidError( 91 - pht('File mime type of "%s" is not a valid viewable image.', 92 - $mime_type)); 93 - } 85 + pht( 86 + 'File PHID ("%s") is invalid, or you do not have permission '. 87 + 'to view it.', 88 + $file_phid), 89 + $xaction); 90 + continue; 94 91 } 95 92 93 + if (!$file->isViewableImage()) { 94 + $errors[] = $this->newInvalidError( 95 + pht( 96 + 'File ("%s", with MIME type "%s") is not a viewable image file.', 97 + $file_phid, 98 + $file->getMimeType()), 99 + $xaction); 100 + continue; 101 + } 102 + 103 + if (!$file->isTransformableImage()) { 104 + $errors[] = $this->newInvalidError( 105 + pht( 106 + 'File ("%s", with MIME type "%s") can not be transformed into '. 107 + 'a thumbnail. You may be missing support for this file type in '. 108 + 'the "GD" extension.', 109 + $file_phid, 110 + $file->getMimeType()), 111 + $xaction); 112 + continue; 113 + } 96 114 } 97 115 98 116 return $errors;