You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Georg Von Sperling <gv...@medaptus.com> on 2002/02/27 20:34:48 UTC

RE: SVGSerializer issue temporarily resolved - still needs fixin' though ;)

Michael,

	 
	Looking through the source code, trying to hunt down how the image finally gets encoded, brought to attention the following:
	 
	org.apache.cocoon.serialization.SVGSerializer
	 
	    /**
	     * Generate the unique key.
	     * This key must be unique inside the space of this component.
	     * This method must be invoked before the generateValidity() method.
	     *
	     * @return The generated key or <code>0</code> if the component
	     *              is currently not cacheable.
	     */
	    public long generateKey() {
	        return 1;
	    }
	hmmm... wonder how unique that really is.
	 
	Meanwhile, I got the latest "HEAD" checkout of xml-batik. After hours of trying to figure out what instatiates what, I came across this line in 
	 
	org.apache.batik.transcoder.image.JPEGTranscoder
	 
	    /**
	     * Constructs a new transcoder that produces jpeg images.
	     */
	    public JPEGTranscoder() {
	        hints.put(ImageTranscoder.KEY_BACKGROUND_COLOR, Color.white);
	    } 
	 
	I commented out "hints.put....", re-compiled, touched every xml file in webapps/cocoon/documentation/svg and ran the sucker. It worked (although there is some strange behaviour still, see attached screenshot- couldn't send... too big... where can I send this?). I believe that some of the 
	files might be pre-compiled in the work directory, so I am not too concerned with it.
	 
	Once that worked, I modified the line to read:
	hints.put(ImageTranscoder.KEY_BACKGROUND_COLOR, Color.black);
	Guess what... it gave me a whole bunch of black boxes on the page... .
	 
	Now I'll leave the rest up to the batik-dev group and you guys. At this point I am a bit flabbergasted.
	 
	The reason I did that is that I had an hunch that the keys might be reversed, or something. 
	 
	NB: this did not break the previous resolution to change the svg2jpeg serializer to svg2png....
	 
	Please advise.
	 
	Georg von Sperling
	MedAptus, Inc.
	www.medaptus.com
	gvs@medaptus.com
	 
	Attachments: modified JPEGTranscoder.java

	screenshot of weird behaviour (screenshot.jpg) == couldn't send still too big : (
	                                                  
	I was gonna attach the compiled batik.jar  (ant libs-jar) (note that it is 100kb larger than the batik1.1.1.jar that is in the cocoon distro), but the email bounced because of the size of the email, so let me know if you want me to eMail it to someone directly, or otherwise

		-----Original Message----- 
		From: Michael Hartle [mailto:mhartle@hartle-klug.com] 
		Sent: Mon 2/25/2002 5:26 PM 
		To: cocoon-dev@xml.apache.org 
		Cc: 
		Subject: Re: SVGSerializer issue temporarily resolved - still needs fixin' though ;)
		
		

		Georg Von Sperling wrote:
		
		>Configuration:
		>Windows 2000
		>Ant 1.4
		>JDK 1.4.0 build 92
		>Tomcat (standalone) 4.0.1
		>xml-cocoon2 checkout "HEAD" on Feb. 25, 2002 @ 11:30 am
		>                     compile "build.bat -Dinclude.webapp.libs=yes webapp"
		>
		>
		>How do I fix the svg2jpg serializer?
		>
		I'd like to be able to answer the question - the SVG2JPG serializer
		works with the Batik library, which in turn uses Suns auxiliary classes
		to generate JPEGs; sadly, this broke with the release of JDK 1.4.0, and
		nobody seems to know why; currently, generated images under that JDK
		just contain plain white space; if you find a solution for that issue,
		please be so kind and drop a note in the batik-dev mailinglist.
		
		>Cheers,
		>Georg von Sperling
		>MedAptus, Inc.
		>http://www.medaptus.com
		>gvs@medaptus.com
		>
		Best regards,
		
		Michael Hartle,
		Hartle & Klug GbR
		
		
		---------------------------------------------------------------------
		To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
		For additional commands, email: cocoon-dev-help@xml.apache.org
		
		


Re: SVGSerializer issue temporarily resolved - still needs fixin' though ;)

Posted by Michael Hartle <mh...@hartle-klug.com>.
Hello Georg,

thanks for reporting back on this issue ! I agree, the 
SVGSerializer.generateKey() does not look like if it made sense that 
way; I will try to have a look into that and report back my results. 
Could you please send your screenshot to my email address ?

Best regards,

Michael Hartle,
Hartle & Klug GbR



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org