Skip to content

Commit

Permalink
#169: ExifInterfaceEx Added setFactory() to allow swapping class impl…
Browse files Browse the repository at this point in the history
…ementation for create
  • Loading branch information
k3b committed Sep 17, 2020
1 parent fbdedf2 commit 1c6f767
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import de.k3b.LibGlobal;
import de.k3b.android.GuiUtil;
import de.k3b.android.androFotoFinder.imagedetail.HugeImageLoader;
import de.k3b.android.androFotoFinder.media.AndroidExifInterfaceEx;
import de.k3b.android.androFotoFinder.queries.DatabaseHelper;
import de.k3b.android.androFotoFinder.queries.FotoSql;
import de.k3b.android.androFotoFinder.queries.FotoSqlBase;
Expand Down Expand Up @@ -149,6 +150,7 @@ public static RefWatcher getRefWatcher(Context context) {
@Override public void onCreate() {
// StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyDialog().build());
// StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyDeath().build());
AndroidExifInterfaceEx.init();
FotoSqlBase.init();

super.onCreate();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package de.k3b.android.androFotoFinder.media;

import de.k3b.media.ExifInterfaceEx;

public class AndroidExifInterfaceEx extends ExifInterfaceEx {
public static void init() {
setFactory(new Factory() {
@Override
public ExifInterfaceEx create() {
return new AndroidExifInterfaceEx();
}
});
}
}
4 changes: 2 additions & 2 deletions fotolib2/src/main/java/de/k3b/media/ExifInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ protected void reset() {
}

/**
* false means this is no valid jpg format
* @return false means this is no valid jpg format
*/
public boolean isValidJpgExifFormat() {
return validJpgExifFormat;
Expand All @@ -823,7 +823,7 @@ public boolean isValidJpgExifFormat() {
* Returns the EXIF attribute of the specified tagName or {@code null} if there is no such tagName in
* the image file.
*
* @param tagName the name of the tagName.
* @param tagName the name of the tag exif tags to be returned.
*/
private ExifAttribute getExifAttribute(String tagName) {
if (mAttributes[0] != null) {
Expand Down

0 comments on commit 1c6f767

Please sign in to comment.