Unsupported operand types when value is integer

Posted by Adam Tester on Stack Overflow See other posts from Stack Overflow or by Adam Tester
Published on 2012-07-04T15:07:44Z Indexed on 2012/07/04 15:15 UTC
Read the original article Hit count: 512

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about php

Related posts about codeigniter