/** * Asks core for a preview based on our criteria * * @todo Need to read scaling setting from settings * * @param bool $keepAspect * * @return \OC_Image */ private function getPreviewFromCore($keepAspect) { list($maxX, $maxY) = $this->dims; $this->preview->setMaxX($maxX); $this->preview->setMaxY($maxY); $this->preview->setScalingUp(false); $this->preview->setKeepAspect($keepAspect); //$this->logger->debug("[PreviewService] preview {preview}", ['preview' => $this->preview]); $previewData = $this->preview->getPreview(); return $previewData; }
/** * Asks core for a preview based on our criteria * * @todo Need to read scaling setting from settings * * @param bool $keepAspect * * @return \OC_Image */ private function getPreviewFromCore($keepAspect) { //$this->logger->debug("[PreviewService] Fetching the preview"); list($maxX, $maxY) = $this->dims; $this->preview->setMaxX($maxX); $this->preview->setMaxY($maxY); $this->preview->setScalingUp(false); $this->preview->setKeepAspect($keepAspect); //$this->logger->debug("[PreviewService] preview {preview}", ['preview' => $this->preview]); try { // Can generate encryption Exceptions... $previewData = $this->preview->getPreview(); } catch (\Exception $exception) { return null; } return $previewData; }