Added IPTC reader (#2383)

* graddle changes

* readfbmd class

* jar files

* added icafe

* gradle changes

* ReadFBMD

* recent commit

* commit changes

* commit changes

* fixed code quality issues

* optimised imports

* changes for  reviews

* not instantiating class

* removed irrelevant code

* added documentation

* modified test cases

* commit changes

* modified variable

* modified variable

* javadoc

* test changes

* removed .log file

* Show warning dialog for FBMD
This commit is contained in:
Vanshika Arora 2019-02-24 23:16:22 +05:30 committed by Vivek Maskara
parent 00b95ea9cf
commit 3a822d3c30
8 changed files with 125 additions and 18 deletions

View file

@ -34,10 +34,28 @@ import timber.log.Timber;
public class ImageUtils {
public static final int IMAGE_DARK = 1;
static final int IMAGE_BLURRY = 1 << 1;
/**
* Set 0th bit as 1 for dark image ie. 0001
*/
public static final int IMAGE_DARK = 1 << 0; // 1
/**
* Set 1st bit as 1 for blurry image ie. 0010
*/
static final int IMAGE_BLURRY = 1 << 1; // 2
/**
* Set 2nd bit as 1 for duplicate image ie. 0100
*/
public static final int IMAGE_DUPLICATE = 1 << 2; //4
public static final int IMAGE_GEOLOCATION_DIFFERENT = 1 << 3;
/**
* Set 3rd bit as 1 for image with different geo location ie. 1000
*/
public static final int IMAGE_GEOLOCATION_DIFFERENT = 1 << 3; //8
/**
* The parameter FILE_FBMD is returned from the class ReadFBMD if the uploaded image contains FBMD data else returns IMAGE_OK
* ie. 10000
*/
public static final int FILE_FBMD = 1 << 4;
public static final int IMAGE_OK = 0;
public static final int IMAGE_KEEP = -1;
public static final int IMAGE_WAIT = -2;
@ -214,11 +232,12 @@ public class ImageUtils {
}
}
/**
* Result variable is a result of an or operation of all possible problems. Ie. if result
* is 0001 means IMAGE_DARK
* if result is 1100 IMAGE_DUPLICATE and IMAGE_GEOLOCATION_DIFFERENT
*/
public static String getErrorMessageForResult(Context context, @Result int result) {
/**
* Result variable is a result of an or operation of all possible problems. Ie. if result
* is 0001 means IMAGE_DARK, if result is 1100 IMAGE_DUPLICATE and IMAGE_GEOLOCATION_DIFFERENT
*/
StringBuilder errorMessage = new StringBuilder();
if (result <= 0 ) {
Timber.d("No issues to warn user is found");
@ -243,6 +262,10 @@ public class ImageUtils {
errorMessage.append("\n - ").append(context.getResources().getString(R.string.upload_problem_different_geolocation));
}
if ((FILE_FBMD & result) != 0) {
errorMessage.append("\n - ").append(context.getResources().getString(R.string.upload_problem_fbmd));
}
errorMessage.append("\n\n").append(context.getResources().getString(R.string.upload_problem_do_you_continue));
}