function processImage() { # """ starting with the original image, start processing each row """ $tier = count($this->_v_scaleInfo) - 1; $row = 0; list($ul_y, $lr_y) = array(0, 0); list($root, $ext) = $this->parseFilename($this->_v_imageFilename); if (!$root) { $root = $this->_v_imageFilename; } $ext = ".jpg"; if ($this->_debug) { print "processImage root={$root} ext={$ext}<br>\n"; } $image = $this->openImage(); while ($row * $this->tileSize < $this->originalHeight) { $ul_y = $row * $this->tileSize; if ($ul_y + $this->tileSize < $this->originalHeight) { $lr_y = $ul_y + $this->tileSize; } else { $lr_y = $this->originalHeight; } # print "line 309 calling crop<br>"; $imageRow = imageCrop($image, 0, $ul_y, $this->originalWidth, $lr_y); # imageRow = image.crop([0, ul_y, $this->originalWidth, lr_y]) $saveFilename = $root . $tier . "-" . $row . $ext; if ($this->_debug) { print "processImage root={$root} tier={$tier} row={$row} saveFilename={$saveFilename}<br>\n"; } touch($saveFilename); # chmod ($saveFilename,$this->_filemode); imagejpeg($imageRow, $saveFilename, 100); # chgrp ($saveFilename,$this->_filegroup); imagedestroy($imageRow); $this->processRowImage($tier, $row); $row++; } imagedestroy($image); }
/** starting with the original image, start processing each row * */ public function processImage() { $tier = count($this->_vScaleInfo) - 1; $row = 0; list($ul_y, $lr_y) = array(0, 0); list($root, $ext) = explode('.', $this->_vImageFilename); if (!$root) { $root = $this->_vImageFilename; } $ext = ".jpg"; $image = $this->_openImage(); while ($row * $this->_tileSize < $this->_originalHeight) { $ul_y = $row * $this->_tileSize; if ($ul_y + $this->_tileSize < $this->_originalHeight) { $lr_y = $ul_y + $this->_tileSize; } else { $lr_y = $this->originalHeight; } $imageRow = imageCrop($image, 0, $ul_y, $this->_originalWidth, $lr_y); $saveFilename = $root . $tier . '-' . $row . $ext; touch($saveFilename); chmod($saveFilename, $this->_filemode); imagejpeg($imageRow, $saveFilename, $this->_qualitySetting); chgrp($saveFilename, $this->_filegroup); imagedestroy($imageRow); $this->processRowImage($tier, $row); $row++; } imagedestroy($image); }