JamesHeinrich / phpThumb

phpThumb() - The PHP thumbnail generator
Other
315 stars 97 forks source link

Unable to display image with PHP 8.1. #187

Closed yepkoo closed 2 years ago

yepkoo commented 2 years ago

Hi

Unable to display image with PHP 8.1. There are some deprecated coding changes. Can we expect an update soon?

For now, I have removed the codes that cause the error, but it seems that there will be other problems in the future.

Thank you

sks1024 commented 2 years ago

@yepkoo Can you share the files you have made these changes in so I can use them?

yepkoo commented 2 years ago

You can download the attachment. In PHP 8, if you use php ready functions without querying whether some values are null or not, it gives an error.

thumb.zip

JamesHeinrich commented 2 years ago

You can download the attachment. In PHP 8, if you use php ready functions without querying whether some values are null or not, it gives an error.

@yepkoo Would you mind posting what changes you actually made against the current versions of phpthumb.class.php and phpthumb.functions.php ? A PR would be ideal, a diff would suffice, to make it easy for me to integrate your fixes.

yepkoo commented 2 years ago

@JamesHeinrich I don't remember right now as it's been a long time, but I'll check when I'm available. There weren't many changes, maybe 4 or 6 total. When I ran the original file in debug mode, I applied the correction according to the error line numbers PHP gave me.

yepkoo commented 2 years ago

@JamesHeinrich I found a site called text-compare.com. I think the results are correct. I have attached the changes I made as a picture.

Image 1

001

Image 2

002

Image 3

003

Image 4

004

Image 5

005

Image 6

006

JamesHeinrich commented 2 years ago

Some of those are no longer applicable in the current development version, the others I have changed in https://github.com/JamesHeinrich/phpThumb/commit/76e13e90a70f7762bfebec6cfa8266290542c4fd

eddstep commented 2 years ago

Hi, @JamesHeinrich . I have updated, but still is error with PHP Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/mlibrary.local/frameworks/yii2/vendor/james-heinrich/phpthumb/phpthumb.class.php on line 1472 PHP Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/mlibrary.local/frameworks/yii2/vendor/james-heinrich/phpthumb/phpthumb.class.php on line 1472 PHP Deprecated: is_file(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/mlibrary.local/frameworks/yii2/vendor/james-heinrich/phpthumb/phpthumb.class.php on line 1474 PHP Deprecated: is_file(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/mlibrary.local/frameworks/yii2/vendor/james-heinrich/phpthumb/phpthumb.class.php on line 1474 PHP Deprecated: is_executable(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/mlibrary.local/frameworks/yii2/vendor/james-heinrich/phpthumb/phpthumb.class.php on line 1475 PHP Deprecated: is_executable(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/mlibrary.local/frameworks/yii2/vendor/james-heinrich/phpthumb/phpthumb.class.php on line 1475

JamesHeinrich commented 2 years ago

https://github.com/JamesHeinrich/phpThumb/commit/4d954f469a13ae6d0417f549faadd76a79ee7356 should hopefully fix those, let me know if you find others.

sks1024 commented 2 years ago

I think @yepkoo fixed phpthumb.functions.php as well. With the current version the script doesn't work. With his version it does.

JamesHeinrich commented 2 years ago

Try again with https://github.com/JamesHeinrich/phpThumb/commit/c74b2e38dd04f147f09b176d2666565d59293e30 ?

sks1024 commented 2 years ago

Looks good from here. Working with newest revisions. Thanks,