Changeset View
Changeset View
Standalone View
Standalone View
src/applications/macro/engine/PhabricatorMemeEngine.php
Show First 20 Lines • Show All 176 Lines • ▼ Show 20 Lines | final class PhabricatorMemeEngine extends Phobject { | ||||
private function newAssetData(PhabricatorFile $template) { | private function newAssetData(PhabricatorFile $template) { | ||||
$template_data = $template->loadFileData(); | $template_data = $template->loadFileData(); | ||||
// When we aren't adding text, just return the data unmodified. This saves | // 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 | // us from doing expensive stitching when we aren't actually making any | ||||
// changes to the image. | // changes to the image. | ||||
$above_text = $this->getAboveText(); | $above_text = $this->getAboveText(); | ||||
$below_text = $this->getBelowText(); | $below_text = $this->getBelowText(); | ||||
if (!strlen(trim($above_text)) && !strlen(trim($below_text))) { | if (($above_text === null || !phutil_nonempty_string(trim($above_text))) && | ||||
($below_text === null || !phutil_nonempty_string(trim($below_text)))) { | |||||
return $template_data; | return $template_data; | ||||
valerio.bozzolan: Probably this would allow more memes | |||||
} | } | ||||
$result = $this->newImagemagickAsset($template, $template_data); | $result = $this->newImagemagickAsset($template, $template_data); | ||||
if ($result) { | if ($result) { | ||||
return $result; | return $result; | ||||
} | } | ||||
return $this->newGDAsset($template, $template_data); | return $this->newGDAsset($template, $template_data); | ||||
▲ Show 20 Lines • Show All 208 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
Probably this would allow more memes