Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4BC2110F6E for ; Sun, 15 Feb 2015 15:15:18 +0000 (UTC) Received: (qmail 37695 invoked by uid 500); 15 Feb 2015 15:15:11 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 37607 invoked by uid 500); 15 Feb 2015 15:15:11 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 37596 invoked by uid 99); 15 Feb 2015 15:15:11 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Feb 2015 15:15:11 +0000 Date: Sun, 15 Feb 2015 15:15:11 +0000 (UTC) From: =?utf-8?Q?Michael_Gro=C3=9F_=28JIRA=29?= To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IMAGING-162) BMP files with negative bitmap height are not supported MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IMAGING-162?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D143= 22019#comment-14322019 ]=20 Michael Gro=C3=9F commented on IMAGING-162: -------------------------------------- [~mgolub] Thank you for the comprehensive information and for the example b= itmap! Especially examples from the wild are very helpful because I can wri= te tests using them.=20 I created http://github.com/mgmechanics/commons-imaging/tree/IMAGING-162 to= propose a patch which fixes this issue. First I am adding a test which rep= roduces the problem. Next I will fix it by throwing an exception if a bitma= p with negative height is provided and leave a TODO comment on place. Then = I will try to read such files without error and change the test accordingly= . > 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 > Fix For: Patch Needed > > Attachments: monochrome-negative-height.bmp > > > The BMP format allows for negative values of the height field in the head= er. This means that the image lines are stored top-down, not bottom-up as u= sual (i. e. the first pixel in the pixel array would be in the top left cor= ner of the image, not in the bottom left as usual). However, when a negativ= e-height bitmap is passed, the BmpImageParser attempts to create an array o= f negative length, and a NegativeArraySizeException ensues. -- This message was sent by Atlassian JIRA (v6.3.4#6332)