Closed Shou-nen closed 2 years ago
The class should work on Windows, but it not supported. However, I will gladly accept a patch fixing this issue.
Hmm, maybe just add checking if the folder exists in line 2451?
if ($path) {
->
if ($path && file_exists($path)) {
Yeah, I just stumbled on the same problem running my test suite on Windows... It seems you are trying to load a magic file which is internal in PHP 8.1 Windows and not required. The file_exists($path) should fix it.
Incredible class you did by the way, still useful a decade after.
Hopefully fixed in 5a22579. Does it work with 8.1 on Windows? Would you be kind enough as to provide a log of an upload?
system information
It did fix my issue... I cannot say if the whole class is working as I am only using the resizing and compressing options. Thank you.
It should be fine. The important line is "MIME type detected as image/jpeg; charset=binary by Fileinfo PECL extension" which indicates that on PHP 8.1, even though it cannot find the magic file, it manages to use the built-in one. Thank you!
On my xampp local server when uploading an image:
E_WARNING | line 2452 | finfo_open(U:\extras\magic): Failed to open stream: No such file or directory E_WARNING | line 2452 | finfo_open(U:\extras\magic): Failed to open stream: No such file or directory E_WARNING | line 2452 | finfo_open(): Failed to load magic database at "U:\extras\magic"
The specified folder not exist and I can't see at all any folder named "magic' in my xampp, so the function probably shouldn't try to open it.