DO NOT REPLY [Bug 49681] Upgrade Exceptions from fop 0.95 to 1.o

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49681

Jeremias Maerki jerem...@apache.org changed:

   What|Removed |Added

 CC||ruud.verd...@pinkroccade.nl

--- Comment #3 from Jeremias Maerki jerem...@apache.org 2010-09-02 02:59:19 
EDT ---
*** Bug 49727 has been marked as a duplicate of this bug. ***

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


DO NOT REPLY [Bug 49727] Upgrade exceptions from fop 0.95 to fop 1.0 (generate tiff output)

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49727

Jeremias Maerki jerem...@apache.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE
 OS/Version||All

--- Comment #1 from Jeremias Maerki jerem...@apache.org 2010-09-02 02:59:18 
EDT ---


*** This bug has been marked as a duplicate of bug 49681 ***

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


DO NOT REPLY [Bug 49681] Upgrade Exceptions from fop 0.95 to 1.o

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49681

Jeremias Maerki jerem...@apache.org changed:

   What|Removed |Added

Version|0.95|1.0

--- Comment #4 from Jeremias Maerki jerem...@apache.org 2010-09-02 03:10:21 
EDT ---
The actual exception:

case DataBuffer.TYPE_INT:
case DataBuffer.TYPE_FLOAT:
if(sampleSize[0] != 32) {
throw new Error(TIFFImageEncoder4);
}

Ugly as hell but this has been so since TIFFImageEncoder has been introduced
into Batik. Anyway, the error probably happens because INT is used as sample
carrier but I assume the sample size is only 24 bits.

One change that happened from 0.95 to 1.0 was the introduction of the new
intermediate format so that TIFF output is now handled by TIFFDocumentHandler
instead of TIFFRenderer by default, but both classes use the same ImageWriter
API from XML Graphics Commons. The default color type (RGBA) has remained the
same. So I'm not sure where this comes from. I'll have to try to reproduce.

A possibility in the meantime is to try different color format settings:
http://xmlgraphics.apache.org/fop/1.0/output.html#bitmap-configuration

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


DO NOT REPLY [Bug 49681] Upgrade Exceptions from fop 0.95 to 1.o

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49681

Jeremias Maerki jerem...@apache.org changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

--- Comment #5 from Jeremias Maerki jerem...@apache.org 2010-09-02 03:21:27 
EDT ---
Ok, on my side, the ImageIO implementation for ImageWriter is used which
doesn't show this problem. If I disable the ImageIO implementation the internal
codec becomes active and fails on the default configuration settings with said
exception. Now, the question is why the ImageIO implementation isn't used.
Maybe it has to do with Bug 49696 but I don't really think so. So my next
question:

What JVM are running this on so you get this result? That might help me figure
out why the internal codecs are selected over the ImageIO implementations.

In this light, another work-around presents itself:
In xmlgraphics-commons.jar you can edit
META-INF/services/org.apache.xmlgraphics.image.writer.ImageWriter
and remove the following entries:
org.apache.xmlgraphics.image.writer.internal.PNGImageWriter
org.apache.xmlgraphics.image.writer.internal.TIFFImageWriter
org.apache.xmlgraphics.image.writer.internal.JPEGImageWriter

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


DO NOT REPLY [Bug 49681] Upgrade Exceptions from fop 0.95 to 1.o

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49681

--- Comment #6 from Jeremias Maerki jerem...@apache.org 2010-09-02 03:36:12 
EDT ---
Should have thought about it earlier. We're talking about TIFF export, so
another work-around: Install JAI ImageIO Tools to give ImageIO a TIFF codec
which it hasn't by default.

http://jai-imageio.dev.java.net/

So, I guess that's an important clue. Could it be that you had JAI ImageIO
Tools installed but didn't add that when upgrading to FOP 1.0? Otherwise, I
still can't explain that the error should have appeared when switching to FOP
1.0.

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


Re: Is org.apache.fop.apps.FopFactory thread safe ?

2010-09-02 Thread Alexios Giotis

Hi Peter,

