Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B564D200C0E for ; Wed, 1 Feb 2017 12:56:57 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B3C27160B44; Wed, 1 Feb 2017 11:56:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0EC21160B43 for ; Wed, 1 Feb 2017 12:56:56 +0100 (CET) Received: (qmail 361 invoked by uid 500); 1 Feb 2017 11:56:56 -0000 Mailing-List: contact general-help@xmlgraphics.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@xmlgraphics.apache.org Delivered-To: mailing list general@xmlgraphics.apache.org Received: (qmail 350 invoked by uid 99); 1 Feb 2017 11:56:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Feb 2017 11:56:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id B094BC05E9 for ; Wed, 1 Feb 2017 11:56:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.199 X-Spam-Level: X-Spam-Status: No, score=-1.199 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id HDN19fd92A-a for ; Wed, 1 Feb 2017 11:56:54 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 2DFA85F238 for ; Wed, 1 Feb 2017 11:56:54 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id C9DC1E0026 for ; Wed, 1 Feb 2017 11:56:51 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 8859B2528A for ; Wed, 1 Feb 2017 11:56:51 +0000 (UTC) Date: Wed, 1 Feb 2017 11:56:51 +0000 (UTC) From: "simon steiner (JIRA)" To: general@xmlgraphics.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (XGC-106) java.lang.RuntimeException when writing BufferedImage to tiff MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 01 Feb 2017 11:56:57 -0000 [ https://issues.apache.org/jira/browse/XGC-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15848286#comment-15848286 ] simon steiner edited comment on XGC-106 at 2/1/17 11:55 AM: ------------------------------------------------------------ Do you get the error with imageio on the classpath ai-codec-1.1.3.jar jai-core-1.1.3.jar jai_imageio.jar was (Author: ssteiner1): Do you get the error with imageio on the classpath > java.lang.RuntimeException when writing BufferedImage to tiff > ------------------------------------------------------------- > > Key: XGC-106 > URL: https://issues.apache.org/jira/browse/XGC-106 > Project: XMLGraphicsCommons > Issue Type: Bug > Components: image writer > Affects Versions: 2.0.1 > Environment: Ubuntu 64 bits > java version "1.8.0_101" > Java(TM) SE Runtime Environment (build 1.8.0_101-b13) > Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode) > Reporter: Andrea Vacondio > > Using the latest 2.1 I try to run this snipped to write a BufferedImage as a tif > {code} > public void myTest() throws IOException { > BufferedImage img = new BufferedImage(50, 50, BufferedImage.TYPE_INT_RGB); > Graphics2D g2d = img.createGraphics(); > g2d.setBackground(Color.WHITE); > g2d.fillRect(0, 0, 50, 50); > g2d.setColor(new Color(20, 23, 54)); > BasicStroke bs = new BasicStroke(2); > g2d.setStroke(bs); > g2d.drawLine(0, 0, 25, 25); > g2d.drawLine(10, 10, 5, 5); > g2d.dispose(); > TIFFImageWriter writer = new TIFFImageWriter(); > writer.writeImage(img, new ByteArrayOutputStream(), null); > } > {code} > but I get the following > {code} > java.lang.RuntimeException: Int or float buffers require 32-bit data. > at org.apache.xmlgraphics.image.codec.tiff.TIFFImageEncoder.validateImage(TIFFImageEncoder.java:983) > at org.apache.xmlgraphics.image.codec.tiff.TIFFImageEncoder.encode(TIFFImageEncoder.java:198) > at org.apache.xmlgraphics.image.codec.tiff.TIFFImageEncoder.encode(TIFFImageEncoder.java:112) > at org.apache.xmlgraphics.image.writer.internal.TIFFImageWriter.writeImage(TIFFImageWriter.java:55) > {code} > The same code works using TwelveMonkeys -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: general-help@xmlgraphics.apache.org