mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 21:33:53 +01:00
Fix upload tests (#2130)
This commit is contained in:
parent
8c083f3dd5
commit
f897af028a
5 changed files with 83 additions and 12 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue