Return-Path: X-Original-To: apmail-poi-dev-archive@www.apache.org Delivered-To: apmail-poi-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ACFD897E8 for ; Tue, 27 Nov 2012 09:31:15 +0000 (UTC) Received: (qmail 81008 invoked by uid 500); 27 Nov 2012 09:31:15 -0000 Delivered-To: apmail-poi-dev-archive@poi.apache.org Received: (qmail 80919 invoked by uid 500); 27 Nov 2012 09:31:14 -0000 Mailing-List: contact dev-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Developers List" Delivered-To: mailing list dev@poi.apache.org Received: (qmail 80871 invoked by uid 99); 27 Nov 2012 09:31:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Nov 2012 09:31:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.115] (HELO eir.zones.apache.org) (140.211.11.115) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Nov 2012 09:31:10 +0000 Received: by eir.zones.apache.org (Postfix, from userid 80) id 8DC0C4FC8; Tue, 27 Nov 2012 09:30:49 +0000 (UTC) From: bugzilla@apache.org To: dev@poi.apache.org Subject: [Bug 54210] New: When saving PPT to PNG, some text is rendered backwards Date: Tue, 27 Nov 2012 09:30:47 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: POI X-Bugzilla-Component: HSLF X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: vincent.kirsch@iriscorporate.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@poi.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform bug_status bug_severity priority component assigned_to reporter classification Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=54210 Bug ID: 54210 Summary: When saving PPT to PNG, some text is rendered backwards Product: POI Version: 3.8 Hardware: PC Status: NEW Severity: critical Priority: P2 Component: HSLF Assignee: dev@poi.apache.org Reporter: vincent.kirsch@iriscorporate.com Classification: Unclassified Created attachment 29643 --> https://issues.apache.org/bugzilla/attachment.cgi?id=29643&action=edit This zip contains the PPT file and the PNG image resulting from the code above When converting the attached PPT file with HSLF, and the code below, some of the text (but not all of it) is rendered as if seen in a mirror (see the PNG file attached). Code snippet: InputStream is = getInputStream(); //A FileInputStream on the ppt file SlideShow ppt = new SlideShow(is); Dimension pgsize = ppt.getPageSize(); double scaleW = (double)TARGET_WIDTH / (double)pgsize.width; double scaleH = (double)TARGET_HEIGHT / (double)pgsize.height; double scale = Math.min(scaleW, scaleH); int width = (int) (pgsize.width * scale); int height = (int) (pgsize.height * scale); Slide[] slide = ppt.getSlides(); for (int i = 0; i < slide.length; i++) { BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = img.createGraphics(); graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON); graphics.setPaint(Color.white); graphics.clearRect(0, 0, width, height); graphics.scale((double)width/pgsize.width, (double)height/pgsize.height); slide[i].draw(graphics); // save the result File image = new File(root, "slide"+Integer.toString(i)+".png"); ImageIO.write(img, "png", image); } -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org For additional commands, e-mail: dev-help@poi.apache.org