From 4f9e5323ed4f9b7dff1eb10b5da7b872413fbaf1 Mon Sep 17 00:00:00 2001 From: vrana Date: Mon, 30 Apr 2012 13:28:20 -0700 Subject: [PATCH] Add image size to thumbnails in Remarkup Test Plan: View preview of comment with `{F10662}`. Search for `>getThumb`. Reviewers: epriestley Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2347 --- .../PhabricatorRemarkupRuleEmbedFile.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/infrastructure/markup/remarkup/markuprule/embedobject/PhabricatorRemarkupRuleEmbedFile.php b/src/infrastructure/markup/remarkup/markuprule/embedobject/PhabricatorRemarkupRuleEmbedFile.php index 0b19b25e94..dae861341b 100644 --- a/src/infrastructure/markup/remarkup/markuprule/embedobject/PhabricatorRemarkupRuleEmbedFile.php +++ b/src/infrastructure/markup/remarkup/markuprule/embedobject/PhabricatorRemarkupRuleEmbedFile.php @@ -68,24 +68,25 @@ final class PhabricatorRemarkupRuleEmbedFile return $this->getEngine()->storeText($link); } + $attrs = array( + 'class' => 'phabricator-remarkup-embed-image', + ); + switch ($options['size']) { case 'full': - $src_uri = $file->getBestURI(); + $attrs['src'] = $file->getBestURI(); $link = null; break; case 'thumb': default: - $src_uri = $file->getThumb160x120URI(); + $attrs['src'] = $file->getThumb160x120URI(); + $attrs['width'] = 160; + $attrs['height'] = 120; $link = $file->getBestURI(); break; } - $embed = phutil_render_tag( - 'img', - array( - 'src' => $src_uri, - 'class' => 'phabricator-remarkup-embed-image', - )); + $embed = phutil_render_tag('img', $attrs); if ($link) { $embed = phutil_render_tag(