Show
Ignore:
Timestamp:
01/28/2008 02:31:27 PM (12 months ago)
Author:
Shadowhand
Message:

Fixes to Image and the GD Driver:

  • Working on recalculating the width/height, but not complete
  • Image now normalizes the quality setting itself, rather than using the driver
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/Image.php

    r1844 r1848  
    128128                        throw new Kohana_Exception('image.invalid_height', $height); 
    129129 
     130                if (empty($width) AND empty($height)) 
     131                        throw new Kohana_Exception('image.invalid_dimensions', __FUNCTION__); 
     132 
    130133                if ($master === NULL) 
    131134                { 
     
    171174                if ( ! $this->valid_size('left', $left)) 
    172175                        throw new Kohana_Exception('image.invalid_left', $left); 
     176 
     177                if (empty($width) AND empty($height)) 
     178                        throw new Kohana_Exception('image.invalid_dimensions', __FUNCTION__); 
    173179 
    174180                $this->actions['crop'] = array 
     
    243249        public function quality($value) 
    244250        { 
    245                 $this->actions['quality'] = $value; 
     251                $this->actions['quality'] = max(1, min($amount, 100)); 
    246252 
    247253                return $this;