diff --git a/src/applications/macro/engine/PhabricatorMemeEngine.php b/src/applications/macro/engine/PhabricatorMemeEngine.php --- a/src/applications/macro/engine/PhabricatorMemeEngine.php +++ b/src/applications/macro/engine/PhabricatorMemeEngine.php @@ -174,6 +174,15 @@ private function newAssetData(PhabricatorFile $template) { $template_data = $template->loadFileData(); + // When we aren't adding text, just return the data unmodified. This saves + // us from doing expensive stitching when we aren't actually making any + // changes to the image. + $above_text = $this->getAboveText(); + $below_text = $this->getBelowText(); + if (!strlen(trim($above_text)) && !strlen(trim($below_text))) { + return $template_data; + } + $result = $this->newImagemagickAsset($template, $template_data); if ($result) { return $result;