public function testCangetResizeDataMax() { $file = file_get_contents(__DIR__ . '/../../_file/gnu.png'); $file_resize = file_get_contents(__DIR__ . '/../../_file/gnu80m80.png'); $resize = new Resize(); $resize->setData($file); $resize->setFormat('png'); $this->assertEquals($resize->getResizeData('80m80'), $file_resize); $this->assertEquals($resize->getFormat(), 'png'); $this->assertEquals($resize->getTypeMine(), 'image/png'); }
/** * Resize document. * * @param number $size * * @return \Dms\Document\Manager */ private function resize() { $resize = new Resize(['allow' => $this->option['size_allowed'], 'active' => $this->option['check_size_allowed']]); $resize->setData($this->getDocument()->getDatas())->setFormat($this->getFormat()); $this->getNewDocument()->setEncoding(Document::TYPE_BINARY_STR); $this->getNewDocument()->setDatas($resize->getResizeData($this->size)); $this->getNewDocument()->setSize($this->size); $this->getNewDocument()->setFormat($resize->getFormat()); $this->getNewDocument()->setPage($this->getPage()); return $this; }