php-imagine / Imagine

PHP Object Oriented image manipulation library
https://imagine.readthedocs.io
Other
4.42k stars 529 forks source link

Length of either side cannot be 0 or negative, current size is 0x0 #120

Closed thomas2411 closed 12 years ago

thomas2411 commented 12 years ago

I am using this bundle with SonataMediaBundle. Unfortunately I get this error:

Length of either side cannot be 0 or negative, current size is 0x0

at Box ->__construct ('0', '0') 
in vendor\imagine\lib\Imagine\Image\Box.php at line 39

I didn't find any GD errors previously in stack trace.

katanacrimson commented 12 years ago

This is not a problem with this library - you're just trying to create an image that violates the constraints of reality. Try making an image of size 1px by 1px or greater. ;)

You either need to file an issue with the maintainers of that bundle itself, or fix your own code. The parameters of Imagine\Image\Box are the box's height and width, as a clue. https://github.com/avalanche123/Imagine/blob/develop/lib/Imagine/Image/Box.php#L36

thomas2411 commented 12 years ago

On localhost I found that there is a problem with loading php_exiff.dll which is caused by having php_mbstring.dll loaded after exif - which depends on mbstring. I've fixed this but still have the same error. So I guess it is connected to my WAMP server configuration or something.

avalanche123 commented 12 years ago

Constructing a 0x0 box will give you this error, should be pretty obvious from stack trace

thomas2411 commented 12 years ago

But I am not constructing this box by hand. Width and height should be read from a file, but they didn't.

avalanche123 commented 12 years ago

I suggest opening an issue with SonataMediaBundle