You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "VVD (Created) (JIRA)" <ji...@apache.org> on 2012/03/18 23:00:40 UTC

[jira] [Created] (SANSELAN-69) Incorrect reading Physical Width/Height Inch from PNG files

Incorrect reading Physical Width/Height Inch from PNG files
-----------------------------------------------------------

                 Key: SANSELAN-69
                 URL: https://issues.apache.org/jira/browse/SANSELAN-69
             Project: Commons Sanselan
          Issue Type: Bug
          Components: Format: PNG
    Affects Versions: 0.97, 1.0, 1.1, 1.x
            Reporter: VVD


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

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

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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SANSELAN-69) Incorrect reading Physical Width/Height Inch from PNG files

Posted by "VVD (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANSELAN-69?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

VVD updated SANSELAN-69:
------------------------

    Attachment: sanselan-png-dpi.diff

Fix DPI
                
> Incorrect reading Physical Width/Height Inch from PNG files
> -----------------------------------------------------------
>
>                 Key: SANSELAN-69
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-69
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: PNG
>    Affects Versions: 0.97, 1.0, 1.1, 1.x
>            Reporter: VVD
>              Labels: patch
>         Attachments: sanselan-png-dpi.diff
>
>
> Width: 3509
> Physical Width Dpi: 300
> Physical Width Inch: 1052697.9
> Height: 2481
> Physical Height Dpi: 300
> Physical Height Inch: 744298.5
> {code}
> 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));
> {code}
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SANSELAN-69) Incorrect reading Physical Width/Height Inch from PNG files

Posted by "VVD (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANSELAN-69?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

VVD updated SANSELAN-69:
------------------------

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

{code}
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));
{code}

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

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

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

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

    
> Incorrect reading Physical Width/Height Inch from PNG files
> -----------------------------------------------------------
>
>                 Key: SANSELAN-69
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-69
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: PNG
>    Affects Versions: 0.97, 1.0, 1.1, 1.x
>            Reporter: VVD
>              Labels: patch
>
> Width: 3509
> Physical Width Dpi: 300
> Physical Width Inch: 1052697.9
> Height: 2481
> Physical Height Dpi: 300
> Physical Height Inch: 744298.5
> {code}
> 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));
> {code}
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SANSELAN-69) Incorrect reading Physical Width/Height Inch from PNG files

Posted by "Damjan Jovanovic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANSELAN-69?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13246016#comment-13246016 ] 

Damjan Jovanovic commented on SANSELAN-69:
------------------------------------------

Please attach the patch as a separate file, and tick the "Grant license to ASF..." checkbox. That's the only way we can accept patches.

                
> Incorrect reading Physical Width/Height Inch from PNG files
> -----------------------------------------------------------
>
>                 Key: SANSELAN-69
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-69
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: PNG
>    Affects Versions: 0.97, 1.0, 1.1, 1.x
>            Reporter: VVD
>              Labels: patch
>
> Width: 3509
> Physical Width Dpi: 300
> Physical Width Inch: 1052697.9
> Height: 2481
> Physical Height Dpi: 300
> Physical Height Inch: 744298.5
> {code}
> 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));
> {code}
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (SANSELAN-69) Incorrect reading Physical Width/Height Inch from PNG files

Posted by "Damjan Jovanovic (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANSELAN-69?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Damjan Jovanovic resolved SANSELAN-69.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0

Applied, resolving fixed. Thank you for your patch!

                
> Incorrect reading Physical Width/Height Inch from PNG files
> -----------------------------------------------------------
>
>                 Key: SANSELAN-69
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-69
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: PNG
>    Affects Versions: 0.97, 1.0, 1.1, 1.x
>            Reporter: VVD
>              Labels: patch
>             Fix For: 1.0
>
>         Attachments: sanselan-png-dpi.diff
>
>
> Width: 3509
> Physical Width Dpi: 300
> Physical Width Inch: 1052697.9
> Height: 2481
> Physical Height Dpi: 300
> Physical Height Inch: 744298.5
> {code}
> 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));
> {code}
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira