php-image-resize
php-image-resize copied to clipboard
undefined finfo_open()
In my PHP 7+ environments I get undefined finfo_open(). I guess a dll file is missing on my shared host. The function is there to check if the image is valid.
Suggested solution: Simply make a check if the function exists before using it.
For people with the same issue, here is a quickfix, just comment it out (around line 112).
/*$finfo = finfo_open(FILEINFO_MIME_TYPE);
if (strstr(finfo_file($finfo, $filename), 'image') === false) {
throw new ImageResizeException('Unsupported file type');
}*/
If we don't use the finfo extension to detect image type, the possible solutions are as follows:
- Using the
exif_imagetypeto detect image type if theexifextension is loaded. - Using the
fopenandfgetsto get the magic binary to detect the image type.
The second solution I think it's another package because it's huge features.
I think we should use exif_imagetype. It's better solution.
@peter279k can we do something about this?