4

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?

Andrea
  • 93
  • 2
  • 8

3 Answers3

4

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.

Community
  • 1
  • 1
shukshin.ivan
  • 11,075
  • 4
  • 53
  • 69
  • That list really thinks [Ogg](https://en.wikipedia.org/wiki/Ogg) and [Matroška](https://en.wikipedia.org/wiki/Matroska) are archives instead of multimedia containers. It will also only recognize [RAR](https://en.wikipedia.org/wiki/RAR_(file_format)) 5+ archives, not the older ones. – AmigoJack Feb 22 '23 at 20:50
3

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.

AmigoJack
  • 5,234
  • 1
  • 15
  • 31
1

It seems that you are trying to open a jpeg file which is not actually a jpeg or jpg. the file must be of some other format ( png, tiff, bmp or some other) and have been forced renamed as .jpg or .jpeg.

Mani
  • 5,401
  • 1
  • 30
  • 51