3 ms·
It might not be up to the app? If the phone has hardware-accelerated JPEG compression, then potentially the image will already be compressed in the 'wrong' orie
by joosters 7y ago
It might not be up to the app? If the phone has hardware-accelerated JPEG compression, then potentially the image will already be compressed in the 'wrong' orientation before the app gets its hands on it. So rotating the image data could involve re-compressing the image again, leading to quality loss. Or if you choose to get the raw sensor data instead, and rotate the data before doing the compression yourself, you might lose out on the hw acceleration entirely.
(I've not developed any camera apps, so this is just a guess!)
- pwg 7y ago> So rotating the image data could involve re-compressing the image again, leading to quality loss. With JPEG, no, 90 degree rotations can be accomplished in a lossless manner. See jpegtran from the libjpeg library. A version of its manpage is here: https://linux.die.net/man/1/jpegtran https://linux.die.net/man/1/jpegtran Quoting: "... It can also perform some rearrangements of the image data, for example turning an image from landscape to portrait format by rotation. jpegtran works by rearranging the compressed data (DCT coefficients), without ever fully decoding the image. Therefore, its transformations are lossless: there is no image degradation at all, which would not be true if you used djpeg followed by cjpeg to accomplish the same conversion. ..."