claviska / SimpleImage

A PHP class that makes working with images and GD as simple as possible.
MIT License
1.38k stars 382 forks source link

Can't use resize with one null parameter #174

Closed jomofcw closed 7 years ago

jomofcw commented 7 years ago

Hello,

First of all : thanks for your great work :)

I'm using the latest stable version (3.2.1 - get through composer). Following the doc, I've tried to use resize() with one null parameter (to avoid using fitTo(Width|Height)). But it result in the following error (with some echo details "TEST") :

Warning: imagecreatetruecolor() [function.imagecreatetruecolor0]: Invalid image dimensions in /X/vendor/claviska/simpleimage/src/claviska/SimpleImage.php on line 791
[TEST - $width:324 - $height: - $this:claviska\SimpleImage Object
(
    [image:claviska\SimpleImage:private] => Resource id #8
    [mimeType:claviska\SimpleImage:private] => image/jpeg
    [exif:claviska\SimpleImage:private] => Array
        (
            [FileName] => film-reflet-argent-80.jpeg
            [FileDateTime] => 1486398573
            [FileSize] => 90315
            [FileType] => 2
            [MimeType] => image/jpeg
            [SectionsFound] => IFD0, APP12
            [COMPUTED] => Array
                (
                    [html] => width="837" height="478"
                    [Height] => 478
                    [Width] => 837
                    [IsColor] => 1
                    [ByteOrderMotorola] => 0
                )
            [Company] => Ducky
            [Info] => 
        )

)
]

Did I do it wrong ? Or is that an issue? Thanks for your help.

Regards,

jomofcw commented 7 years ago

OK, my bad, seems that 3.2.2 is required, and it isn't live at the moment :/...

claviska commented 7 years ago

Yep, those changes were in master awaiting feedback. Seems fine, so I just pushed 3.3.0.

jomofcw commented 7 years ago

Hello Corry,

OK, thanks, work like a charm :D.