Przeglądaj źródła

Make sure we have a resource before measuring its size

tags/v8.1RC2
Olivier Paroz 9 lat temu
rodzic
commit
3d0a523217
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5
    1
      lib/private/image.php

+ 5
- 1
lib/private/image.php Wyświetl plik

@@ -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);
}


Ładowanie…
Anuluj
Zapisz