Now and then when you work with FPDF you may encounter this error:
“FPDF error: Not a JPEG file”
The confusing point about this error is, that this is also displayed if your file in question has an .jpg/.jpeg ending.
So in case you changed the ending of an .PNG image file to .JPG ,assuming that this makes the image to a JPG-Image – let me tell you: FPDF is smarter
Every image file has a characteristic beginning. The 2nd to 4th character of an PNG is… yes… PNG.
You see it here – this is a file with the extension .jpg opened in the Texteditor Notepad++ :

Obviously FPDF checks for this and throws then an error (if the file extension is not corresponding).
Solution: make sure its really, thru & thru a .jpg
No Comments yet
Be the first to write a comment