flashair - Why does reading and writing a JPEG with Java ImageIO reduce the file size? -


i using java's javax.imageio.imageio read contents flashair 32gb (2nd gen) , write them local hard drive. can read , save files, noticed ones in hard drive smaller originals in sd card. ideas of why happening? code use:

url imageurl = new url("http://192.168.0.1/dcim/100__tsb/img_0001.jpg"); file dest = new file("/home/me/pictures/flashair/img_0001.jpg"); bufferedimage image = imageio.read(imageurl); imageio.write(image, "jpg", dest); 

the images save local hard drive fine, 1/3 of original size.

that code isn't copying (reading , saving) files. it's decoding images, , re-encoding them @ default jpeg compression rate (which, judging jpegimagewriteparam documentation, 0.75).

if want change compression level, check out this question.

if you're trying copy files exactly, don't use imageio @ all.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -