In my PHP-FPM log file I have lot's of rows like the following
[18-Sep-2016 03:59:06] WARNING: [pool www] child 5425 said into stderr: "Not a JPEG file: starts with 0x47 0x49"
What does it means?
It is a common error. It looks like you are opening a file with imagecreatefromjpeg
, but it is not a jpeg, it is a gif file, take a look at this note concerning starting bytes.
It's most supposely a GIF, as they start with 0x47 0x49
. JPG starts with 0xFF 0xD8 0xFF
. Have a look at https://en.wikipedia.org/wiki/List_of_file_signatures and reconsider your code: do you want to fail it on such cases (filenames alone are never a guarantee for their content), or do you want to react on it by then guessing its format and trying to parse it as such.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With