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

Getting some warnings #14

Open
oscarotero opened this issue Jan 4, 2020 · 4 comments
Open

Getting some warnings #14

oscarotero opened this issue Jan 4, 2020 · 4 comments

Comments

@oscarotero
Copy link

Hi, thanks for this great library.
I'm getting some repetitive errors with some icons. Each time a icon fails, I get the following 5 warnings consecutively:

PHP Warning:  unpack(): Type L: not enough input, need 4, have 3 in .../vendor/lordelph/icofileloader/src/IcoParser.php on line 43
PHP Notice:  Trying to access array offset on value of type bool in .../vendor/lordelph/icofileloader/src/IcoParser.php on line 44
PHP Warning:  unpack(): Type S: not enough input, need 2, have 1 in .../vendor/lordelph/icofileloader/src/IcoParser.php on line 30
PHP Notice:  Trying to access array offset on value of type bool in .../vendor/lordelph/icofileloader/src/IcoParser.php on line 31
PHP Notice:  Trying to access array offset on value of type bool in .../vendor/lordelph/icofileloader/src/IcoParser.php on line 31

Maybe adding some conditions to avoid these errors or silence them with @ and throw an exception would be very helpful.

@lordelph
Copy link
Owner

lordelph commented Jan 5, 2020

Can you send the ico file this happens with?

@oscarotero
Copy link
Author

Not sure, is a cron process that handle hundred of icons. These errors are in the log file. I'm going to investigate.

@oscarotero
Copy link
Author

Ok, seems like some favicons are not ico or png files, but jpg or gif and this library does not handle these formats. I fixed it using this library only for ico files and gd functions for any other format.

@lordelph
Copy link
Owner

lordelph commented Jan 7, 2020

thanks for checking - I'll leave this issue open and either add support for loading jpg/gif or make it throw a more obvious exception

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

2 participants