Thanks for pointing this out. It differs in that the instance of 
FOUserAgent was shared, but other than this, it's exactly the same case. 
Finally, this leads to 
https://issues.apache.org/bugzilla/show_bug.cgi?id=46360


which is still open.

As I read from the thread, this is a complex case and in batik they have 
good reasons not to be thread-safe.


Finally, sorry for my other posting with the same title. I though that 
only the subscribed email address can post.


Alexis



On 1-9-10 11:30 PM, Peter Coppens wrote:

Alexis,

This reminds me of something similar I ran into a while ago. I can't remember 
the details nor how I eventually got around this and/or whether you run into 
the same but the (weird) behavior you describe does look very similar.

See 
http://old.nabble.com/Batik-exception-when-using-fop-with-svg-images-in-threaded-environment-td20809049.html

Perhaps it helps

Peter

On 01 Sep 2010, at 17:53, Alexios Giotis wrote:


Hello,

The javadoc and the class name suggest that FopFactory should be thread-safe 
although this is not explicitly written. If this is not thread-safe then please 
ignore what follows.

I am using FOP 1.0 to produce PDF documents concurrently from FOP intermediate 
format. The PDF documents share a lot of common images, so I decided to use a 
single instance of FopFactory to reduce memory requirements. From the single 
FopFactory, I produce different instances for different threads like this:

FOUserAgent userAgent = fopFactory.newFOUserAgent();
IFDocumentHandler targetHandler = 
fopFactory.getRendererFactory().createDocumentHandler(userAgent,outputFormat);
IFUtil.setupFonts(targetHandler);
targetHandler.setResult(new StreamResult(outStream));
IFConcatenator concatenator = new IFConcatenator(targetHandler, null);
for (int i = 0; i  numberOfDocumentsToConcatenate; i++) {
  Source src = new SAXSource(myOwnApplicationXmlFilters, new 
InputSource(myOwnInputStream));
concatenator.appendDocument(src);
}

The problem is that even on my 2-core laptop, I frequently get exceptions silently written in standard error. Different 
stacktraces are attached and as you can see happen when batik parses the SVG files. For the same input the strings read are 
corrupted. For example the overflow=visible is read as vssible and then later as vissibll. 
Also the fill=#EC2227 is try to parse E7E8 as color.

The workaround for my application is to have a new instance of FopFactory per 
thread but I would like to fix it and create a patch. Since I am quite new to 
FOP, I would like some advise on what should be the proper level. The higher 
one would be the FopFactory (but it's too high and I could do it externally in 
my code), then there is the org.apache.xmlgraphics.image.loader.ImageManager 
and at the end we get to the very low level 
org.apache.batik.css.engine.CSSEngine or org.apache.batik.css.parser.Parser.

Secondly, I think it's not a good practice that the exceptions are written in 
STDERR instead of propagating to the application. What do you think ?



This is my first post to fop-dev and hopefully this is the proper one.

Thanks,
Alexis

stacktraces.txt






DO NOT REPLY [Bug 46360] Thread-safety issue rendering SVG

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46360

--- Comment #6 from Alexis Giotis alex.gio...@gmail.com 2010-09-02 05:01:10 
EDT ---
I can confirm that this issue is valid for FOP 1.0. A workaround is to use a
different instance of FopFactory per thread.

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


