Skip to content

Commit e8046da

Browse files
committed
Use GpsTagConstants.ALL_GPS_TAGS to remove all tags related to GPS.
1 parent 3632e6d commit e8046da

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,9 @@ internal class ImageExifTagRemover @Inject constructor(
5353
outputSet.removeField(ExifTagConstants.EXIF_TAG_GPSINFO)
5454
outputSet.removeField(ExifTagConstants.EXIF_TAG_SUBJECT_LOCATION)
5555
outputSet.removeField(ExifTagConstants.EXIF_TAG_USER_COMMENT)
56-
outputSet.removeField(GpsTagConstants.GPS_TAG_GPS_ALTITUDE)
57-
outputSet.removeField(GpsTagConstants.GPS_TAG_GPS_ALTITUDE_REF)
58-
outputSet.removeField(GpsTagConstants.GPS_TAG_GPS_LONGITUDE)
59-
outputSet.removeField(GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF)
60-
outputSet.removeField(GpsTagConstants.GPS_TAG_GPS_DEST_LONGITUDE)
61-
outputSet.removeField(GpsTagConstants.GPS_TAG_GPS_DEST_LONGITUDE_REF)
62-
outputSet.removeField(GpsTagConstants.GPS_TAG_GPS_LATITUDE)
63-
outputSet.removeField(GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF)
64-
outputSet.removeField(GpsTagConstants.GPS_TAG_GPS_DEST_LATITUDE)
65-
outputSet.removeField(GpsTagConstants.GPS_TAG_GPS_DEST_LATITUDE_REF)
56+
GpsTagConstants.ALL_GPS_TAGS.forEach { tagInfo ->
57+
outputSet.removeField(tagInfo)
58+
}
6659
} ?: return@withContext jpegImageFile
6760

6861
val scrubbedFile = temporaryFileCreator.create()

0 commit comments

Comments
 (0)