Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/transform/PhabricatorFileImageTransform.php
<?php | <?php | ||||
abstract class PhabricatorFileImageTransform extends PhabricatorFileTransform { | abstract class PhabricatorFileImageTransform extends PhabricatorFileTransform { | ||||
private $file; | private $file; | ||||
private $data; | private $data; | ||||
private $image; | private $image; | ||||
private $imageX; | private $imageX; | ||||
private $imageY; | private $imageY; | ||||
/** | |||||
* Get an estimate of the transformed dimensions of a file. | |||||
* | |||||
* @param PhabricatorFile File to transform. | |||||
* @return list<int, int>|null Width and height, if available. | |||||
*/ | |||||
public function getTransformedDimensions(PhabricatorFile $file) { | |||||
return null; | |||||
} | |||||
public function canApplyTransform(PhabricatorFile $file) { | public function canApplyTransform(PhabricatorFile $file) { | ||||
if (!$file->isViewableImage()) { | if (!$file->isViewableImage()) { | ||||
return false; | return false; | ||||
} | } | ||||
if (!$file->isTransformableImage()) { | if (!$file->isTransformableImage()) { | ||||
return false; | return false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 330 Lines • Show Last 20 Lines |