xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Domagoj Cosic <Domagoj.Co...@hypercis.de>
Subject RE: org.apache.fop.render.awt.AWTRenderer, again
Date Thu, 05 Oct 2000 08:24:44 GMT
Dear Steven,

you are basically right about the exceptions. In the previous version,
ImageException was possible because the size was read from the image itself.
That is not any more the case. However the URL still can make problems - I
catch the MalformedURLException not displaying any message: there should be
an output there.

		} catch(MalformedURLException mue) {
			MessageHandler.logln("Error while loading image : "
+ mue.getMessage());		}

Please change the lines that way. There no other exception that can occur at
this point.

Regards,

Domagoj

> -----Original Message-----
> From: COFFMAN Steven [mailto:SCoffman@CBSINC.com]
> Sent: Wednesday, October 04, 2000 9:30 PM
> To: 'fop-dev@xml.apache.org'
> Subject: RE: org.apache.fop.render.awt.AWTRenderer, again
> 
> 
> Since Eric's a bit busy after just getting married 
> (Congratulations!), and I
> have a high level of confidence in you from your last 
> patches/messages, I
> was going to commit this for him, but you don't handle your 
> exceptions! The
> catch is empty, and I don't think it handles all the possible 
> exceptions
> that the old code did.
> 
> This might be ok (I'm not familiar with whether it's really 
> possible to get
> an exception at this point), but it kind of scares me, so I'm 
> going to wait
> on Eric or a patch that's less scary.
> -Steve
> 
> -----Original Message-----
> From: Domagoj Cosic [mailto:Domagoj.Cosic@hypercis.de]
> Sent: Wednesday, October 04, 2000 4:39 AM
> To: 'fop-dev@xml.apache.org'
> Subject: org.apache.fop.render.awt.AWTRenderer, again
> 
> 
> 
> *** PGP Signature Status: bad
> *** Signer: Domagoj Cosic <Domagoj.Cosic@hypercis.de>
> *** Signed: 04.10.00 10:39:28
> *** Verified: 05.10.00 10:11:12
> *** BEGIN PGP VERIFIED MESSAGE ***
> 
> A few weeks ago, I posted a patch for the AWTRenderer. However, due to
> changes between 0.13.0 an 0.14.0, this patch was not 
> completely correct.
> Here is a correct, functioning version:
> 
> 	public void renderImageArea(ImageArea area) {
> 		int x = currentAreaContainerXPositionShadow +
> 		    area.getXOffset();
> 		int y = currentYPosition;
> 		int w = area.getContentWidth();
> 		int h = area.getHeight();
> 		
> 		FopImage img = area.getImage();
> 		
> 		if (img == null) {
> 		    System.out.println("area.getImage() is null");
> 		}
> 		
> 		String urlString = img.getURL();
> 		try {
> 			URL url = new URL(urlString);
> 			
> 			ImageIcon icon = new ImageIcon(url);
> 			Image image = icon.getImage();
> 			
> 			graphics.drawImage(image, x / 1000,
> 					   pageHeight - y / 1000,
> 					   w / 1000,
> 					   h / 1000,
> 					   null);
> 		} catch(MalformedURLException mue) {
> 		}
> 		
> 		currentYPosition -= h;
> 	}
> 
> It produces same results as the PDF renderer, as one would expect.
> 
> I wonder about why my other patch (DOM tree formatting) 
> caused no reaction
> at all...
> 
> Regards,
> 
> Domagoj
> 
> 
> *** END PGP VERIFIED MESSAGE ***
> 

Mime
View raw message