Fix upload tests (#2130)

This commit is contained in:
Vivek Maskara 2018-12-16 21:04:49 +05:30 committed by GitHub
parent 8c083f3dd5
commit f897af028a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 83 additions and 12 deletions

View file

@ -0,0 +1,22 @@
package fr.free.nrw.commons.utils;
import android.graphics.BitmapRegionDecoder;
import java.io.FileInputStream;
import java.io.IOException;
import javax.inject.Inject;
import javax.inject.Singleton;
@Singleton
public class BitmapRegionDecoderWrapper {
@Inject
public BitmapRegionDecoderWrapper() {
}
public BitmapRegionDecoder newInstance(FileInputStream file, boolean isSharable) throws IOException {
return BitmapRegionDecoder.newInstance(file, isSharable);
}
}

View file

@ -0,0 +1,25 @@
package fr.free.nrw.commons.utils;
import android.graphics.BitmapRegionDecoder;
import javax.inject.Inject;
import javax.inject.Singleton;
import static fr.free.nrw.commons.utils.ImageUtils.*;
@Singleton
public class ImageUtilsWrapper {
@Inject
public ImageUtilsWrapper() {
}
public @Result int checkIfImageIsTooDark(BitmapRegionDecoder bitmapRegionDecoder) {
return ImageUtils.checkIfImageIsTooDark(bitmapRegionDecoder);
}
public boolean checkImageGeolocationIsDifferent(String geolocationOfFileString, String wikidataItemLocationString) {
return ImageUtils.checkImageGeolocationIsDifferent(geolocationOfFileString, wikidataItemLocationString);
}
}