1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

realized should probably wrap this in idx... and i haven't cowboy committed in a bit. :P

This commit is contained in:
Bob Trahan 2013-01-26 19:03:00 -08:00
parent ad29c98610
commit c046aa64c1
2 changed files with 4 additions and 4 deletions

View file

@ -56,11 +56,11 @@ final class PhabricatorRemarkupRuleEmbedFile
$attrs['src'] = $file->getBestURI();
$options['image_class'] = null;
$file_data = $file->getMetadata();
$height = $file_data[PhabricatorFile::METADATA_IMAGE_HEIGHT];
$height = idx($file_data, PhabricatorFile::METADATA_IMAGE_HEIGHT);
if ($height) {
$attrs['height'] = $height;
}
$width = $file_data[PhabricatorFile::METADATA_IMAGE_WIDTH];
$width = idx($file_data, PhabricatorFile::METADATA_IMAGE_WIDTH);
if ($width) {
$attrs['width'] = $width;
}

View file

@ -34,8 +34,8 @@ final class PhabricatorRemarkupRuleImageMacro
if ($file) {
$src_uri = $file->getBestURI();
$file_data = $file->getMetadata();
$height = $file_data[PhabricatorFile::METADATA_IMAGE_HEIGHT];
$width = $file_data[PhabricatorFile::METADATA_IMAGE_WIDTH];
$height = idx($file_data,PhabricatorFile::METADATA_IMAGE_HEIGHT);
$width = idx($file_data, PhabricatorFile::METADATA_IMAGE_WIDTH);
if ($height && $width) {
$style = sprintf(
'height: %dpx; width: %dpx;',