Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8 compatibility #23

Open
wanmad opened this issue Dec 9, 2020 · 2 comments
Open

PHP 8 compatibility #23

wanmad opened this issue Dec 9, 2020 · 2 comments

Comments

@wanmad
Copy link

wanmad commented Dec 9, 2020

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..

@wanmad wanmad changed the title PHP 8 compability PHP 8 compatibility Dec 9, 2020
@2konrad
Copy link

2konrad commented May 29, 2022

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

@MB1997
Copy link

MB1997 commented Mar 30, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants