]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix OC_Image new resize functions 20787/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Sat, 2 May 2020 19:57:34 +0000 (21:57 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Sat, 2 May 2020 19:57:34 +0000 (21:57 +0200)
Else the wrong mimetype might be set. Resulting in continious
regeneration of previews when browsing.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
lib/private/legacy/OC_Image.php

index 9ef77e3d4c660fbb74c8da6191561d12775b6c4c..4fdbfb3909f332872088fcfcdfaefa2997361e14 100644 (file)
@@ -1101,6 +1101,9 @@ class OC_Image implements \OCP\IImage {
 
        public function cropCopy(int $x, int $y, int $w, int $h): IImage {
                $image = new OC_Image(null, $this->logger, $this->config);
+               $image->imageType = $this->imageType;
+               $image->mimeType = $this->mimeType;
+               $image->bitDepth = $this->bitDepth;
                $image->resource = $this->cropNew($x, $y, $w, $h);
 
                return $image;
@@ -1108,6 +1111,9 @@ class OC_Image implements \OCP\IImage {
 
        public function preciseResizeCopy(int $width, int $height): IImage {
                $image = new OC_Image(null, $this->logger, $this->config);
+               $image->imageType = $this->imageType;
+               $image->mimeType = $this->mimeType;
+               $image->bitDepth = $this->bitDepth;
                $image->resource = $this->preciseResizeNew($width, $height);
 
                return $image;
@@ -1115,6 +1121,9 @@ class OC_Image implements \OCP\IImage {
 
        public function resizeCopy(int $maxSize): IImage {
                $image = new OC_Image(null, $this->logger, $this->config);
+               $image->imageType = $this->imageType;
+               $image->mimeType = $this->mimeType;
+               $image->bitDepth = $this->bitDepth;
                $image->resource = $this->resizeNew($maxSize);
 
                return $image;