hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hjw <hjw1...@gmail.com>
Subject A problem about save image
Date Fri, 29 Feb 2008 01:21:22 GMT
Hi.

I try to write a programme ,which is used to download imagein some html.

I can get the page content ,and analyse the image url ,but when I download
and save the image using InputStream and ImageIO,there is a problem .It is
the size of image is not right,it seems the image was only a part of the
original,for example,the image in html is 600*800,it is the right size when
save as in IE, but downloaded in my programme,the size is 600*600 ,some data
is miss .I am sure it is not Internet problem.

Below is the code,the output is always N*N(600*600),could you tell me what
the problem is ?

InputStream in = get.getResponseBodyAsStream();
BufferedImage input = ImageIO.read(in);
ImageIcon icon = new ImageIcon(input);
System.out.println(icon.getIconHeight()+"*"+icon.getIconWidth());

Thanks and Regards,

Raymond

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message