Programmatically Reducing JPEG file size

后端 未结 4 1006
再見小時候
再見小時候 2021-01-12 07:36

Apologies for any ignorance, but I have never worked with jpeg images (let alone any types of images) in Java before.

Supposing I want to send a jpeg image from a we

4条回答
  •  粉色の甜心
    2021-01-12 08:05

    The easiest way to do this is to decompress the byte stream into a Java Image, optionally resize it (which makes it smaller) and then regenerate a JPEG image from this with the desired quality setting.

    This new image is then what is sent to the client.

提交回复
热议问题