35
35
36
36
public class ImageUtils {
37
37
38
- public static final int IMAGE_DARK = 1 ;
39
- public static final int IMAGE_BLURRY = 1 << 1 ;
38
+ static final int IMAGE_DARK = 1 ;
39
+ static final int IMAGE_BLURRY = 1 << 1 ;
40
40
public static final int IMAGE_DUPLICATE = 1 << 2 ;
41
41
public static final int IMAGE_GEOLOCATION_DIFFERENT = 1 << 3 ;
42
42
public static final int IMAGE_OK = 0 ;
43
43
public static final int IMAGE_KEEP = -1 ;
44
44
public static final int IMAGE_WAIT = -2 ;
45
45
public static final int EMPTY_TITLE = -3 ;
46
46
public static final int FILE_NAME_EXISTS = -4 ;
47
- public static final int NO_CATEGORY_SELECTED = -5 ;
47
+ static final int NO_CATEGORY_SELECTED = -5 ;
48
48
49
49
@ IntDef (
50
50
flag = true ,
@@ -70,7 +70,7 @@ public class ImageUtils {
70
70
* @return IMAGE_OK if image is neither dark nor blurry or if the input bitmapRegionDecoder provided is null
71
71
* IMAGE_DARK if image is too dark
72
72
*/
73
- public static @ Result
73
+ static @ Result
74
74
int checkIfImageIsTooDark (BitmapRegionDecoder bitmapRegionDecoder ) {
75
75
if (bitmapRegionDecoder == null ) {
76
76
Timber .e ("Expected bitmapRegionDecoder was null" );
@@ -102,7 +102,7 @@ int checkIfImageIsTooDark(BitmapRegionDecoder bitmapRegionDecoder) {
102
102
* @return false if image is neither dark nor blurry or if the input bitmapRegionDecoder provided is null
103
103
* true if geolocation of the image and wikidata item are different
104
104
*/
105
- public static boolean checkImageGeolocationIsDifferent (String geolocationOfFileString , String wikidataItemLocationString ) {
105
+ static boolean checkImageGeolocationIsDifferent (String geolocationOfFileString , String wikidataItemLocationString ) {
106
106
Timber .d ("Comparing geolocation of file with nearby place location" );
107
107
if (geolocationOfFileString == null || geolocationOfFileString == "" ) { // Means that geolocation for this image is not given
108
108
return false ; // Since we don't know geolocation of file, we choose letting upload
@@ -114,11 +114,8 @@ public static boolean checkImageGeolocationIsDifferent(String geolocationOfFileS
114
114
Double distance = LengthUtils .computeDistanceBetween (
115
115
new LatLng (Double .parseDouble (geolocationOfFile [0 ]),Double .parseDouble (geolocationOfFile [1 ]),0 )
116
116
, new LatLng (Double .parseDouble (wikidataItemLocation [0 ]), Double .parseDouble (wikidataItemLocation [1 ]),0 ));
117
- if ( distance >= 1000 ) {// Distance is more than 1 km, means that geolocation is wrong
118
- return true ;
119
- } else {
120
- return false ;
121
- }
117
+ // Distance is more than 1 km, means that geolocation is wrong
118
+ return distance >= 1000 ;
122
119
}
123
120
124
121
private static boolean checkIfImageIsDark (Bitmap bitmap ) {
0 commit comments