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
Post a Comment