Changeset 1849

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

Fully working GD driver!

Files:
1 modified

Legend:

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

    r1848 r1849  
    180180                } 
    181181 
     182                // Recalculate the width and height, if they are missing 
     183                empty($properties['width'])  and $properties['width']  = round($width * $properties['height'] / $height); 
     184                empty($properties['height']) and $properties['height'] = round($height * $properties['width'] / $width); 
     185 
    182186                if (empty($properties['height']) OR $properties['master'] === Image::WIDTH) 
    183187                { 
    184                         // Recalculate the height 
     188                        // Recalculate the height based on the width 
    185189                        $properties['height'] = round($height * $properties['width'] / $width); 
    186190                } 
     
    188192                if (empty($properties['width']) OR $properties['master'] === Image::HEIGHT) 
    189193                { 
    190                         // Recalculate the width 
     194                        // Recalculate the width based on the height 
    191195                        $properties['width'] = round($width * $properties['height'] / $height); 
    192196                }