Uploaded image for project: 'Commons Imaging'
  1. Commons Imaging
  2. IMAGING-38

Incorrect PhysicalWidthDpi for JPEG image with resolution specified in dots per millimeter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.97
    • 1.0-alpha1
    • Format: JPEG
    • N/A

    Description

      The value of physical with DPI is incorrect for JPEG images, which express their resolution in dots per millimeter.

      Two images are attached:

      • example_ppi.jpg: Normal image, with resolution specified in dots per inch (72 pixels/in)
      • example_ppmm.jpg: Same image, but with resolution specified in dots per millimeter (2.8 pixels/mm)

      When running the attached code, the output is

      example_ppi.jpg
      getPhysicalWidthDpi: 72
      getPhysicalHeightDpi: 72
      example_ppmm.jpg
      getPhysicalWidthDpi: 11
      getPhysicalHeightDpi: 71
      

      While you'd expect the value 71 for getPhysicalWidthDpi for the second image.

      Attachments

        1. example_ppi.jpg
          81 kB
          Tars Joris
        2. example_ppmm.jpg
          81 kB
          Tars Joris
        3. Main.java
          1 kB
          Tars Joris
        4. jpeg-dpi.patch.txt
          1.0 kB
          Tars Joris

        Activity

          People

            Unassigned Unassigned
            tjoris Tars Joris
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: