Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 39512 invoked from network); 18 Jun 2007 15:46:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Jun 2007 15:46:47 -0000 Received: (qmail 13013 invoked by uid 500); 18 Jun 2007 15:46:50 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 12989 invoked by uid 500); 18 Jun 2007 15:46:50 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 12980 invoked by uid 99); 18 Jun 2007 15:46:50 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2007 08:46:50 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2007 08:46:46 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 11E95714062 for ; Mon, 18 Jun 2007 08:46:26 -0700 (PDT) Message-ID: <25852956.1182181586070.JavaMail.jira@brutus> Date: Mon, 18 Jun 2007 08:46:26 -0700 (PDT) From: "Dmitry Irlyanov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Created: (HARMONY-4221) [classlib][awt]BufferedImage.getSubimage method is incorrect MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [classlib][awt]BufferedImage.getSubimage method is incorrect ------------------------------------------------------------ Key: HARMONY-4221 URL: https://issues.apache.org/jira/browse/HARMONY-4221 Project: Harmony Issue Type: Bug Components: Classlib Reporter: Dmitry Irlyanov Priority: Minor according spec, BufferedImage.getSubimage(int x, int y, int w, int h) method takes 2 first ints as a upper-left corner coordinate of subimage. But harmony implementation takes upper-left corner point as (0,0) Look at the following code: import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; import javax.swing.JFrame; import junit.framework.TestCase; public class cropTest extends TestCase { public void testCrop() throws IOException { final BufferedImage image = ImageIO.read(new File(cropTest.class .getResource("test.png").getPath())); JFrame f = new JFrame() { @Override public void paint(Graphics g) { g.drawImage(image.getSubimage(0, 0, 10, 10), 100, 100, 100, 100, null); g.drawImage(image.getSubimage(0, 10, 10, 10), 100, 200, 100, 100, null); g.drawImage(image.getSubimage(0, 20, 10, 10), 100, 300, 100, 100, null); g.drawImage(image.getSubimage(10, 0, 10, 10), 200, 100, 100, 100, null); g.drawImage(image.getSubimage(10, 10, 10, 10), 200, 200, 100, 100, null); g.drawImage(image.getSubimage(10, 20, 10, 10), 200, 300, 100, 100, null); g.drawImage(image.getSubimage(20, 0, 10, 10), 300, 100, 100, 100, null); g.drawImage(image.getSubimage(20, 10, 10, 10), 300, 200, 100, 100, null); g.drawImage(image.getSubimage(20, 20, 10, 10), 300, 300, 100, 100, null); } }; f.setSize(500, 500); f.setVisible(true); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } } the results for RI and harmony represented on attached screenshots -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.