From e219165de610ce89ec6627f8306ebd1e879eb7b5 Mon Sep 17 00:00:00 2001 From: Gerardo Date: Mon, 1 Jul 2024 16:26:09 +0200 Subject: [PATCH] WPMediaUtils - Set normal orientation for the exif data --- .../main/java/org/wordpress/android/util/WPMediaUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java b/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java index dedc18123b5a..6aeb66346aca 100644 --- a/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java +++ b/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java @@ -18,6 +18,7 @@ import androidx.annotation.StringRes; import androidx.appcompat.app.AlertDialog; import androidx.core.content.FileProvider; +import androidx.exifinterface.media.ExifInterface; import com.google.android.material.dialog.MaterialAlertDialogBuilder; @@ -84,6 +85,9 @@ public static Uri getOptimizedMedia(Context context, String path, boolean isVide AppLog.e(AppLog.T.EDITOR, "Optimized picture was null!"); AnalyticsTracker.track(AnalyticsTracker.Stat.MEDIA_PHOTO_OPTIMIZE_ERROR); } else { + // Set the default orientation tag for the EXIF data + exifData.put("Orientation", String.valueOf(ExifInterface.ORIENTATION_NORMAL)); + // Write EXIF data to the new image ExifUtils.writeExifData(exifData, optimizedPath);