TIFFImage tiffImage = (TIFFImage) fopimage;
int x = mpts2units(pos.getX() + currentIPPosition);
int y = mpts2units(pos.getY() + currentBPPosition);
int w = mpts2units(pos.getWidth());
int h = mpts2units(pos.getHeight());
ImageObject io = _afpDataStream.getImageObject(x, y, w, h);
io.setImageParameters(
(int)(fopimage.getHorizontalResolution() * 10),
(int)(fopimage.getVerticalResolution() * 10),
fopimage.getWidth(),
fopimage.getHeight()
);
if (tiffImage.getStripCount() == 1) {
int comp = tiffImage.getCompression();
if (comp == 3) {
if (!fopimage.load(FopImage.ORIGINAL_DATA)) {
return;
}
io.setImageEncoding((byte)0x81);
io.setImageData(fopimage.getRessourceBytes());
} else if (comp == 4) {
if (!fopimage.load(FopImage.ORIGINAL_DATA)) {
return;
}
io.setImageEncoding((byte)0x82);
io.setImageData(fopimage.getRessourceBytes());
} else {
if (!fopimage.load(FopImage.BITMAP)) {
return;
}
convertToGrayScaleImage(io, fopimage.getBitmaps(),
fopimage.getWidth(), fopimage.getHeight());
}
} else {
if (!fopimage.load(FopImage.BITMAP)) {
return;
}
convertToGrayScaleImage(io, fopimage.getBitmaps(),
fopimage.getWidth(), fopimage.getHeight());
}
} else {
if (!fopimage.load(FopImage.BITMAP)) {
return;
}
fact.releaseImage(url, userAgent);
int x = mpts2units(pos.getX() + currentIPPosition);
int y = mpts2units(pos.getY() + currentBPPosition);
int w = mpts2units(pos.getWidth());
int h = mpts2units(pos.getHeight());
ImageObject io = _afpDataStream.getImageObject(x, y, w, h);
io.setImageParameters(
(int)(fopimage.getHorizontalResolution() * 10),
(int)(fopimage.getVerticalResolution() * 10),
fopimage.getWidth(),
fopimage.getHeight()
);
if (colorImages) {
io.setImageIDESize((byte)24);
io.setImageData(fopimage.getBitmaps());
} else {
convertToGrayScaleImage(io, fopimage.getBitmaps(),
fopimage.getWidth(), fopimage.getHeight());
}
}