Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2
itext
itext-usefreesoftware.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File itext-usefreesoftware.patch of Package itext
diff -up ./src/com/lowagie/text/pdf/PdfGraphics2D.java.sav ./com/lowagie/text/pdf/PdfGraphics2D.java --- ./src/com/lowagie/text/pdf/PdfGraphics2D.java.sav 2008-01-22 14:05:28.000000000 -0500 +++ ./src/com/lowagie/text/pdf/PdfGraphics2D.java 2008-01-22 14:23:02.000000000 -0500 @@ -100,6 +100,11 @@ import java.util.Set; import java.util.Iterator; import java.awt.font.TextAttribute; +import javax.imageio.*; +import javax.imageio.plugins.jpeg.*; +import javax.imageio.metadata.*; +import javax.imageio.stream.*; + public class PdfGraphics2D extends Graphics2D { private static final int FILL = 1; @@ -1249,10 +1254,15 @@ public class PdfGraphics2D extends Graph g3.dispose(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); - com.sun.image.codec.jpeg.JPEGImageEncoder encoder = com.sun.image.codec.jpeg.JPEGCodec.createJPEGEncoder(baos); - com.sun.image.codec.jpeg.JPEGEncodeParam param = com.sun.image.codec.jpeg.JPEGCodec.getDefaultJPEGEncodeParam(scaled); - param.setQuality(jpegQuality, true); - encoder.encode(scaled, param); + ImageWriter encoder = (ImageWriter)ImageIO.getImageWritersByFormatName("JPEG").next(); + JPEGImageWriteParam param = new JPEGImageWriteParam(null); + + param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); + param.setCompressionQuality(jpegQuality); + + encoder.setOutput(baos); + encoder.write((IIOMetadata) null, new IIOImage(scaled,null,null), param); + scaled.flush(); scaled = null; image = com.lowagie.text.Image.getInstance(baos.toByteArray());
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor