You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by bu...@apache.org on 2007/09/12 02:47:40 UTC

DO NOT REPLY [Bug 43357] New: - PDFGraphics2D addImage method: image in PDF look as very low resolution image

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43357>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43357

           Summary: PDFGraphics2D addImage method: image in PDF look as very
                    low resolution image
           Product: Fop
           Version: all
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P3
         Component: pdf
        AssignedTo: fop-dev@xmlgraphics.apache.org
        ReportedBy: fabio_sassi@libero.it


[PATCH]

In PDFGraphics2D image are rescaled 2 times in the same way.
First is rescaled by java.awt.Graphics2D and put in BufferedImage 
that will used to write PDF code. Second is rescaled by trasformation 
matrix in PDF code.

This will cause a resulting image that have very low resolution (pixelized). 

Before look at PDFGraphics2D code I try also to change DPI but this has 
not effect. 

Patch File:

Index: PDFGraphics2D.java
===================================================================
--- PDFGraphics2D.java  (revision 574734)
+++ PDFGraphics2D.java  (working copy)
@@ -522,14 +522,15 @@
         if (imageInfo == null) {
             // OK, have to build and add a PDF image
 
-            Dimension size = new Dimension(width, height);
+            Dimension size = new Dimension(img.getWidth(observer), 
+                                       img.getHeight(observer));
             BufferedImage buf = buildBufferedImage(size);
 
             java.awt.Graphics2D g = buf.createGraphics();
             g.setComposite(AlphaComposite.SrcOver);
             g.setBackground(new Color(1, 1, 1, 0));
             g.setPaint(new Color(1, 1, 1, 0));
-            g.fillRect(0, 0, width, height);
+            g.fillRect(0, 0, size.width, size.height);
             g.clip(new Rectangle(0, 0, buf.getWidth(), buf.getHeight()));
             g.setComposite(gc.getComposite());

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

DO NOT REPLY [Bug 43357] - PDFGraphics2D addImage method: image in PDF look as very low resolution image

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43357>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43357


fabio_sassi@libero.it changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

DO NOT REPLY [Bug 43357] - PDFGraphics2D addImage method: image in PDF look as very low resolution image

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43357>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43357


fabio_sassi@libero.it changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

DO NOT REPLY [Bug 43357] - PDFGraphics2D addImage method: image in PDF look as very low resolution image

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43357>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43357





------- Additional Comments From fabio_sassi@libero.it  2007-09-11 17:49 -------
Created an attachment (id=20792)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20792&action=view)
patch file


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.