Oberto / php-image-magician

Image manipulation at it's finest.
http://phpimagemagician.jarrodoberto.com
91 stars 54 forks source link

The library updates needed. #27

Open ivose opened 2 years ago

ivose commented 2 years ago

Maybe you can update your image-resize-magician.php, because it is not compatible to newer php versions like php 8.2 and other php newer versions. It doesn't work, only displays "saveImage: This is not a resource.". Thank you.

2konrad commented 2 years ago

https://php.watch/versions/8.0/gdimage PHP brought a changes the the GD graphic model, which needs to be reflected

Line 2428 needs to say if (!(is_resource($this->imageResized) || ($this->imageResized instanceof \GdImage) )) { .....

Some round() statements are also needed to properly convert from float to int. However those are only optional.

When i have some time i will committ those changes

2konrad commented 2 years ago

Hey, the neccessary change was already implemented and suggested as a pull reuqest (#22). If you take this version, it should work:

https://github.com/naftali100/php-image-magician

The pull request was already sent long time ago - doesnt seem that pull requets get accepted here any more

By the way: an easy fix would be to comment out line 2428

ibragims commented 1 year ago

Update: https://github.com/thanhle7/image_magician-fix-for-php8