Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3163

PDImageXObject.createFromFile should relies on header bytes

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • PDModel
    • None

    Description

      PDImageXObject.createFromFile currently relies on file extension to select the correct factory.
      Often, file extension is not set or not correct.
      It should be better to use the first bytes.

      I did something similar here if it can helps: https://github.com/sismics/docs/blob/master/docs-core/src/main/java/com/sismics/util/mime/MimeTypeUtil.java#L26

      Attachments

        1. _PDFBOX_3163_.patch
          14 kB
          Maciej Woźniak

        Issue Links

          Activity

            People

              tilman Tilman Hausherr
              Jendib Benjamin Gamard
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 3h
                  3h
                  Remaining:
                  Remaining Estimate - 3h
                  3h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified