Component used: androidx.exifinterface:exifinterface Version used: 1.3.2 Devices/Android versions reproduced on: Android 8.1 Huawei P20 Lite, Android 10 Nokia 8 Sirocco
It's value specific issue. Mostly works correct, but if you put 0.0249 as an exposure time to exif, then you will get 0.0248. The problem is improper implementation of Rational class, where conversion to int is done with truncating, not rounding.
Example code: setAttribute(ExifInterface.TAG_EXPOSURE_TIME, "0.0249") // 0.0249 time = getAttribute(ExifInterface.TAG_EXPOSURE_TIME) // 0.0248
Description
Version used: 1.3.2
Devices/Android versions reproduced on: Android 8.1 Huawei P20 Lite, Android 10 Nokia 8 Sirocco
It's value specific issue. Mostly works correct, but if you put 0.0249 as an exposure time to exif, then you will get 0.0248. The problem is improper implementation of Rational class, where conversion to int is done with truncating, not rounding.
Example code:
setAttribute(ExifInterface.TAG_EXPOSURE_TIME, "0.0249") // 0.0249
time = getAttribute(ExifInterface.TAG_EXPOSURE_TIME) // 0.0248