flourishlib / flourish-classes

The class files for Flourish
http://flourishlib.com
182 stars 78 forks source link

Jpeg headers not recognized by fFile::determineMimeTypeByContents #198

Open ChrissDeGrece opened 10 years ago

ChrissDeGrece commented 10 years ago

I am trying to upload an image using fUpload but it fails because fUpload thinks it's not a JPEG type.

I traced the class and noticed that it calls fFile::determineMimeTypeByContents which reads the file headers. Well I found a jpeg file which has different headers but it is a jpeg image.

996660_571217926260110_1637116378_n

If I open and saveAs this file from MsPaint then it is properly detected.

Here is a screenshot with my hex editor, first XVI window contains the jpg which can't be recognized. The second window is a "Save As" from IrfanView.

jpeg_headers

severak commented 6 years ago

see https://bitbucket.org/severak/kyselo/commits/adb1fca965c07c9d0e4180abb0ca4a5aa21ea1b5 for possible patch