You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Yannick Haser (JIRA)" <ji...@apache.org> on 2017/07/04 18:58:00 UTC
[jira] [Comment Edited] (PDFBOX-3854) PDDeviceRGB.toRGBImage does
not return a RGB-Typed-Image
[ https://issues.apache.org/jira/browse/PDFBOX-3854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16074009#comment-16074009 ]
Yannick Haser edited comment on PDFBOX-3854 at 7/4/17 6:57 PM:
---------------------------------------------------------------
sorry for the delay... I've got another PC here and somehow the fontbox in maven got corrupted... and i searched far too long for the issue ....
Times on this PC:
With Flag:
2.0.6: 760ms (+/- 10ms)
2.0.6 with "Quick"-Fix: 610ms (+/- 10ms)
Without Flag:
2.0.6: 770ms (+/- 20ms)
2.0.6 with "Quick"-Fix: 620ms (+/-20ms)
==> Flag did nothing (I'm surprised by that, searching for the issue now.
tested it with VM-Flag and System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider").
was (Author: yaha):
sorry for the delay... I've got another PC here and somehow the fontbox in maven got corrupted... and i searched far too long for the issue ....
Times on this PC:
With Flag:
2.0.6: 760ms (+/- 10ms)
2.0.6 with "Quick"-Fix: 610ms (+/- 10ms)
Without Flag:
2.0.6: 770ms (+/- 20ms)
2.0.6 with "Quick"-Fix: 620ms (+/-20ms)
==> Flag did nothing (I'm surprised by that, searching for the issue now.
tested it with VM-Flag and System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider").
> PDDeviceRGB.toRGBImage does not return a RGB-Typed-Image
> --------------------------------------------------------
>
> Key: PDFBOX-3854
> URL: https://issues.apache.org/jira/browse/PDFBOX-3854
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 2.0.6
> Reporter: Yannick Haser
> Attachments: rgbImageExample0.pdf, Starter.java
>
>
> While converting a PDPage to a BufferedImage (using the PDFRenderer) Images-Resources located in the PDPage gets loaded in a WriteableRaster and a given Colorspace.
> These get converted to a BufferedImage (with PDDeviceRGB.toRGBImage()). But the Type of the returing BufferedImage is with the given Raster and Colorspace always from Type "BufferedImage.TYPE_CUSTOM" instead of the expected "BufferedImage.TYPE_INT_RGB" for example.
> Consequences:
> Image-Processing-Operations with/on BufferedImages with TYPE_CUSTOM are not optimized in Java (slower) and partialy runs through "Synchronized" Blocks.
> ==> Converting different Documents in different Threads are blocking each other.
> "Quick"-Fix for seeing a Performance-Improvement in a Multithreading Environment:
> {code:title=PDDeviceRGB.java|borderStyle=solid}
> @Override
> public BufferedImage toRGBImage(WritableRaster raster) throws IOException {
> init();
> ColorModel colorModel = new ComponentColorModel(awtColorSpace, false, false, Transparency.OPAQUE,
> raster.getDataBuffer().getDataType());
> BufferedImage image = new BufferedImage(colorModel, raster, false, null);
> BufferedImage dest = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB);
> ColorConvertOp op = new ColorConvertOp(dest.getColorModel().getColorSpace(), null);
> return op.filter(image, dest);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org