Merge 5441 from the branch
This commit is contained in:
parent
bcf67db895
commit
1da043245c
1 changed files with 5 additions and 1 deletions
|
@ -31,6 +31,7 @@ import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
|
import com.sun.media.jai.codec.JPEGEncodeParam;
|
||||||
import com.sun.media.jai.codec.MemoryCacheSeekableStream;
|
import com.sun.media.jai.codec.MemoryCacheSeekableStream;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||||
|
@ -460,9 +461,12 @@ public class ImageUploadHelper {
|
||||||
scaleParams.add(0.0F); // y translate
|
scaleParams.add(0.0F); // y translate
|
||||||
scaleParams.add(interpolation);
|
scaleParams.add(interpolation);
|
||||||
RenderedOp image2 = JAI.create("scale", scaleParams);
|
RenderedOp image2 = JAI.create("scale", scaleParams);
|
||||||
|
|
||||||
|
JPEGEncodeParam encodeParam = new JPEGEncodeParam();
|
||||||
|
encodeParam.setQuality(1.0F);
|
||||||
|
|
||||||
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
|
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
|
||||||
JAI.create("encode", image2, bytes, "JPEG", null);
|
JAI.create("encode", image2, bytes, "JPEG", encodeParam);
|
||||||
bytes.close();
|
bytes.close();
|
||||||
return new ByteArrayInputStream(bytes.toByteArray());
|
return new ByteArrayInputStream(bytes.toByteArray());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue