Oberto / php-image-magician

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

PHP 8 compatibility #23

Open wanmad opened 3 years ago

wanmad commented 3 years ago

using php 7.4, code is ok but not ok on php 8.0

$final_image = rand(1000,1000000).$img; $path = "assets/image/staff/".strtolower($final_image); $magicianObj = new imageLib($path); $magicianObj -> resizeImage(64, 64, 'crop'); $newPath = "assets/image/staf/".$id.".jpg"; $magicianObj -> saveImage($newPath,100);

error saveImage: This is not a resource..

2konrad commented 2 years ago

Hey, the neccessary change was already implemented and suggested as a pull reuqest (https://github.com/Oberto/php-image-magician/pull/22). If you take this version, it should work:

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

MB1997 commented 1 year ago

Search for all calls of is_resource() and change them to is_resource($this->imageResized) || $this->imageResized instanceof \GdImage

and it should work fine again.