fix flourish jpeg detection
Closes #523 (closed)
What does this MR do?
there is a bug in flourish, which causes not all images to be recognized leading to people not being able to login anymore https://github.com/flourishlib/flourish-classes/issues/198
bytes 3 and 4 are called the "application marker" APPn [2], where n stands for the least significant bits. In this case APP13, which stands for JPEG-HDR [3], a valid JPEG file.
as a fallback, we rely now on the php internal mime type detection.
- [1] https://gitlab.com/foodsharing-dev/foodsharing/blob/master/src/Lib/Flourish/fImage.php#L403
- [2] https://www.media.mit.edu/pia/Research/deepview/exif.html#ExifMarker
- [3] https://sno.phy.queensu.ca/~phil/exiftool/TagNames/JPEG.html
How confident are you it won't break things if deployed?
it feels do dirty, to change some code in the library...
Links to related issues
https://sentry.io/share/issue/47d28bf3d1eb41ba838cd4d23f6ee335/
Checklist
-
added a test, or explain why one is not needed/possible... -
no unrelated changes -
asked someone for a code review -
joined #foodsharing-beta channel at https://slackin.yunity.org -
added an entry to CHANGELOG.md (description, merge request link, username(s)) -
Once your MR has been merged, you are responsible to update the #foodsharing-beta Slack channel about what has been changed here. They will test your work in different browsers, roles or other settings
Edited by Chris Oelmueller