diff --git a/CHANGELOG.md b/CHANGELOG.md index dee8610a..efd92649 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- Fixed inconsistency with displaying EXIF metadata with different aspect ratios ## [1.5.0] - 2026-01-30 ### Added @@ -76,6 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#157]: https://github.com/FossifyOrg/Camera/issues/157 [#177]: https://github.com/FossifyOrg/Camera/issues/177 [#234]: https://github.com/FossifyOrg/Camera/issues/234 +[#198]: https://github.com/FossifyOrg/Camera/issues/198 [Unreleased]: https://github.com/FossifyOrg/Camera/compare/1.5.0...HEAD [1.5.0]: https://github.com/FossifyOrg/Camera/compare/1.4.0...1.5.0 diff --git a/app/src/main/kotlin/org/fossify/camera/helpers/ImageSaver.kt b/app/src/main/kotlin/org/fossify/camera/helpers/ImageSaver.kt index 35d7f6a7..2e0606f1 100644 --- a/app/src/main/kotlin/org/fossify/camera/helpers/ImageSaver.kt +++ b/app/src/main/kotlin/org/fossify/camera/helpers/ImageSaver.kt @@ -16,6 +16,7 @@ import org.fossify.camera.helpers.ImageUtil.imageToJpegByteArray import org.fossify.camera.helpers.ImageUtil.jpegImageToJpegByteArray import org.fossify.camera.models.MediaOutput import org.fossify.commons.extensions.copyTo +import org.fossify.commons.extensions.removeValues import org.fossify.commons.helpers.ensureBackgroundThread import org.fossify.commons.helpers.isQPlus import java.io.* @@ -101,9 +102,9 @@ class ImageSaver private constructor( val output = FileOutputStream(tempFile) val byteArray: ByteArray = imageToJpegByteArray(image, jpegQuality) output.write(byteArray) + val exifInterface = ExifInterface(tempFile) if (saveExifAttributes) { - val exifInterface = ExifInterface(tempFile) val imageByteArray = jpegImageToJpegByteArray(image) val inputStream: InputStream = ByteArrayInputStream(imageByteArray) ExifInterface(inputStream).copyTo(exifInterface) @@ -126,6 +127,8 @@ class ImageSaver private constructor( } exifInterface.saveAttributes() + }else { + exifInterface.removeValues() } } catch (e: IOException) { saveError = SaveError.FILE_IO_FAILED