[ 
https://issues.apache.org/jira/browse/FOP-1359?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Glenn Adams updated FOP-1359:
-----------------------------

    Component/s: renderer/tiff

> Problem with tiff gray render
> -----------------------------
>
>                 Key: FOP-1359
>                 URL: https://issues.apache.org/jira/browse/FOP-1359
>             Project: Fop
>          Issue Type: Bug
>          Components: renderer/tiff
>    Affects Versions: 0.93
>         Environment: Operating System: Linux
> Platform: Other
>            Reporter: Vitali
>         Attachments: tiff.patch
>
>
> I wrote some code
>        final TIFFRenderer render = new TIFFRenderer() {
>           protected BufferedImage getBufferedImage(int w, int h) {
>             return new BufferedImage(w, h, BufferedImage.TYPE_BYTE_GRAY);
>           }
>         };
>         render.setUserAgent(userAgent);
>         userAgent.setRendererOverride(render);
> ... and try exception
> javax.xml.transform.TransformerException: java.lang.ClassCastException
>         at
> org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1430)
>         at
> org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:709)
>         at
> org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1284)
>         at
> org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1262)
>         at
> com.academsoft.printing.PrintingProtocol.processOutData(PrintingProtocol.java:206)
>         at
> com.academsoft.printing.PrintingProtocol.processInput(PrintingProtocol.java:173)
>         at com.academsoft.printing.Worker.process(Worker.java:48)
>         at com.academsoft.printing.Worker.run(Worker.java:68)
> Caused by: java.lang.ClassCastException
>         at
> org.apache.fop.render.bitmap.TIFFRenderer$LazyPageImagesIterator.next(TIFFRenderer.java:234)
>         at
> org.apache.fop.render.bitmap.TIFFRenderer.stopRenderer(TIFFRenderer.java:166)
>         at
> org.apache.fop.area.RenderPagesModel.endDocument(RenderPagesModel.java:241)
>         at 
> org.apache.fop.area.AreaTreeHandler.endDocument(AreaTreeHandler.java:426)
>         at org.apache.fop.fo.FOTreeBuilder.endDocument(FOTreeBuilder.java:171)
>         at
> org.apache.xml.serializer.ToXMLSAXHandler.endDocument(ToXMLSAXHandler.java:181)
>         at
> org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1378)
>         ... 7 more
> wrote patch
> diff -rNu fop-0.93/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java
> fop-0.93.orig/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java
> --- fop-0.93/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java   
> 2007-05-08 16:51:02.000000000 +0700
> +++ fop-0.93.orig/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java     
>  
> 2007-01-04 02:44:43.000000000 +0600
> @@ -230,11 +230,10 @@
>                  return pageImage;
>              } else {
>                  //Decorate the image with a packed sample model for encoding 
> by
> the codec
> -              final SampleModel sampleModel = pageImage.getSampleModel();
> -//              SinglePixelPackedSampleModel sppsm;
> -//                sppsm = 
> (SinglePixelPackedSampleModel)pageImage.getSampleModel();
> +                SinglePixelPackedSampleModel sppsm;
> +                sppsm = 
> (SinglePixelPackedSampleModel)pageImage.getSampleModel();
> -                int bands = sampleModel.getNumBands();
> +                int bands = sppsm.getNumBands();
>                  int[] off = new int[bands];
>                  int w = pageImage.getWidth();
>                  int h = pageImage.getHeight();
> and all works.
> ps. 
> Product:      Fop.
>  Component: - no tiff.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to