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

Incorrect reading Physical Width/Height Inch from PNG files

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.97, 1.0-alpha1, 1.1, 1.x
    • 1.0-alpha1
    • Format: PNG

    Description

      Width: 3509
      Physical Width Dpi: 300
      Physical Width Inch: 1052697.9
      Height: 2481
      Physical Height Dpi: 300
      Physical Height Inch: 744298.5

      PngImageParser.java (620):
                       PhysicalWidthInch = (float) ((double) Width
      -                        * (double) pngChunkpHYs.PixelsPerUnitXAxis * meters_per_inch);
      +                        / ((double) pngChunkpHYs.PixelsPerUnitXAxis * meters_per_inch));
      PngImageParser.java (625):
                       PhysicalHeightInch = (float) ((double) Height
      -                        * (double) pngChunkpHYs.PixelsPerUnitYAxis * meters_per_inch);
      +                        / ((double) pngChunkpHYs.PixelsPerUnitYAxis * meters_per_inch));
      

      After this patch I got correct values:
      Width: 3509
      Physical Width Dpi: 300
      Physical Width Inch: 11.69667
      Height: 2481
      Physical Height Dpi: 300
      Physical Height Inch: 8.2700024

      Attachments

        Activity

          People

            Unassigned Unassigned
            vvd VVD
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: