Beispiel #1
0
 function SetOrientationDependantWidthHeight()
 {
     $this->DebugMessage('SetOrientationDependantWidthHeight() starting with "' . $this->source_width . '"x"' . $this->source_height . '"', __FILE__, __LINE__);
     if ($this->source_height > $this->source_width) {
         // portrait
         $this->w = phpthumb_functions::OneOfThese($this->wp, $this->w, $this->ws, $this->wl);
         $this->h = phpthumb_functions::OneOfThese($this->hp, $this->h, $this->hs, $this->hl);
     } elseif ($this->source_height < $this->source_width) {
         // landscape
         $this->w = phpthumb_functions::OneOfThese($this->wl, $this->w, $this->ws, $this->wp);
         $this->h = phpthumb_functions::OneOfThese($this->hl, $this->h, $this->hs, $this->hp);
     } else {
         // square
         $this->w = phpthumb_functions::OneOfThese($this->ws, $this->w, $this->wl, $this->wp);
         $this->h = phpthumb_functions::OneOfThese($this->hs, $this->h, $this->hl, $this->hp);
     }
     //$this->w = round($this->w ? $this->w : (($this->h && $this->source_height) ? $this->h * $this->source_width  / $this->source_height : $this->w));
     //$this->h = round($this->h ? $this->h : (($this->w && $this->source_width)  ? $this->w * $this->source_height / $this->source_width  : $this->h));
     $this->DebugMessage('SetOrientationDependantWidthHeight() setting w="' . intval($this->w) . '", h="' . intval($this->h) . '"', __FILE__, __LINE__);
     return true;
 }