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

undefined finfo_open() #141

Open
jenstornell opened this issue May 22, 2019 · 3 comments
Open

undefined finfo_open() #141

jenstornell opened this issue May 22, 2019 · 3 comments
Assignees

Comments

@jenstornell
Copy link

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');
}*/
@peter279k
Copy link
Contributor

peter279k commented May 22, 2019

If we don't use the finfo extension to detect image type, the possible solutions are as follows:

  • Using the exif_imagetype to detect image type if the exif extension is loaded.
  • Using the fopen and fgets to get the magic binary to detect the image type.

The second solution I think it's another package because it's huge features.

@adityapatadia
Copy link
Contributor

I think we should use exif_imagetype. It's better solution.

@adityapatadia
Copy link
Contributor

@peter279k can we do something about this?

@peter279k peter279k self-assigned this Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants