mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +00:00
Update BrandedPreviewJPEGFilter.java
Working to address failed to convolve bug.
This commit is contained in:
@@ -185,6 +185,20 @@ public class BrandedPreviewJPEGFilter extends MediaFilter
|
||||
return bais; // hope this gets written out before its garbage collected!
|
||||
}
|
||||
|
||||
public BufferedImage getNormalizedInstance(BufferedImage buf)
|
||||
{
|
||||
int type = (buf.getTransparency() == Transparency.OPAQUE) ?
|
||||
BufferedImage.TYPE_INT_RGB : BufferedImage.TYPE_INT_ARGB_PRE;
|
||||
int w, h;
|
||||
w = buf.getWidth();
|
||||
h = buf.getHeight();
|
||||
BufferedImage normal = new BufferedImage(w, h, type);
|
||||
Graphics2D g2d = normal.createGraphics();
|
||||
g2d.drawImage(buf, 0, 0, w, h, Color.WHITE, null);
|
||||
g2d.dispose();
|
||||
return normal;
|
||||
}
|
||||
|
||||
public BufferedImage getBlurredInstance(BufferedImage buf)
|
||||
{
|
||||
/**
|
||||
@@ -193,6 +207,8 @@ public class BrandedPreviewJPEGFilter extends MediaFilter
|
||||
*
|
||||
*/
|
||||
|
||||
buf = getNormalizedInstance(buf);
|
||||
|
||||
// kernel for blur op
|
||||
float[] matrix = {
|
||||
0.111f, 0.111f, 0.111f,
|
||||
|
Reference in New Issue
Block a user