Skip to content

Commit

Permalink
Merge pull request #495 from IDgis/manual-merge-481-428
Browse files Browse the repository at this point in the history
Manual merge #481 #428
  • Loading branch information
copierrj committed Feb 7, 2015
2 parents 631a582 + 9552fc0 commit 19d23c8
Show file tree
Hide file tree
Showing 6 changed files with 1,039 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import java.io.IOException;
import java.io.OutputStream;

import org.deegree.style.utils.ColorQuantizer;
import org.deegree.style.utils.ImageUtils;

/**
Expand Down Expand Up @@ -95,11 +96,13 @@ public boolean close() throws IOException {
try {
graphics.dispose();
if ( outputStream != null ) {
BufferedImage image = this.image;
String format = this.format.substring( this.format.indexOf( "/" ) + 1 );
if ( format.equals( "x-ms-bmp" ) ) {
format = "bmp";
}
if ( format.equals( "png; subtype=8bit" ) || format.equals( "png; mode=8bit" ) ) {
image = ColorQuantizer.quantizeImage( image, 256, false, false );
format = "png";
}
return write( image, format, outputStream );
Expand Down
Loading

0 comments on commit 19d23c8

Please sign in to comment.