mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
realized should probably wrap this in idx... and i haven't cowboy committed in a bit. :P
This commit is contained in:
parent
ad29c98610
commit
c046aa64c1
2 changed files with 4 additions and 4 deletions
|
@ -56,11 +56,11 @@ final class PhabricatorRemarkupRuleEmbedFile
|
||||||
$attrs['src'] = $file->getBestURI();
|
$attrs['src'] = $file->getBestURI();
|
||||||
$options['image_class'] = null;
|
$options['image_class'] = null;
|
||||||
$file_data = $file->getMetadata();
|
$file_data = $file->getMetadata();
|
||||||
$height = $file_data[PhabricatorFile::METADATA_IMAGE_HEIGHT];
|
$height = idx($file_data, PhabricatorFile::METADATA_IMAGE_HEIGHT);
|
||||||
if ($height) {
|
if ($height) {
|
||||||
$attrs['height'] = $height;
|
$attrs['height'] = $height;
|
||||||
}
|
}
|
||||||
$width = $file_data[PhabricatorFile::METADATA_IMAGE_WIDTH];
|
$width = idx($file_data, PhabricatorFile::METADATA_IMAGE_WIDTH);
|
||||||
if ($width) {
|
if ($width) {
|
||||||
$attrs['width'] = $width;
|
$attrs['width'] = $width;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,8 @@ final class PhabricatorRemarkupRuleImageMacro
|
||||||
if ($file) {
|
if ($file) {
|
||||||
$src_uri = $file->getBestURI();
|
$src_uri = $file->getBestURI();
|
||||||
$file_data = $file->getMetadata();
|
$file_data = $file->getMetadata();
|
||||||
$height = $file_data[PhabricatorFile::METADATA_IMAGE_HEIGHT];
|
$height = idx($file_data,PhabricatorFile::METADATA_IMAGE_HEIGHT);
|
||||||
$width = $file_data[PhabricatorFile::METADATA_IMAGE_WIDTH];
|
$width = idx($file_data, PhabricatorFile::METADATA_IMAGE_WIDTH);
|
||||||
if ($height && $width) {
|
if ($height && $width) {
|
||||||
$style = sprintf(
|
$style = sprintf(
|
||||||
'height: %dpx; width: %dpx;',
|
'height: %dpx; width: %dpx;',
|
||||||
|
|
Loading…
Reference in a new issue