Skip to content

Commit c8d08e2

Browse files
committed
Small refactor
1 parent e8046da commit c8d08e2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/content/ImageExifTagRemover.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ internal class ImageExifTagRemover @Inject constructor(
5050
} ?: return@withContext jpegImageFile
5151

5252
tryOrNull("Unable to remove ExifData") {
53-
outputSet.removeField(ExifTagConstants.EXIF_TAG_GPSINFO)
54-
outputSet.removeField(ExifTagConstants.EXIF_TAG_SUBJECT_LOCATION)
55-
outputSet.removeField(ExifTagConstants.EXIF_TAG_USER_COMMENT)
56-
GpsTagConstants.ALL_GPS_TAGS.forEach { tagInfo ->
53+
tagsToRemove.forEach { tagInfo ->
5754
outputSet.removeField(tagInfo)
5855
}
5956
} ?: return@withContext jpegImageFile
@@ -74,4 +71,12 @@ internal class ImageExifTagRemover @Inject constructor(
7471
}
7572
)
7673
}
74+
75+
private val tagsToRemove
76+
get() = GpsTagConstants.ALL_GPS_TAGS +
77+
listOf(
78+
ExifTagConstants.EXIF_TAG_GPSINFO,
79+
ExifTagConstants.EXIF_TAG_SUBJECT_LOCATION,
80+
ExifTagConstants.EXIF_TAG_USER_COMMENT,
81+
)
7782
}

0 commit comments

Comments
 (0)