|  |  | @ -29,18 +29,18 @@ public final class ImagesServlet extends HttpServlet | 
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Integer id = new Integer(param); |  |  |  | 			Integer id = new Integer(param); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Image img = new ImageDAO().getImageForID( id ); |  |  |  | 			Image img = new ImageDAO().getImageForID( id ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			int width = img.getWidth( null ); |  |  |  | //			int width = img.getWidth( null );
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			int height = img.getHeight( null ); |  |  |  | //			int height = img.getHeight( null );
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			double wrel = ((double)width ) / MAX_WIDTH; |  |  |  | //			double wrel = ((double)width ) / MAX_WIDTH;
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			double hrel = ((double)height ) / MAX_HEIGHT; |  |  |  | //			double hrel = ((double)height ) / MAX_HEIGHT;
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			if( wrel > 1 && wrel > hrel ) |  |  |  | //			if( wrel > 1 && wrel > hrel )
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			{ |  |  |  | //			{
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 				img = img.getScaledInstance( MAX_WIDTH, -1, Image.SCALE_FAST ); |  |  |  | //				img = img.getScaledInstance( MAX_WIDTH, -1, Image.SCALE_FAST );
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			} |  |  |  | //			}
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			else if( hrel > 1 && hrel > wrel ) |  |  |  | //			else if( hrel > 1 && hrel > wrel )
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			{ |  |  |  | //			{
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 				img = img.getScaledInstance( -1, MAX_HEIGHT, Image.SCALE_FAST ); |  |  |  | //				img = img.getScaledInstance( -1, MAX_HEIGHT, Image.SCALE_FAST );
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			} |  |  |  | //			}
 | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 			out.write( img.getImageData() ); |  |  |  | 			out.write( img.getImageData() ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  | 		catch (Exception e) { |  |  |  | 		catch (Exception e) { | 
			
		
	
	
		
		
			
				
					|  |  | 
 |