Fix app stuck and memory issues while uploading images (#2287)

* Do not use an image array to store all bitmap pixels at once

* Extract image preprocessing to a different service and use computation thread

* Add java docs

* Cleanup code to remove temp file logic

* Add logs in upload flow

* Fix tests

* Fix more tests
This commit is contained in:
Vivek Maskara 2019-01-16 22:02:25 +05:30 committed by neslihanturan
parent 21f82dd346
commit 559127dfa3
21 changed files with 320 additions and 891 deletions

View file

@ -52,7 +52,6 @@ import fr.free.nrw.commons.category.QueryContinue;
import fr.free.nrw.commons.kvstore.BasicKvStore;
import fr.free.nrw.commons.notification.Notification;
import fr.free.nrw.commons.notification.NotificationUtils;
import fr.free.nrw.commons.utils.ContributionUtils;
import fr.free.nrw.commons.utils.DateUtils;
import fr.free.nrw.commons.utils.ViewUtil;
import in.yuvi.http.fluent.Http;
@ -910,8 +909,6 @@ public class ApacheHttpClientMediaWikiApi implements MediaWikiApi {
}
return new UploadResult(resultStatus, errorCode);
} else {
// If success we have to remove file from temp directory
ContributionUtils.removeTemporaryFile(fileUri);
Date dateUploaded = parseMWDate(result.getString("/api/upload/imageinfo/@timestamp"));
String canonicalFilename = "File:" + result.getString("/api/upload/@filename").replace("_", " "); // Title vs Filename
String imageUrl = result.getString("/api/upload/imageinfo/@url");