Fix errors while making image quality checks (#2444)

This commit is contained in:
Vivek Maskara 2019-02-13 15:34:15 +05:30 committed by Josephine Lim
parent aee8839eea
commit d1e9b2f801

View file

@ -117,6 +117,7 @@ public class ImageProcessingService {
/**
* Checks for image geolocation
* returns IMAGE_OK if the place is null or if the file doesn't contain a geolocation
* @param filePath file to be checked
* @return IMAGE_GEOLOCATION_DIFFERENT or IMAGE_OK
*/
@ -127,6 +128,11 @@ public class ImageProcessingService {
}
return Single.fromCallable(() -> filePath)
.map(fileUtilsWrapper::getGeolocationOfFile)
.flatMap(geoLocation -> imageUtilsWrapper.checkImageGeolocationIsDifferent(geoLocation, place.getLocation()));
.flatMap(geoLocation -> {
if (StringUtils.isNullOrWhiteSpace(geoLocation)) {
return Single.just(ImageUtils.IMAGE_OK);
}
return imageUtilsWrapper.checkImageGeolocationIsDifferent(geoLocation, place.getLocation());
});
}
}