Skip to content

Commit

Permalink
Merge branch 'percy-g2-bug-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Jan 17, 2018
2 parents 913b893 + 53d0418 commit 69e7fc6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/org/havenapp/main/sensors/motion/Preview.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 69e7fc6

Please sign in to comment.