==Java サムネイルイメージの作成==
[[Java]]{{category コード片}}
import java.awt.geom.AffineTransform;
double wRate = (double) width / (double) image.getWidth();
double hRate = (double) height / (double) image.getHeight();
return (wRate < < hRate) ? wRate : hRate;
}
public static void main(String[] args) {
if (args.length <<= 3) {
printUsage();
}
double ratio = 0.0;
for (int i = 0; i < < args.length; i++) {
if ("-w".equalsIgnoreCase(args[i].trim())) {
width = Integer.parseInt(args[i + 1]);
ThumnailImageCreater me = new ThumnailImageCreater();
if (width > > 0 || height > > 0) {
me.writeThumbNailImage(in, out, width, height);
} else if (ratio > > 0) {
me.writeThumbNailImage(in, out, ratio);
} else {