소스 검색

Make sure we have a resource before measuring its size

tags/v8.1RC2
Olivier Paroz 9 년 전
부모
커밋
3d0a523217
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5
    1
      lib/private/image.php

+ 5
- 1
lib/private/image.php 파일 보기

@@ -982,10 +982,14 @@ class OC_Image implements \OCP\IImage {
* @return bool
*/
public function scaleDownToFit($maxWidth, $maxHeight) {
if (!$this->valid()) {
$this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
return false;
}
$widthOrig = imageSX($this->resource);
$heightOrig = imageSY($this->resource);

if ($widthOrig > $maxWidth || $heightOrig >$maxHeight) {
if ($widthOrig > $maxWidth || $heightOrig > $maxHeight) {
return $this->fitIn($maxWidth, $maxHeight);
}


Loading…
취소
저장