[ 
https://issues.apache.org/jira/browse/IMAGING-162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14332214#comment-14332214
 ] 

Myroslav Golub edited comment on IMAGING-162 at 2/22/15 3:22 PM:
-----------------------------------------------------------------

The format specifcation says the following:
http://www.fileformat.info/format/bmp/egff.htm
{quote}
The bottom-up configuration is the most common, because *scan lines stored from 
the top down cannot be compressed.*
{quote}

Microsoft's documentation says:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd183376%28v=vs.85%29.aspx
{quote}
If biHeight is negative, indicating a top-down DIB, biCompression must be 
either BI_RGB or BI_BITFIELDS. *Top-down DIBs cannot be compressed.*
{quote}


was (Author: mgolub):
The format specifcation says the following:
http://www.fileformat.info/format/bmp/egff.htm
{quote}
The bottom-up configuration is the most common, because scan lines stored from 
the top down cannot be compressed. 
{quote}

Microsoft's documentation says:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd183376%28v=vs.85%29.aspx
{quote}
If biHeight is negative, indicating a top-down DIB, biCompression must be 
either BI_RGB or BI_BITFIELDS. Top-down DIBs cannot be compressed.
{quote}

> BMP files with negative bitmap height are not supported
> -------------------------------------------------------
>
>                 Key: IMAGING-162
>                 URL: https://issues.apache.org/jira/browse/IMAGING-162
>             Project: Commons Imaging
>          Issue Type: Bug
>          Components: Format: BMP
>    Affects Versions: 1.0
>            Reporter: Myroslav Golub
>              Labels: github
>             Fix For: Review Patch
>
>         Attachments: monochrome-negative-height.bmp
>
>
> The BMP format allows for negative values of the height field in the header. 
> This means that the image lines are stored top-down, not bottom-up as usual 
> (i. e. the first pixel in the pixel array would be in the top left corner of 
> the image, not in the bottom left as usual). However, when a negative-height 
> bitmap is passed, the BmpImageParser attempts to create an array of negative 
> length, and a NegativeArraySizeException ensues.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to