diff --git a/src/main/java/org/havenapp/main/sensors/motion/Preview.java b/src/main/java/org/havenapp/main/sensors/motion/Preview.java index 31afe3d4..d03bc568 100644 --- a/src/main/java/org/havenapp/main/sensors/motion/Preview.java +++ b/src/main/java/org/havenapp/main/sensors/motion/Preview.java @@ -31,6 +31,7 @@ import org.havenapp.main.PreferenceManager; import org.havenapp.main.model.EventTrigger; +import org.havenapp.main.sensors.media.ImageCodec; import org.havenapp.main.sensors.media.MotionAsyncTask; import org.havenapp.main.service.MonitorService; @@ -290,7 +291,12 @@ public void onProcess(Bitmap oldBitmap, Bitmap newBitmap, File fileImage = new File(fileImageDir, "detected.original." + ts); FileOutputStream stream = new FileOutputStream(fileImage); - rawBitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream); + if (prefs.getCamera().equalsIgnoreCase(PreferenceManager.BACK)) { + Bitmap bmps = ImageCodec.rotate(rawBitmap, 180, false); + bmps.compress(Bitmap.CompressFormat.JPEG, 100, stream); + } else { + rawBitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream); + } stream.flush(); stream.close(); message.getData().putString("path", fileImage.getAbsolutePath());