Re: TODO tag [was: Re: svn commit: r990148 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop: area/ fo/ fo/flow/ fo/flow/table/ fo/pagination/ fo/properties/ hyphenation/ layoutmgr/ layoutmgr/inline

2010-09-02 Thread Glenn Adams
On Thu, Sep 2, 2010 at 6:04 PM, Jeremias Maerki d...@jeremias-maerki.chwrote:

 I'm not sure we have the tooling to make sure noone
 uses @todo.


Actually, checkstyle 5.1 will report warnings for any use of a non-standard
tag that is not qualified with a dotted prefix. Also the standard Doclet in
recent JDKs will complain as well. So if committers run checkstyle and
javadocs targets before committing, we should be able to keep this usage
out.

On the other hand, it may be possible to fine tune the checkstyle rules and
also the doclet options to permit use of @todo without warnings. I could try
to experiment some to see if that is feasible, then we could return to the
former usage of @todo.

G.


Re: Is org.apache.fop.apps.FopFactory thread safe ?

2010-09-02 Thread Jeremias Maerki
Hi Alexis

Thanks for the patch! I'll look at it shortly. Would you mind attaching
it to the Bugzilla issue? 
https://issues.apache.org/bugzilla/show_bug.cgi?id=46360
That way it's clearer that you donate the changes to the ASF and
everything concerning this problem is in one place. Thanks!

On 02.09.2010 12:52:37 Alexios Giotis wrote:
 Jeremias, thanks for the clarification about the FopFactory.
 
 I had a look at your old commit at
 http://svn.apache.org/viewvc?view=revisionrevision=724163
 
 The current situation in trunk is that in 
 PDFImageHandlerSVG.handleImage() the SVG document is not cloned but in 
 other places it is. Examples of cloning are in ImageConverterSVG2G2D, 
 AbstractGenericSVGHandler, AFPImageHandlerSVG, AFPSVGHandler, 
 Java2DSVGHandler, PSSVGHandler.
 
 This should be the cause of all the stack traces I get. They all go 
 through PDFImageHandlerSVG and after adding the document cloning (see 
 attached patch), I can no longer reproduce the error.
 
 It should be safe to add the SVG document cloning in there but I would 
 better reduce a little of code duplication. In all those places it is 
 required to build a GraphicsNode and the way of doing this is similar. 
 But maybe this is out of scope.
 
 Any suggestion on how to proceed with this ?
 
 
 
 
 On 2-9-10 11:28 AM, Jeremias Maerki wrote:
  Peter could be right. And there I thought I had this under control. But
  with so many open Bugzilla issues, things get lost quickly. I've seen
  multi-threading issues inside Batik myself in a production system and
  haven't been able to put my finger on it since I though I had this fixed,
  but it could be that I haven't really fixed it for all cases. I'll have
  to look into it.
 
  At any rate, FopFactory is supposed to be thread-safe. I always have one
  FopFactory instance per configuration and that is usually one for the
  whole JVM.
 
  On 02.09.2010 10:08:19 Alexios Giotis wrote:
  Hi Peter,
 
  Thanks for pointing this out. It differs in that the instance of
  FOUserAgent was shared, but other than this, it's exactly the same case.
  Finally, this leads to
  https://issues.apache.org/bugzilla/show_bug.cgi?id=46360
 
  which is still open.
 
  As I read from the thread, this is a complex case and in batik they have
  good reasons not to be thread-safe.
 
  Finally, sorry for my other posting with the same title. I though that
  only the subscribed email address can post.
 
  Alexis
 
 
 
  On 1-9-10 11:30 PM, Peter Coppens wrote:
  Alexis,
 
  This reminds me of something similar I ran into a while ago. I can't 
  remember the details nor how I eventually got around this and/or whether 
  you run into the same but the (weird) behavior you describe does look 
  very similar.
 
  See 
  http://old.nabble.com/Batik-exception-when-using-fop-with-svg-images-in-threaded-environment-td20809049.html
 
  Perhaps it helps
 
  Peter
 
  On 01 Sep 2010, at 17:53, Alexios Giotis wrote:
 
  Hello,
 
  The javadoc and the class name suggest that FopFactory should be 
  thread-safe although this is not explicitly written. If this is not 
  thread-safe then please ignore what follows.
 
  I am using FOP 1.0 to produce PDF documents concurrently from FOP 
  intermediate format. The PDF documents share a lot of common images, so 
  I decided to use a single instance of FopFactory to reduce memory 
  requirements. From the single FopFactory, I produce different instances 
  for different threads like this:
 
  FOUserAgent userAgent = fopFactory.newFOUserAgent();
  IFDocumentHandler targetHandler = 
  fopFactory.getRendererFactory().createDocumentHandler(userAgent,outputFormat);
  IFUtil.setupFonts(targetHandler);
  targetHandler.setResult(new StreamResult(outStream));
  IFConcatenator concatenator = new IFConcatenator(targetHandler, null);
  for (int i = 0; i   numberOfDocumentsToConcatenate; i++) {
 Source src = new SAXSource(myOwnApplicationXmlFilters, new 
  InputSource(myOwnInputStream));
  concatenator.appendDocument(src);
  }
 
  The problem is that even on my 2-core laptop, I frequently get 
  exceptions silently written in standard error. Different stacktraces are 
  attached and as you can see happen when batik parses the SVG files. For 
  the same input the strings read are corrupted. For example the 
  overflow=visible is read as vssible and then later as vissibll. 
  Also the fill=#EC2227 is try to parse E7E8 as color.
 
  The workaround for my application is to have a new instance of 
  FopFactory per thread but I would like to fix it and create a patch. 
  Since I am quite new to FOP, I would like some advise on what should be 
  the proper level. The higher one would be the FopFactory (but it's too 
  high and I could do it externally in my code), then there is the 
  org.apache.xmlgraphics.image.loader.ImageManager and at the end we get 
  to the very low level org.apache.batik.css.engine.CSSEngine or 
  org.apache.batik.css.parser.Parser.
 
  Secondly, I think it's not a good 

DO NOT REPLY [Bug 46360] Thread-safety issue rendering SVG

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46360

--- Comment #7 from Alexis Giotis alex.gio...@gmail.com 2010-09-02 07:52:22 
EDT ---
Created an attachment (id=25970)
 -- (https://issues.apache.org/bugzilla/attachment.cgi?id=25970)
Patch to clone the SVG document inside PDFImageHandlerSVG

The patch is attached after a short discussion in the fop-dev mailing list.
Shortly, in PDFImageHandlerSVG.handleImage() the SVG document is not cloned but
in other places it is. Examples of cloning are in ImageConverterSVG2G2D,
AbstractGenericSVGHandler, AFPImageHandlerSVG, AFPSVGHandler, Java2DSVGHandler,
PSSVGHandler.

Before the patch, in a multi-threaded environment parsing of the SVG documents
was corrupted with a probability close to 80%. After this, the errors can not
be reproduced. This patch contains the smallest change I could do, is for a
single file and should be safe to apply.

On a side note, normally I would first try to gather the building of the
GraphicsNode in a single place and then avoid the document cloning by
serializing only the parsing of the SVG. But that would affect more files /
projects and would make the processing of the patch more difficult.

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


Re: TODO tag [was: Re: svn commit: r990148 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop: area/ fo/ fo/flow/ fo/flow/table/ fo/pagination/ fo/properties/ hyphenation/ layoutmgr/ layoutmgr/inline

2010-09-02 Thread J.Pietschmann

On 02.09.2010 12:14, Glenn Adams wrote:

also the doclet options to permit use of @todo without warnings. I could try
to experiment some to see if that is feasible, then we could return to the
former usage of @todo.


Javadoc 1.5 or later can be passed a command line option defining 
additional tokens to accept:


http://download.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#tag

I vaguely remember to have had it working in my local build.xml some
times ago.

J.Pietschmann


DO NOT REPLY [Bug 49870] New: Border-right not visible if hyphenation is activated

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49870

   Summary: Border-right not visible if hyphenation is activated
   Product: Fop
   Version: 1.0
  Platform: PC
Status: NEW
  Severity: major
  Priority: P2
 Component: pdf
AssignedTo: fop-dev@xmlgraphics.apache.org
ReportedBy: matthias8...@gmx.at


Created an attachment (id=25976)
 -- (https://issues.apache.org/bugzilla/attachment.cgi?id=25976)
Testcase

When setting border-right on fo:inline the border is not visible in PDF output
if hyhpenation is activated.

Could somebody fix this please? Example file is attached.

Thanks

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


DO NOT REPLY [Bug 49870] Border-right not visible if hyphenation is activated

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49870

Matthias Reischenbacher matthias8...@gmx.at changed:

   What|Removed |Added

 CC||matthias8...@gmx.at
 OS/Version||All

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