System.out.println(imageWidth + "|" + imageHeight);
		public String create(String _name)  {			boolean hasError = false;			String thumbFileName = "images/nothumb.jpg";			if (!isThumb(_name)) {				thumbFileName = getThumbName(_name);									// load image from INFILE			    if (!exists(thumbFileName)) {				    Image image = Toolkit.getDefaultToolkit().getImage(_name);				    MediaTracker mediaTracker = new MediaTracker(new Container());				    mediaTracker.addImage(image, 0);				    try {						mediaTracker.waitForID(0);					} catch (InterruptedException e) {						e.printStackTrace();						hasError = true;					}				    // determine thumbnail size from WIDTH and HEIGHT				    int imageWidth = image.getWidth(null);				    int imageHeight = image.getHeight(null);				    				    double imageRatio = (double)imageWidth / (double)imageHeight;				    switch (scalingMethod) {				    	case SCALE_METHOD_AUTO:						    if (thumbRatio < imageRatio) {						      thumbHeight = (int)(thumbWidth / imageRatio);						    } else {						      thumbWidth = (int)(thumbHeight * imageRatio);						    }				    		break;				    	case SCALE_METHOD_WIDTH:						    thumbHeight = (int)(thumbWidth / imageRatio);				    		break;				    	case SCALE_METHOD_HEIGHT:						    thumbWidth = (int)(thumbHeight * imageRatio);					    					    		break;				    }				    // draw original image to thumbnail image object and				    // scale it to the new size on-the-fly				    BufferedImage thumbImage = new BufferedImage(thumbWidth, 				      thumbHeight, BufferedImage.TYPE_INT_RGB);				    Graphics2D graphics2D = thumbImage.createGraphics();				    graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,				      RenderingHints.VALUE_INTERPOLATION_BILINEAR);				    graphics2D.drawImage(image, 0, 0, thumbWidth, thumbHeight, null);				    // save thumbnail image to OUTFILE				    BufferedOutputStream out;					try {						out = new BufferedOutputStream(new FileOutputStream(thumbFileName));					    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);					    JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(thumbImage);					    quality = Math.max(0, Math.min(quality, 100));					    param.setQuality((float)quality / 100.0f, false);					    					    encoder.setJPEGEncodeParam(param);						encoder.encode(thumbImage);												out.close();					} catch (FileNotFoundException e) {						e.printStackTrace();						System.out.println(e.getMessage());						hasError = true;					} catch (ImageFormatException e) {						e.printStackTrace();						System.out.println(e.getMessage());						hasError = true;					} catch (IOException e) {						e.printStackTrace();						System.out.println(e.getMessage());						hasError = true;					}			    }			}			if (hasError) {				File file = new File(thumbFileName);				if (file.exists()) {					file.delete();				}				return "images/nothumb.jpg";			} else {				return thumbFileName;			}		}