* @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];
}
}
} catch (IOException e) {
- logger.error("Error while loading image "
+ log.error("Error while loading image "
+ "" + " : "
+ e.getClass() + " - "
+ e.getMessage(), e);
} 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;
inputStream.close();
inputStream = null;
} catch (IOException e) {
- logger.error("Error while loading image "
+ log.error("Error while loading image "
+ "" + " : "
+ e.getClass() + " - "
+ e.getMessage(), e);
}
}
- 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 =
* 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;
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;
*/
this.colorSpace = CMYKColorSpace.getInstance();
} else {
- logger.error("Unknown ColorSpace for image: "
+ log.error("Unknown ColorSpace for image: "
+ "");
return false;
}
}
}
} else {
- logger.error("Error while loading "
+ log.error("Error while loading "
+ "JpegImage - Invalid JPEG Header.");
return false;
}
try {
iccStream.write(align);
} catch (Exception e) {
- logger.error("Error while loading image "
+ log.error("Error while loading image "
+ " : "
+ e.getMessage(), e);
return false;
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;