Welcome Guest, Not a member yet? Register   Sign In
Image manipulation class stretching image
#1

[eluser]Wonder Woman[/eluser]
Hi,

I am using the image manipulation class and it all works great, however if the image is smaller than what I specify then the image is stretched to meet what I have put, is there anyway to stop this? Thanks in advance.

Code:
$config['width'] = 450;
$config['height'] = 450;
$config['master_dim'] = 'auto';
#2

[eluser]Cristian Gilè[/eluser]
Hi WW,

don't process the image if its size is smaller than what you have specified.

Code:
if(imagesx($image) >= $config['width'] AND imagesy($image) >= $config['height'])
{
    //process the image
}

Cristian Gilè
#3

[eluser]Wonder Woman[/eluser]
Of course, why didn't I think of that! Ah well, thanks so much.




Theme © iAndrew 2016 - Forum software by © MyBB