Add multiple quality levels for JPG encoding - adjust default to 0.85

This commit is contained in:
Mike Primm 2011-08-16 12:26:28 +08:00 committed by mikeprimm
parent 4616f6a5be
commit 477a7d13de
8 changed files with 69 additions and 41 deletions

View file

@ -91,11 +91,17 @@ public class HDMap extends MapType {
}
String fmt = configuration.getString("image-format", "png");
/* Only allow png or jpg */
if(fmt.equals(IMGFORMAT_PNG))
for(ImageFormat f : ImageFormat.values()) {
if(fmt.equals(f.getID())) {
imgformat = f;
break;
}
}
if(imgformat == null) {
Log.severe("HDMap '"+name+"' set invalid image-format: " + fmt);
imgformat = ImageFormat.FORMAT_PNG;
else
imgformat = ImageFormat.FORMAT_JPG;
}
}
}
public HDShader getShader() { return shader; }
public HDPerspective getPerspective() { return perspective; }