Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-15103

JPEG dimensions undetectable when JFIF header is missing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.2.1-RC1
    • 3.2.0
    • Posting
    • PHP 7.1, Windows 7x64

      In https://www.phpbb.com/community/viewtopic.php?f=556&t=2407186 I found out the user trying to upload a JPEG with a missing JFIF header. 3.2.0 uses /vendor/marc1706/fast-image-size/lib/Type/TypeJpeg.php, which analyzes the JPEG segments and only gets dimensions from the JFIF header. When nothing is found, there is no fallback to trying PHP's getimagesize(), which would still provide correct dimensions for such a picture.

      I'm flagging this as major bug since this is a downstep, given that many people use Adobe Photoshop and this software in recent versions outputs such non standard compliant files. The files however have EXIF data, and the "fast-image-size" code should be smart enough to look out for dimension info there as well. Not to speak of being able to use getimagesize() as a last resort.

        1. P90505-140230.jpg
          1.88 MB
          Vitaly Filatenko [X]

            Marc Marc
            AmigoJack AmigoJack
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: