Unsupported operand types when value is integer
- by Adam Tester
I'm getting this error when trying to add 2 to an integer. I am using the Codeigniter framework.
Fatal error: Unsupported operand types in D:\wamp\www\application\libraries\Gen_images.php on line 180
Here is where its called:
// Now process the image
var_dump($this->upload->data('image_width'));
$this->gen_login->resize($file_name, $this->upload->data('image_width'), $this->upload->data('image_height'));
I get the error on line 180 which is:
$config['width'] = $width + 2;
So I thought $width must be an array or string so I wouldn't be able to add to it, but the var dump shows this:
array
'file_name' => string 'genyx_1341414096.jpg' (length=20)
'file_type' => string 'image/jpeg' (length=10)
'file_path' => string 'D:/wamp/www/beer/uploads/' (length=25)
'full_path' => string 'D:/wamp/www/beer/uploads/genyx_1341414096.jpg' (length=45)
'raw_name' => string 'genyx_1341414096' (length=16)
'orig_name' => string 'genyx_1341414096.jpg' (length=20)
'client_name' => string '294207_177080222375077_100002193022560_361510_991268937_s.jpg' (length=61)
'file_ext' => string '.jpg' (length=4)
'file_size' => float 55.85
'is_image' => boolean true
'image_width' => int 720
'image_height' => int 479
'image_type' => string 'jpeg' (length=4)
'image_size_str' => string 'width="720" height="479"' (length=24)
Can anyone help me?