[VIVO-1234] Use alternative method to change the colour space of an image and remove the alpha channel
This commit is contained in:
parent
c7ca626121
commit
bbad114f85
1 changed files with 5 additions and 3 deletions
|
@ -5,6 +5,7 @@ package edu.cornell.mannlib.vitro.webapp.imageprocessor.jai;
|
|||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.image.AffineTransformOp;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ColorConvertOp;
|
||||
import java.awt.image.ColorModel;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
@ -85,9 +86,10 @@ public class JaiImageProcessor implements ImageProcessor {
|
|||
throws ImageProcessorException, IOException {
|
||||
try {
|
||||
RenderedOp mainImage = loadImage(mainImageStream);
|
||||
RenderedOp opaqueImage = makeImageOpaque(mainImage);
|
||||
|
||||
BufferedImage bufferedImage = opaqueImage.getAsBufferedImage();
|
||||
BufferedImage bufferedImage = new BufferedImage(mainImage.getWidth(), mainImage.getHeight(), BufferedImage.TYPE_INT_RGB);
|
||||
new ColorConvertOp(null).filter(mainImage.getAsBufferedImage(), bufferedImage);
|
||||
|
||||
log.debug("initial image: " + imageSize(bufferedImage));
|
||||
|
||||
log.debug("initial crop: " + crop);
|
||||
|
|
Loading…
Add table
Reference in a new issue