From 0ebaff76e78d3193f4028f5214129f594b223847 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 3 Feb 2021 17:02:39 +0100 Subject: [PATCH] Sample photos before load --- .../net/osmand/plus/mapcontextmenu/UploadPhotosAsyncTask.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/UploadPhotosAsyncTask.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/UploadPhotosAsyncTask.java index cf0587e06f..e552cb1373 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/UploadPhotosAsyncTask.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/UploadPhotosAsyncTask.java @@ -180,7 +180,9 @@ public class UploadPhotosAsyncTask extends AsyncTask { private byte[] compressImageToJpeg(InputStream image) { BufferedInputStream bufferedInputStream = new BufferedInputStream(image); - Bitmap bmp = BitmapFactory.decodeStream(bufferedInputStream); + BitmapFactory.Options opts = new BitmapFactory.Options(); + opts.inSampleSize = 4; + Bitmap bmp = BitmapFactory.decodeStream(bufferedInputStream, null, opts); ByteArrayOutputStream os = new ByteArrayOutputStream(); int h = bmp.getHeight(); int w = bmp.getWidth();