You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/08/19 13:43:00 UTC

[jira] [Work logged] (IMAGING-264) BMP Parser physicalWidthDpi and physicalHeightDpi truncated before rounding off.

     [ https://issues.apache.org/jira/browse/IMAGING-264?focusedWorklogId=472438&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-472438 ]

ASF GitHub Bot logged work on IMAGING-264:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 19/Aug/20 13:42
            Start Date: 19/Aug/20 13:42
    Worklog Time Spent: 10m 
      Work Description: kinow opened a new pull request #94:
URL: https://github.com/apache/commons-imaging/pull/94


   Uses `Math.round` as suggested in the JIRA issue. That's the same behaviour as `JpegImageParser`.
   
   Simple unit test added.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 472438)
    Remaining Estimate: 0h
            Time Spent: 10m

> BMP Parser physicalWidthDpi and physicalHeightDpi truncated before rounding off.
> --------------------------------------------------------------------------------
>
>                 Key: IMAGING-264
>                 URL: https://issues.apache.org/jira/browse/IMAGING-264
>             Project: Commons Imaging
>          Issue Type: Bug
>          Components: Format: BMP
>    Affects Versions: 1.0-alpha2
>            Reporter: Ram
>            Assignee: Bruno P. Kinoshita
>            Priority: Minor
>             Fix For: 1.0-alpha3
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> In BMPImageParser class, the values are typecasted to int before rounding off so output varies(other parsers has this logic correct).
> int physicalWidthDpi = (int)((double)bhi.hResolution * 0.0254D);
> int physicalHeightDpi = (int)((double)bhi.vResolution * 0.0254D);
>  
> Expected :
> int physicalWidthDpi = (int)*Math.round*((double)bhi.hResolution * 0.0254D);
> int physicalHeightDpi = (int)*Math.round*((double)bhi.vResolution * 0.0254D);



--
This message was sent by Atlassian Jira
(v8.3.4#803005)