diff --git a/src/applications/conpherence/controller/ConpherenceUpdateController.php b/src/applications/conpherence/controller/ConpherenceUpdateController.php index 0f4b6927b9..f57e5bdb32 100644 --- a/src/applications/conpherence/controller/ConpherenceUpdateController.php +++ b/src/applications/conpherence/controller/ConpherenceUpdateController.php @@ -77,7 +77,7 @@ final class ConpherenceUpdateController extends $xactions[] = id(new ConpherenceTransaction()) ->setTransactionType(ConpherenceTransactionType::TYPE_PICTURE) ->setNewValue($orig_file->getPHID()); - // do 2 transformations "crudely" + // do a transformation "crudely" $xformer = new PhabricatorImageTransformer(); $header_file = $xformer->executeConpherenceTransform( $orig_file, @@ -105,7 +105,14 @@ final class ConpherenceUpdateController extends $title = $conpherence->getTitle(); $updated = true; $fancy_ajax_style = false; - } else if ($top !== null || $left !== null) { + } + + // all other metadata updates are continue requests + if (!$request->isContinueRequest()) { + break; + } + + if ($top !== null || $left !== null) { $file = $conpherence->getImage(ConpherenceImageData::SIZE_ORIG); $xformer = new PhabricatorImageTransformer(); $xformed = $xformer->executeConpherenceTransform( @@ -128,7 +135,7 @@ final class ConpherenceUpdateController extends ->setNewValue($title); $updated = true; } - if (!$updated && $request->isContinueRequest()) { + if (!$updated) { $errors[] = pht( 'That was a non-update. Try cancel.'); } diff --git a/src/applications/conpherence/view/ConpherenceFileWidgetView.php b/src/applications/conpherence/view/ConpherenceFileWidgetView.php index 97a6b5d829..6d790ea5e2 100644 --- a/src/applications/conpherence/view/ConpherenceFileWidgetView.php +++ b/src/applications/conpherence/view/ConpherenceFileWidgetView.php @@ -39,7 +39,7 @@ final class ConpherenceFileWidgetView extends AphrontView { ''); $file_view = id(new PhabricatorFileLinkView()) ->setFilePHID($file->getPHID()) - ->setFileName($file->getName()) + ->setFileName(phutil_utf8_shorten($file->getName(), 38)) ->setFileViewable($file->isViewableImage()) ->setFileViewURI($file->getBestURI()) ->setCustomClass('file-title'); diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php index e746fd1a53..dcbb1d6153 100644 --- a/src/applications/files/storage/PhabricatorFile.php +++ b/src/applications/files/storage/PhabricatorFile.php @@ -165,6 +165,7 @@ final class PhabricatorFile extends PhabricatorFileDAO $new_file->setStorageHandle($copy_of_storage_handle); $new_file->setStorageFormat($copy_of_storage_format); $new_file->setMimeType($copy_of_mimeType); + $new_file->copyDimensions($file); $new_file->save(); @@ -636,6 +637,20 @@ final class PhabricatorFile extends PhabricatorFileDAO return $this; } + public function copyDimensions(PhabricatorFile $file) { + $metadata = $file->getMetadata(); + $width = idx($metadata, self::METADATA_IMAGE_WIDTH); + if ($width) { + $this->metadata[self::METADATA_IMAGE_WIDTH] = $width; + } + $height = idx($metadata, self::METADATA_IMAGE_HEIGHT); + if ($height) { + $this->metadata[self::METADATA_IMAGE_HEIGHT] = $height; + } + + return $this; + } + public static function getMetadataName($metadata) { switch ($metadata) { case self::METADATA_IMAGE_WIDTH: diff --git a/webroot/rsrc/css/application/conpherence/widget-pane.css b/webroot/rsrc/css/application/conpherence/widget-pane.css index 97a6b19e58..f793eca9b7 100644 --- a/webroot/rsrc/css/application/conpherence/widget-pane.css +++ b/webroot/rsrc/css/application/conpherence/widget-pane.css @@ -87,6 +87,8 @@ position: relative; top: -4px; left: 20px; + overflow-x: hidden; + width: 270px; font-weight: bold; } .conpherence-widget-pane #widgets-files .file-uploaded-by {