first commit

This commit is contained in:
2025-07-28 13:56:49 +05:30
commit e9eb805edb
3438 changed files with 520990 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package net.sf.jasperreports.engine.util;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.BufferedImage;
import net.sf.jasperreports.engine.JRException;
public abstract class JRAbstractImageEncoder implements JRImageEncoder {
public byte[] encode(Image image, byte imageType) throws JRException {
BufferedImage bi = null;
if (image instanceof BufferedImage) {
bi = (BufferedImage)image;
} else {
bi = new BufferedImage(image.getWidth(null), image.getHeight(null), (imageType == 1 || imageType == 3) ? 2 : 1);
Graphics g = bi.createGraphics();
g.drawImage(image, 0, 0, null);
g.dispose();
}
return encode(bi, imageType);
}
public abstract byte[] encode(BufferedImage paramBufferedImage, byte paramByte) throws JRException;
}