code: public static Dimension getDimensions(String fileName,String mimeType,InputStream input)
  		throws ImageSizeException,FormatNotSuported, DaoManagerException{
  
  
  		if (isGIF(mimeType)){
  			try {
  				return getGifDimensions(input);
  			}catch(IOException e){
  				throw new ImageSizeException(e,"while getting dimension for file:"+fileName+" mimeType:"+mimeType);
  			}
  	
  		} else if (isJPEG(mimeType) ){
  			try {
  				Dimension dim=getJpgDimensions(input);
  				if (dim!=null){
  					return dim;
  				} else {
  					throw new ImageSizeException("Illegal size for file:"+fileName+" mimeType:"+mimeType);
  				}
  			}catch(IOException e){
  				throw new ImageSizeException(e,"while getting dimension for file:"+fileName+" mimeType:"+mimeType);
  			}
  	
  		} else if (isPNG(mimeType) ){
  			try {
  				Dimension dim=getPngDimensions(input);
  				if (dim!=null){
  					return dim;
  				} else {
  					throw new ImageSizeException("Illegal size for file:"+fileName+" mimeType:"+mimeType);
  				}
  			}catch(IOException e){
  				throw new ImageSizeException(e,"while getting dimension for file:"+fileName+" mimeType:"+mimeType);
  			}
  	
  		} else {
  			throw new FormatNotSuported("Mime type:"+mimeType+" not supported.");
  		}
  
  	}
docs: ATENCION SE LEEN CARACTERES DEL INPUT STREM POR LO QUE LA POSICION DE LECTURA DENTRO DEL INPUT
  QUEDA INUTILIZADA
  @param fileName
  @param mimeType
  @param input
  @return
  @throws ImageSizeException
  @throws FormatNotSuported
  @throws DaoManagerException