From: Roeland Jago Douma Date: Sat, 2 May 2020 19:57:34 +0000 (+0200) Subject: Fix OC_Image new resize functions X-Git-Tag: v19.0.0beta7~5^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F20787%2Fhead;p=nextcloud-server.git Fix OC_Image new resize functions Else the wrong mimetype might be set. Resulting in continious regeneration of previews when browsing. Signed-off-by: Roeland Jago Douma --- diff --git a/lib/private/legacy/OC_Image.php b/lib/private/legacy/OC_Image.php index 9ef77e3d4c6..4fdbfb3909f 100644 --- a/lib/private/legacy/OC_Image.php +++ b/lib/private/legacy/OC_Image.php @@ -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;