X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=Images.php;h=bfda2826ca553b7843eda775815488e85a9443ac;hp=fc1294d112ef75ba23dc47beb037b5985bcad898;hb=HEAD;hpb=c65ad9cedbf05a7a1c9fc4f5a1146fe5b8fa1dc3 diff --git a/Images.php b/Images.php index fc1294d1..bcedb003 100644 --- a/Images.php +++ b/Images.php @@ -78,6 +78,8 @@ class Pman_Core_Images extends Pman var $method = 'inline'; var $page = false; var $is_local = false; + var $size; + function get($s, $opts=array()) // determin what to serve!!!! { @@ -85,7 +87,9 @@ class Pman_Core_Images extends Pman //if (!empty($_GET['_post'])) { // return $this->post(); //} - + + + $this->is_local = (!empty($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == 'localhost') ? true : false; $this->as_mimetype = empty($_REQUEST['as']) ? '' : $_REQUEST['as']; @@ -284,6 +288,7 @@ class Pman_Core_Images extends Pman function serve($img) { + $this->sessionState(0); // turn off session... - locking... require_once 'File/Convert.php'; if (!$img->exists()) { @@ -295,6 +300,8 @@ class Pman_Core_Images extends Pman if (empty($this->as_mimetype) || $img->mimetype == 'image/gif') { $this->as_mimetype = $img->mimetype; } + + if (!$this->thumb) { if ($x->mimetype == $this->as_mimetype) { $x->serveOnly($this->method, $img->filename); @@ -326,6 +333,7 @@ class Pman_Core_Images extends Pman if (!file_exists($fn)) { $this->validateSize(); } + if(!empty($this->page) && !is_nan($this->page * 1)){ $x->convert( $this->as_mimetype, $this->size, 0, $this->page); @@ -497,15 +505,15 @@ class Pman_Core_Images extends Pman } $w = is_string($dom) ? false : $dom->getAttribute('width'); - $h = is_string($dom) ? false : $dom->getAttribute('width'); + $h = is_string($dom) ? false : $dom->getAttribute('height'); - if (!is_string($dom) && (!empty($w) || !empty($h)) ) + if (!is_string($dom) && (!empty($w) || !empty($h) ) && is_numeric($w) && is_numeric($h)) { // no support for %... $thumbsize = - (empty($w) ? '0' : $w * 1) . + (empty($w) ? '0' : intval($w) * 1) . 'x' . - (empty($h) ? '0' : $h * 1); + (empty($h) ? '0' : intval($h) * 1); $provider = '/Images/Thumb'; }