From ea2b946c0ebb9af97ecbe20fec2d52b48cc8d3b6 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Mon, 16 Aug 2004 19:29:04 +0000 Subject: [PATCH] Fix implementations after logging changes to correspond to the interface again. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197879 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/image/BmpImage.java | 8 ++++---- src/java/org/apache/fop/image/JimiImage.java | 12 ++++++------ src/java/org/apache/fop/image/JpegImage.java | 15 +++++++-------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/java/org/apache/fop/image/BmpImage.java b/src/java/org/apache/fop/image/BmpImage.java index c3bbea192..50312a5e7 100644 --- a/src/java/org/apache/fop/image/BmpImage.java +++ b/src/java/org/apache/fop/image/BmpImage.java @@ -50,7 +50,7 @@ public class BmpImage extends AbstractFopImage { * @param ua the user agent * @return true if it was loaded successfully */ - protected boolean loadBitmap(Log logger) { + protected boolean loadBitmap() { int wpos = 18; int hpos = 22; // offset positioning for w and height in bmp files int[] headermap = new int[54]; @@ -88,7 +88,7 @@ public class BmpImage extends AbstractFopImage { } } } catch (IOException e) { - logger.error("Error while loading image " + log.error("Error while loading image " + "" + " : " + e.getClass() + " - " + e.getMessage(), e); @@ -118,7 +118,7 @@ public class BmpImage extends AbstractFopImage { } else if (this.bitsPerPixel == 4 || this.bitsPerPixel == 8) { bytes = this.width / (8 / this.bitsPerPixel); } else { - logger.error("Image (" + "" + log.error("Image (" + "" + ") has " + this.bitsPerPixel + " which is not a supported BMP format."); return false; @@ -143,7 +143,7 @@ public class BmpImage extends AbstractFopImage { inputStream.close(); inputStream = null; } catch (IOException e) { - logger.error("Error while loading image " + log.error("Error while loading image " + "" + " : " + e.getClass() + " - " + e.getMessage(), e); diff --git a/src/java/org/apache/fop/image/JimiImage.java b/src/java/org/apache/fop/image/JimiImage.java index ab07e8ecf..cefeac17e 100644 --- a/src/java/org/apache/fop/image/JimiImage.java +++ b/src/java/org/apache/fop/image/JimiImage.java @@ -48,26 +48,26 @@ public class JimiImage extends AbstractFopImage { } } - protected boolean loadDimensions(Log logger) { + protected boolean loadDimensions() { if (this.bitmaps == null) { - loadImage(logger); + loadImage(); } return this.bitmaps != null; } /** - * @see org.apache.fop.image.AbstractFopImage#loadBitmap(Logger) + * @see org.apache.fop.image.AbstractFopImage#loadBitmap() */ - protected boolean loadBitmap(Log logger) { + protected boolean loadBitmap() { if (this.bitmaps == null) { - loadImage(logger); + loadImage(); } return this.bitmaps != null; } - protected void loadImage(Log log) { + protected void loadImage() { int[] tmpMap = null; try { ImageProducer ip = diff --git a/src/java/org/apache/fop/image/JpegImage.java b/src/java/org/apache/fop/image/JpegImage.java index 3ce3ed13e..4de79fbba 100644 --- a/src/java/org/apache/fop/image/JpegImage.java +++ b/src/java/org/apache/fop/image/JpegImage.java @@ -52,10 +52,9 @@ public class JpegImage extends AbstractFopImage { * This loads the original jpeg data and reads the color space, * and icc profile if any. * - * @param ua the user agent * @return true if loaded false for any error */ - protected boolean loadOriginalData(Log logger) { + protected boolean loadOriginalData() { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream iccStream = new ByteArrayOutputStream(); int index = 0; @@ -70,7 +69,7 @@ public class JpegImage extends AbstractFopImage { inputStream.close(); inputStream = null; } catch (java.io.IOException ex) { - logger.error("Error while loading image " + log.error("Error while loading image " + " : " + ex.getClass() + " - " + ex.getMessage(), ex); return false; @@ -115,7 +114,7 @@ public class JpegImage extends AbstractFopImage { */ this.colorSpace = CMYKColorSpace.getInstance(); } else { - logger.error("Unknown ColorSpace for image: " + log.error("Unknown ColorSpace for image: " + ""); return false; } @@ -157,7 +156,7 @@ public class JpegImage extends AbstractFopImage { } } } else { - logger.error("Error while loading " + log.error("Error while loading " + "JpegImage - Invalid JPEG Header."); return false; } @@ -166,7 +165,7 @@ public class JpegImage extends AbstractFopImage { try { iccStream.write(align); } catch (Exception e) { - logger.error("Error while loading image " + log.error("Error while loading image " + " : " + e.getMessage(), e); return false; @@ -174,11 +173,11 @@ public class JpegImage extends AbstractFopImage { try { iccProfile = ICC_Profile.getInstance(iccStream.toByteArray()); } catch (Exception e) { - logger.error("Invalid ICC profile: " + e, e); + log.error("Invalid ICC profile: " + e, e); return false; } } else if (this.colorSpace == null) { - logger.error("ColorSpace not specified for JPEG image"); + log.error("ColorSpace not specified for JPEG image"); return false; } return true; -- 2.39.5