Welcome Guest, Not a member yet? Register   Sign In
Resize to fix width or length
#2

Ended up doing this

PHP Code:
elseif($size[0] > 1063 && $size[1] > 650)
    {
        
$width_diff=(($size[0]*100)/1063);
        
        
$height_diff=(($size[1]*100)/650);
        
        if(
$height_diff<$width_diff)
            {  
                
$config2[‘height’] = 650
                
$width_height_ratio = ($size[1]*100)/$size[0];
                
$config2[‘width’] = round((650*100)/$width_height_ratio);
            }
        else 
            {
                
$config2[‘width’] = 1063;
                
$width_height_ratio = ($size[1]*100)/$size[0];
                
$config2[‘height’] = round((1063*$width_height_ratio)/100);
            }    
    } 
Reply


Messages In This Thread
Resize to fix width or length - by behnampmdg3 - 10-25-2017, 10:38 AM
RE: Resize to fix width or length - by behnampmdg3 - 10-25-2017, 11:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB