From 513f2a1cd13a335358e6c5618e4163534a06a6cb Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Fri, 2 Nov 2018 11:55:12 +0100
Subject: [PATCH 01/35] Prepare for addig lib
com.github.k3b.ToGoZip:libK3bZip:L2.0.15
---
app/src/main/res/values/donottranslate.xml | 2 +-
fotolib2/build.gradle | 5 +++++
fotolib2/src/main/java/de/k3b/io/DateUtil.java | 9 +++++----
fotolib2/src/main/java/de/k3b/io/ListUtils.java | 2 +-
4 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml
index 875bad4d..b71e7e6e 100644
--- a/app/src/main/res/values/donottranslate.xml
+++ b/app/src/main/res/values/donottranslate.xml
@@ -113,7 +113,7 @@ this program. If not, see
osmdroid library to display online maps from
Open Street Map
- Andrid Stringlate app to allow the app
+ Android Stringlate app to allow the app
user to thranslate this app to other gui-languages
mapsforge library to display offline maps
diff --git a/fotolib2/build.gradle b/fotolib2/build.gradle
index 222ab021..a55aada7 100644
--- a/fotolib2/build.gradle
+++ b/fotolib2/build.gradle
@@ -23,6 +23,11 @@ dependencies {
// https://github.com/drewnoakes/metadata-extractor/wiki/GettingStarted licence: http://www.apache.org/licenses/LICENSE-2.0
// 2.10.1 includes more recent xmpcore that generates java-8 bytecode not supported by android yet
compile ('com.drewnoakes:metadata-extractor:2.10.1') { transitive = false; } // 2.8.1
+
+ // https://jitpack.io/com/github/k3b/ToGoZip/L2.0.15/build.log
+ // https://jitpack.io/com/github/k3b/ToGoZip/libK3bZip/L2.0.15/
+ // implementation('com.github.k3b.ToGoZip:libK3bZip:L2.0.15') { transitive = false; }
+
}
// workaround because android-studio does not make the test resources available
diff --git a/fotolib2/src/main/java/de/k3b/io/DateUtil.java b/fotolib2/src/main/java/de/k3b/io/DateUtil.java
index fc7af937..624883d0 100644
--- a/fotolib2/src/main/java/de/k3b/io/DateUtil.java
+++ b/fotolib2/src/main/java/de/k3b/io/DateUtil.java
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2016-2018 by k3b.
*
- * This file is part of AndroFotoFinder / #APhotoManager.
+ * This file is part of AndroFotoFinder / #APhotoManager and toGoZip.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
@@ -33,9 +33,10 @@
*/
public class DateUtil {
- public static final DateFormat IsoDateTimeFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.ROOT);
- public static final DateFormat IsoDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.ROOT);
- public static final DateFormat IsoDateFormat2 = new SimpleDateFormat("yyyyMMdd", Locale.ROOT);
+ // cannot use Locale.ROOT because it requires api-9. this is api-7
+ public static final DateFormat IsoDateTimeFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US);
+ public static final DateFormat IsoDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
+ public static final DateFormat IsoDateFormat2 = new SimpleDateFormat("yyyyMMdd", Locale.US);
public static final TimeZone UTC = TimeZone.getTimeZone("UTC");
diff --git a/fotolib2/src/main/java/de/k3b/io/ListUtils.java b/fotolib2/src/main/java/de/k3b/io/ListUtils.java
index b7fb4009..d9b93bf6 100644
--- a/fotolib2/src/main/java/de/k3b/io/ListUtils.java
+++ b/fotolib2/src/main/java/de/k3b/io/ListUtils.java
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2017-2018 by k3b.
*
- * This file is part of AndroFotoFinder / #APhotoManager.
+ * This file is part of AndroFotoFinder / #APhotoManager and toGoZip.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
From e3d43e2499e53c1748afec332a51c8da04dc41bc Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Fri, 2 Nov 2018 16:00:40 +0100
Subject: [PATCH 02/35] refactored: renamed FotoLibGlobal to LibGlobal to have
common code with toGoZip project
---
.../androFotoFinder/AndroFotoFinderApp.java | 9 +++--
.../androFotoFinder/ExifEditActivity.java | 6 ++--
.../androFotoFinder/FotoGalleryActivity.java | 4 +--
.../GalleryFilterActivity.java | 6 ++--
.../androFotoFinder/SettingsActivity.java | 36 +++++++++----------
.../StringFormatResourceTests.java | 4 +--
.../directory/DirectoryPickerFragment.java | 4 +--
.../gallery/cursor/GalleryCursorFragment.java | 4 +--
.../androFotoFinder/queries/FotoSql.java | 12 +++----
.../android/androFotoFinder/tagDB/TagSql.java | 6 ++--
.../de/k3b/android/util/MediaScanner.java | 4 +--
.../k3b/android/widget/BaseQueryActivity.java | 4 +--
.../{FotoLibGlobal.java => LibGlobal.java} | 2 +-
.../src/main/java/de/k3b/io/DateUtil.java | 3 +-
.../java/de/k3b/io/DirectoryFormatter.java | 7 ++--
.../src/main/java/de/k3b/io/FileCommands.java | 30 ++++++++--------
.../src/main/java/de/k3b/io/FileUtils.java | 15 ++++----
.../de/k3b/io/GalleryFilterParameter.java | 4 +--
.../src/main/java/de/k3b/io/ListUtils.java | 3 +-
.../src/main/java/de/k3b/io/OSDirectory.java | 6 ++--
.../main/java/de/k3b/io/PhotoWorkFlowDto.java | 12 +++----
.../java/de/k3b/io/RuleFileNameProcessor.java | 4 +--
.../src/main/java/de/k3b/io/StringUtils.java | 7 ++--
.../src/main/java/de/k3b/io/VISIBILITY.java | 4 +--
.../java/de/k3b/media/ExifInterfaceEx.java | 16 ++++-----
.../java/de/k3b/media/ImageMetaReader.java | 8 ++---
.../java/de/k3b/media/JpgMetaWorkflow.java | 12 +++----
.../java/de/k3b/media/MediaXmpSegment.java | 12 +++----
.../java/de/k3b/media/MetaWriterExifXml.java | 22 ++++++------
.../main/java/de/k3b/media/XmpNamespace.java | 4 +--
.../main/java/de/k3b/media/XmpSegment.java | 4 +--
.../main/java/de/k3b/tagDB/TagRepository.java | 12 +++----
.../transactionlog/TransactionLogParser.java | 6 ++--
.../transactionlog/TransactionLoggerBase.java | 10 +++---
.../io/FileCommandAutoIntegrationTests.java | 8 ++---
.../ExifInterfaceExIntegrationTests.java | 6 ++--
.../media/ExifInterfaceIntegrationTests.java | 6 ++--
.../ImageMetaReaderIntegrationTests.java | 6 ++--
.../JpgMetaWorkflowIntegratoinTests.java | 12 +++----
.../MediaXmpSegmentIntegrationTests.java | 6 ++--
.../test/java/de/k3b/media/MediaXmpTests.java | 6 ++--
.../MetaWriterExifXmlIntegrationTests.java | 6 ++--
.../TransactionLogParserTests.java | 6 ++--
.../translations/TranslationStatistics.java | 3 +-
.../TranslationStatisticsTests.java | 5 +--
45 files changed, 187 insertions(+), 185 deletions(-)
rename fotolib2/src/main/java/de/k3b/{FotoLibGlobal.java => LibGlobal.java} (99%)
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java b/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java
index d1258624..5c85f272 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java
@@ -25,13 +25,12 @@
import android.util.Log;
import org.osmdroid.api.IMapView;
-import org.osmdroid.tileprovider.constants.OpenStreetMapTileProviderConstants;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.android.GuiUtil;
import de.k3b.android.androFotoFinder.imagedetail.HugeImageLoader;
import de.k3b.android.androFotoFinder.queries.FotoSql;
@@ -75,8 +74,8 @@ public static RefWatcher getRefWatcher(Context context) {
super.onCreate();
- FotoLibGlobal.appName = getString(R.string.app_name);
- FotoLibGlobal.appVersion = GuiUtil.getAppVersionName(this);
+ LibGlobal.appName = getString(R.string.app_name);
+ LibGlobal.appVersion = GuiUtil.getAppVersionName(this);
Global.pickHistoryFile = getDatabasePath("pickHistory.geouri.txt");
SettingsActivity.prefs2Global(this);
@@ -91,7 +90,7 @@ public static RefWatcher getRefWatcher(Context context) {
Collections.addAll(QueryParameter.sParserDefaultSelect, FotoSql.DEFAULT_GALLERY_COLUMNS);
mCrashSaveToFile = new LogCat(this, Global.LOG_CONTEXT, HugeImageLoader.LOG_TAG,
PhotoViewAttacher.LOG_TAG, CupcakeGestureDetector.LOG_TAG,
- FotoLibGlobal.LOG_TAG, ThumbNailUtils.LOG_TAG, IMapView.LOGTAG,
+ LibGlobal.LOG_TAG, ThumbNailUtils.LOG_TAG, IMapView.LOGTAG,
ExifInterface.LOG_TAG, ImageMetaReader.LOG_TAG);
ThumbNailUtils.init(this, null);
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/ExifEditActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/ExifEditActivity.java
index 82687f01..9c4eb353 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/ExifEditActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/ExifEditActivity.java
@@ -53,7 +53,7 @@
import java.util.Map;
import java.util.TimeZone;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.queries.FotoSql;
import de.k3b.android.androFotoFinder.tagDB.TagsPickerFragment;
import de.k3b.android.util.AndroidFileCommands;
@@ -315,10 +315,10 @@ private void saveGuiToExif(String function) {
// used to analyse error #91:.
private void debugChanges(String function) {
- if (FotoLibGlobal.debugEnabledJpgMetaIo){
+ if (LibGlobal.debugEnabledJpgMetaIo){
MediaDiffCopy diff = new MediaDiffCopy(true, true);
diff.setDiff(mInitialData, mCurrentData);
- Log.d(FotoLibGlobal.LOG_TAG, mDebugPrefix + " "
+ Log.d(LibGlobal.LOG_TAG, mDebugPrefix + " "
+ function + "\n\t"
+ diff + "\n\t"
+ SETTINGS_KEY_INITIAL + "=" + mInitialData.toString() + ";\n\t"
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/FotoGalleryActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/FotoGalleryActivity.java
index 59a1f848..41ca82d3 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/FotoGalleryActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/FotoGalleryActivity.java
@@ -31,7 +31,7 @@
import android.view.MenuInflater;
import android.view.MenuItem;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.directory.DirectoryGui;
import de.k3b.android.androFotoFinder.gallery.cursor.GalleryCursorFragment;
import de.k3b.android.androFotoFinder.imagedetail.ImageDetailActivityViewPager;
@@ -96,7 +96,7 @@ protected void onCreate(Bundle savedInstanceState) {
if (BuildConfig.DEBUG) {
// not implemented yet
- FotoLibGlobal.itpcWriteSupport = false;
+ LibGlobal.itpcWriteSupport = false;
}
if (Global.debugEnabled && (intent != null)) {
Log.d(Global.LOG_CONTEXT, mDebugPrefix + "onCreate " + intent.toUri(Intent.URI_INTENT_SCHEME));
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/GalleryFilterActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/GalleryFilterActivity.java
index b636310a..5a0e00dd 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/GalleryFilterActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/GalleryFilterActivity.java
@@ -44,7 +44,7 @@
import java.util.List;
import java.util.Locale;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.directory.DirectoryLoaderTask;
import de.k3b.android.androFotoFinder.directory.DirectoryPickerFragment;
import de.k3b.android.androFotoFinder.imagedetail.ImageDetailMetaDialogBuilder;
@@ -210,7 +210,7 @@ public void onClick(View v) {
showDirectoryPickerForFilterParamValue(
mDebugPrefix + " date picker " + path,
FotoSql.queryGroupByDate, false,
- FotoLibGlobal.datePickerUseDecade, path);
+ LibGlobal.datePickerUseDecade, path);
}
});
cmd = (Button) findViewById(R.id.cmd_select_lat_lon);
@@ -466,7 +466,7 @@ public void onClick(View v) {
protected void showVisibility(VISIBILITY visibility) {
VISIBILITY actualVisibility = visibility;
if (actualVisibility == VISIBILITY.DEFAULT) {
- actualVisibility = (FotoLibGlobal.visibilityShowPrivateByDefault) ? VISIBILITY.PRIVATE_PUBLIC : VISIBILITY.PUBLIC;
+ actualVisibility = (LibGlobal.visibilityShowPrivateByDefault) ? VISIBILITY.PRIVATE_PUBLIC : VISIBILITY.PUBLIC;
}
switch (actualVisibility) {
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java
index bcd59931..2ebc125e 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java
@@ -36,11 +36,9 @@
import android.view.Display;
import android.widget.Toast;
-import org.osmdroid.tileprovider.constants.OpenStreetMapTileProviderConstants;
-
import java.io.File;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.imagedetail.HugeImageLoader;
import de.k3b.android.util.MediaScanner;
import de.k3b.android.util.MediaScannerExifInterface;
@@ -98,12 +96,12 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
mediaUpdateStrategyPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
- FotoLibGlobal.mediaUpdateStrategy = (String) newValue;
- setPref(FotoLibGlobal.mediaUpdateStrategy, mediaUpdateStrategyPreference, R.array.pref_media_update_strategy_names);
+ LibGlobal.mediaUpdateStrategy = (String) newValue;
+ setPref(LibGlobal.mediaUpdateStrategy, mediaUpdateStrategyPreference, R.array.pref_media_update_strategy_names);
return true;
}
});
- setPref(FotoLibGlobal.mediaUpdateStrategy, mediaUpdateStrategyPreference, R.array.pref_media_update_strategy_names);
+ setPref(LibGlobal.mediaUpdateStrategy, mediaUpdateStrategyPreference, R.array.pref_media_update_strategy_names);
findPreference("debugClearLog").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
@@ -151,13 +149,13 @@ public static void global2Prefs(Context context) {
prefs.putBoolean("debugEnabledMemory", Global.debugEnabledMemory);
- prefs.putBoolean("datePickerUseDecade", FotoLibGlobal.datePickerUseDecade);
+ prefs.putBoolean("datePickerUseDecade", LibGlobal.datePickerUseDecade);
- prefs.putBoolean("debugEnabledJpgMetaIo", FotoLibGlobal.debugEnabledJpgMetaIo);
- prefs.putBoolean("debugEnabledJpg", FotoLibGlobal.debugEnabledJpg);
+ prefs.putBoolean("debugEnabledJpgMetaIo", LibGlobal.debugEnabledJpgMetaIo);
+ prefs.putBoolean("debugEnabledJpg", LibGlobal.debugEnabledJpg);
/** #100: true: private images get the extension ".jpg-p" which hides them from other gallery-apps and image pickers. */
- prefs.putBoolean("renamePrivateJpg", FotoLibGlobal.renamePrivateJpg);
+ prefs.putBoolean("renamePrivateJpg", LibGlobal.renamePrivateJpg);
// #26
prefs.putBoolean("initialImageDetailResolutionHigh", Global.initialImageDetailResolutionHigh);
@@ -165,7 +163,7 @@ public static void global2Prefs(Context context) {
prefs.putBoolean("debugEnableLibs", PhotoViewAttacher.DEBUG);
prefs.putBoolean("clearSelectionAfterCommand", Global.clearSelectionAfterCommand);
- prefs.putBoolean("xmp_file_schema_long", FotoLibGlobal.preferLongXmpFormat);
+ prefs.putBoolean("xmp_file_schema_long", LibGlobal.preferLongXmpFormat);
prefs.putBoolean("mapsForgeEnabled", Global.mapsForgeEnabled);
@@ -185,7 +183,7 @@ public static void global2Prefs(Context context) {
prefs.putString("pickHistoryFile", (Global.pickHistoryFile != null) ? Global.pickHistoryFile.getAbsolutePath() : null);
- prefs.putString("mediaUpdateStrategy", FotoLibGlobal.mediaUpdateStrategy);
+ prefs.putString("mediaUpdateStrategy", LibGlobal.mediaUpdateStrategy);
prefs.apply();
@@ -198,7 +196,7 @@ public static void prefs2Global(Context context) {
final SharedPreferences prefs = PreferenceManager
.getDefaultSharedPreferences(context.getApplicationContext());
Global.debugEnabled = getPref(prefs, "debugEnabled", Global.debugEnabled);
- FotoLibGlobal.debugEnabled = Global.debugEnabled;
+ LibGlobal.debugEnabled = Global.debugEnabled;
Global.debugEnabledViewItem = getPref(prefs, "debugEnabledViewItem", Global.debugEnabledViewItem);
Global.debugEnabledSql = getPref(prefs, "debugEnabledSql", Global.debugEnabledSql);
@@ -207,16 +205,16 @@ public static void prefs2Global(Context context) {
Global.debugEnabledMemory = getPref(prefs, "debugEnabledMemory", Global.debugEnabledMemory);
- FotoLibGlobal.datePickerUseDecade = getPref(prefs, "datePickerUseDecade", FotoLibGlobal.datePickerUseDecade);
+ LibGlobal.datePickerUseDecade = getPref(prefs, "datePickerUseDecade", LibGlobal.datePickerUseDecade);
Global.locked = getPref(prefs, "locked", Global.locked);
Global.passwordHash = getPref(prefs, "passwordHash", Global.passwordHash);
- FotoLibGlobal.debugEnabledJpg = getPref(prefs, "debugEnabledJpg", FotoLibGlobal.debugEnabledJpg);
- FotoLibGlobal.debugEnabledJpgMetaIo = getPref(prefs, "debugEnabledJpgMetaIo", FotoLibGlobal.debugEnabledJpgMetaIo);
+ LibGlobal.debugEnabledJpg = getPref(prefs, "debugEnabledJpg", LibGlobal.debugEnabledJpg);
+ LibGlobal.debugEnabledJpgMetaIo = getPref(prefs, "debugEnabledJpgMetaIo", LibGlobal.debugEnabledJpgMetaIo);
/** #100: true: private images get the extension ".jpg-p" which hides them from other gallery-apps and image pickers. */
- FotoLibGlobal.renamePrivateJpg = getPref(prefs, "renamePrivateJpg", FotoLibGlobal.renamePrivateJpg);
+ LibGlobal.renamePrivateJpg = getPref(prefs, "renamePrivateJpg", LibGlobal.renamePrivateJpg);
// one setting for several 3d party debug-flags
boolean debug3rdParty = getPref(prefs, "debugEnableLibs", PhotoViewAttacher.DEBUG);
@@ -236,7 +234,7 @@ public static void prefs2Global(Context context) {
Global.initialImageDetailResolutionHigh = getPref(prefs, "initialImageDetailResolutionHigh", Global.initialImageDetailResolutionHigh);
Global.clearSelectionAfterCommand = getPref(prefs, "clearSelectionAfterCommand", Global.clearSelectionAfterCommand);
- FotoLibGlobal.preferLongXmpFormat = getPref(prefs, "xmp_file_schema_long", FotoLibGlobal.preferLongXmpFormat);
+ LibGlobal.preferLongXmpFormat = getPref(prefs, "xmp_file_schema_long", LibGlobal.preferLongXmpFormat);
Global.mapsForgeEnabled = getPref(prefs, "mapsForgeEnabled", Global.mapsForgeEnabled);
@@ -257,7 +255,7 @@ public static void prefs2Global(Context context) {
Global.pickHistoryFile = getPref(prefs, "pickHistoryFile", Global.pickHistoryFile);
- FotoLibGlobal.mediaUpdateStrategy = getPref(prefs, "mediaUpdateStrategy", FotoLibGlobal.mediaUpdateStrategy);
+ LibGlobal.mediaUpdateStrategy = getPref(prefs, "mediaUpdateStrategy", LibGlobal.mediaUpdateStrategy);
/*
// bool
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/StringFormatResourceTests.java b/app/src/main/java/de/k3b/android/androFotoFinder/StringFormatResourceTests.java
index 09189be1..eb222d7b 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/StringFormatResourceTests.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/StringFormatResourceTests.java
@@ -3,7 +3,7 @@
import android.content.Context;
import android.util.Log;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.android.util.AndroidFileCommands;
import de.k3b.io.ListUtils;
@@ -14,7 +14,7 @@
*/
public class StringFormatResourceTests {
public static void test(Context context) {
- if (Global.debugEnabled && FotoLibGlobal.debugEnabled)
+ if (Global.debugEnabled && LibGlobal.debugEnabled)
Log.i(Global.LOG_CONTEXT,ListUtils.toString("\n\t"
,"testing some translations with parameters"
,AndroFotoFinderApp.getBookMarkComment(context)
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/directory/DirectoryPickerFragment.java b/app/src/main/java/de/k3b/android/androFotoFinder/directory/DirectoryPickerFragment.java
index 263d5521..3f14361b 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/directory/DirectoryPickerFragment.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/directory/DirectoryPickerFragment.java
@@ -50,7 +50,7 @@
import android.widget.TextView;
import android.widget.Toast;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.FotoGalleryActivity;
import de.k3b.android.androFotoFinder.PhotoAutoprocessingEditActivity;
import de.k3b.android.androFotoFinder.ThumbNailUtils;
@@ -368,7 +368,7 @@ private PopupMenu onCreatePopupMenu(View anchor, IDirectory selection) {
setMenuVisibility(menu, R.id.cmd_fix_link, FileUtils.isSymlinkDir(new File(absoluteSelectedPath), false));
setMenuVisibility(menu, R.id.cmd_folder_hide_images, !isAlbumFile && MediaScanner.canHideFolderMedia(absoluteSelectedPath));
- setMenuVisibility(menu, R.id.cmd_apm_edit, !isAlbumFile && FotoLibGlobal.apmEnabled);
+ setMenuVisibility(menu, R.id.cmd_apm_edit, !isAlbumFile && LibGlobal.apmEnabled);
setMenuVisibility(menu, R.id.cmd_filemanager, !isAlbumFile && FileManagerUtil.hasShowInFilemanager(getActivity(), absoluteSelectedPath));
setMenuVisibility(menu, R.id.cmd_delete, isAlbumFile);
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java b/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java
index 913259ec..f0dd3da3 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java
@@ -53,7 +53,7 @@
import java.util.ArrayList;
import java.util.List;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.AffUtils;
import de.k3b.android.androFotoFinder.Common;
import de.k3b.android.androFotoFinder.ExifEditActivity;
@@ -1420,7 +1420,7 @@ private boolean multiSelectionHandleClick(GalleryCursorAdapter.GridCellViewHolde
}
private void fix() {
- if (((mRequeryInstanceCount > 2) && (FotoLibGlobal.itpcWriteSupport))) {
+ if (((mRequeryInstanceCount > 2) && (LibGlobal.itpcWriteSupport))) {
View iptc = ResourceUtils.findLast(this.mGalleryView.getRootView(), "ads");
if (iptc != null) {
((ViewGroup) iptc.getParent()).removeView(iptc);
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java
index bb88513d..ee853eaa 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java
@@ -42,7 +42,7 @@
import java.util.List;
import java.util.Map;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.Global;
import de.k3b.android.androFotoFinder.R;
import de.k3b.android.util.DBUtils;
@@ -983,7 +983,7 @@ protected static int exexUpdateImpl(String dbgContext, Context context, ContentV
} catch (Exception ex) {
excpetion = ex;
} finally {
- if ((excpetion != null) || ((dbgContext != null) && (Global.debugEnabledSql || FotoLibGlobal.debugEnabledJpg))) {
+ if ((excpetion != null) || ((dbgContext != null) && (Global.debugEnabledSql || LibGlobal.debugEnabledJpg))) {
Log.i(Global.LOG_CONTEXT, dbgContext + ":FotoSql.exexUpdate " + excpetion + "\n" +
QueryParameter.toString(null, values.toString(), SQL_TABLE_EXTERNAL_CONTENT_URI_FILE_NAME,
sqlWhere, selectionArgs, null, result), excpetion);
@@ -1033,7 +1033,7 @@ public static Uri execInsert(String dbgContext, Context context, ContentValues v
} catch (Exception ex) {
excpetion = ex;
} finally {
- if ((excpetion != null) || Global.debugEnabledSql || FotoLibGlobal.debugEnabledJpg) {
+ if ((excpetion != null) || Global.debugEnabledSql || LibGlobal.debugEnabledJpg) {
Log.i(Global.LOG_CONTEXT, dbgContext + ":FotoSql.execInsert " + excpetion + " " +
values.toString() + " => " + result + " " + excpetion, excpetion);
}
@@ -1101,7 +1101,7 @@ public static int deleteMedia(String dbgContext, Context context, String where,
lastSelectionArgs = null;
delCount = context.getContentResolver()
.delete(SQL_TABLE_EXTERNAL_CONTENT_URI_FILE, lastUsedWhereClause, lastSelectionArgs);
- if (Global.debugEnabledSql || FotoLibGlobal.debugEnabledJpg) {
+ if (Global.debugEnabledSql || LibGlobal.debugEnabledJpg) {
Log.i(Global.LOG_CONTEXT, dbgContext + "-b: FotoSql.deleteMedia delete\n" +
QueryParameter.toString(null, null, SQL_TABLE_EXTERNAL_CONTENT_URI_FILE_NAME,
lastUsedWhereClause, lastSelectionArgs, null, delCount));
@@ -1109,7 +1109,7 @@ public static int deleteMedia(String dbgContext, Context context, String where,
} else {
delCount = context.getContentResolver()
.delete(SQL_TABLE_EXTERNAL_CONTENT_URI_FILE, lastUsedWhereClause, lastSelectionArgs);
- if (Global.debugEnabledSql || FotoLibGlobal.debugEnabledJpg) {
+ if (Global.debugEnabledSql || LibGlobal.debugEnabledJpg) {
Log.i(Global.LOG_CONTEXT, dbgContext +": FotoSql.deleteMedia\ndelete " +
QueryParameter.toString(null, null,
SQL_TABLE_EXTERNAL_CONTENT_URI_FILE_NAME,
@@ -1289,7 +1289,7 @@ protected static String getFilterExpressionVisibility(VISIBILITY _visibility) {
VISIBILITY visibility = _visibility;
// add visibility column only if not included yet
if (visibility == VISIBILITY.DEFAULT) {
- visibility = (FotoLibGlobal.visibilityShowPrivateByDefault)
+ visibility = (LibGlobal.visibilityShowPrivateByDefault)
? VISIBILITY.PRIVATE_PUBLIC
: VISIBILITY.PUBLIC;
}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagSql.java b/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagSql.java
index b15fd3c4..18daf866 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagSql.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagSql.java
@@ -32,7 +32,7 @@
import java.util.Date;
import java.util.List;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.Global;
import de.k3b.android.androFotoFinder.media.MediaContentValues;
import de.k3b.android.androFotoFinder.queries.AndroidAlbumUtils;
@@ -269,7 +269,7 @@ public static int fixPrivate(Context context) {
.append(TagSql.FILTER_EXPR_PUBLIC)
.append(" AND (")
.append(TagSql.FILTER_EXPR_TAGS_INCLUDED);
- if (FotoLibGlobal.renamePrivateJpg) {
+ if (LibGlobal.renamePrivateJpg) {
where.append(" OR ").append(TagSql.FILTER_EXPR_PATH_LIKE.replace("?","'%" +
MediaUtil.IMG_TYPE_PRIVATE + "'"));
}
@@ -362,7 +362,7 @@ public static int updateDB(String dbgContext, Context context, String oldFullJpg
final int modifiedColumCout = MediaUtil.copyNonEmpty(mediaValueAdapter.set(dbValues, null), jpg, allowSetNulls);
if (modifiedColumCout >= 1) {
String newFullJpgFilePath = null;
- if (FotoLibGlobal.renamePrivateJpg) {
+ if (LibGlobal.renamePrivateJpg) {
newFullJpgFilePath = MediaUtil.getModifiedPath(jpg);
}
diff --git a/app/src/main/java/de/k3b/android/util/MediaScanner.java b/app/src/main/java/de/k3b/android/util/MediaScanner.java
index 002f97f4..06f19bb3 100644
--- a/app/src/main/java/de/k3b/android/util/MediaScanner.java
+++ b/app/src/main/java/de/k3b/android/util/MediaScanner.java
@@ -41,7 +41,7 @@
import java.util.List;
import java.util.Map;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.Global;
import de.k3b.android.androFotoFinder.media.MediaContentValues;
import de.k3b.android.androFotoFinder.queries.FotoSql;
@@ -360,7 +360,7 @@ protected MediaContentValues getExifFromFile(ContentValues values, File jpgFile)
src = xmpContent;
} else {
// (!writeExif) prefer read from xmp value before exif value
- src = (FotoLibGlobal.mediaUpdateStrategy.contains("J"))
+ src = (LibGlobal.mediaUpdateStrategy.contains("J"))
? exif
: new MetaApiChainReader(xmpContent, exif);
}
diff --git a/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java b/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java
index 1d383deb..d3e387a7 100644
--- a/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java
+++ b/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java
@@ -40,7 +40,7 @@
import java.util.Date;
import java.util.List;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.Common;
import de.k3b.android.androFotoFinder.GalleryFilterActivity;
import de.k3b.android.androFotoFinder.GalleryFilterPathState;
@@ -566,7 +566,7 @@ private void openPicker(final int filterMode, int _dirQueryID) {
this.mMustShowNavigator = true;
mergedBaseQuery.setID(dirQueryID);
- DirectoryLoaderTask loader = new DirectoryLoaderTask(context, loadDate ? FotoLibGlobal.datePickerUseDecade : false,
+ DirectoryLoaderTask loader = new DirectoryLoaderTask(context, loadDate ? LibGlobal.datePickerUseDecade : false,
mDebugPrefix + " from openPicker(loadDate=" +
loadDate + ")") {
@Override
diff --git a/fotolib2/src/main/java/de/k3b/FotoLibGlobal.java b/fotolib2/src/main/java/de/k3b/LibGlobal.java
similarity index 99%
rename from fotolib2/src/main/java/de/k3b/FotoLibGlobal.java
rename to fotolib2/src/main/java/de/k3b/LibGlobal.java
index ab81f6ac..96115f37 100644
--- a/fotolib2/src/main/java/de/k3b/FotoLibGlobal.java
+++ b/fotolib2/src/main/java/de/k3b/LibGlobal.java
@@ -23,7 +23,7 @@
* Public Global stuff for the lib.
* Created by k3b on 03.03.2016.
*/
-public class FotoLibGlobal {
+public class LibGlobal {
/** LOG_CONTEXT is used as logging source for filtering logging messages that belong to this */
public static final String LOG_TAG = "k3bFotoLib2";
diff --git a/fotolib2/src/main/java/de/k3b/io/DateUtil.java b/fotolib2/src/main/java/de/k3b/io/DateUtil.java
index 624883d0..0b1269e6 100644
--- a/fotolib2/src/main/java/de/k3b/io/DateUtil.java
+++ b/fotolib2/src/main/java/de/k3b/io/DateUtil.java
@@ -1,7 +1,8 @@
/*
* Copyright (c) 2016-2018 by k3b.
*
- * This file is part of AndroFotoFinder / #APhotoManager and toGoZip.
+ * This file is part of #APhotoManager (https://github.com/k3b/APhotoManager/)
+ * and #toGoZip (https://github.com/k3b/ToGoZip/).
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
diff --git a/fotolib2/src/main/java/de/k3b/io/DirectoryFormatter.java b/fotolib2/src/main/java/de/k3b/io/DirectoryFormatter.java
index 375815b3..bd26cfd3 100644
--- a/fotolib2/src/main/java/de/k3b/io/DirectoryFormatter.java
+++ b/fotolib2/src/main/java/de/k3b/io/DirectoryFormatter.java
@@ -25,9 +25,8 @@
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;
-import java.util.TimeZone;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
/**
* Created by k3b on 12.07.2015.
@@ -44,7 +43,7 @@ public static void getDates(String selectedAbsolutePath, Date from, Date to) {
Integer year = null;
Integer month = null;
Integer day = null;
- Integer decade = (FotoLibGlobal.datePickerUseDecade) ? null : Integer.MIN_VALUE;
+ Integer decade = (LibGlobal.datePickerUseDecade) ? null : Integer.MIN_VALUE;
String parts[] = selectedAbsolutePath.split(Directory.PATH_DELIMITER);
@@ -66,7 +65,7 @@ public static void getDates(String selectedAbsolutePath, Date from, Date to) {
}
int yearFrom = 0;
- if ((FotoLibGlobal.datePickerUseDecade) && (decade != null)) yearFrom = decade.intValue();
+ if ((LibGlobal.datePickerUseDecade) && (decade != null)) yearFrom = decade.intValue();
if (year != null) yearFrom = year.intValue();
if (yearFrom != 0) {
diff --git a/fotolib2/src/main/java/de/k3b/io/FileCommands.java b/fotolib2/src/main/java/de/k3b/io/FileCommands.java
index 9a71ce08..86b34c54 100644
--- a/fotolib2/src/main/java/de/k3b/io/FileCommands.java
+++ b/fotolib2/src/main/java/de/k3b/io/FileCommands.java
@@ -31,7 +31,7 @@
import java.util.ArrayList;
import java.util.Date;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.io.collections.DestDirFileNameProcessor;
import de.k3b.io.collections.SelectedFiles;
import de.k3b.media.IMetaApi;
@@ -52,7 +52,7 @@
* Created by k3b on 03.08.2015.
*/
public class FileCommands extends FileProcessor implements Cloneable, IProgessListener {
- private static final Logger logger = LoggerFactory.getLogger(FotoLibGlobal.LOG_TAG);
+ private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
public static final int OP_COPY = 1;
public static final int OP_MOVE = 2;
@@ -79,14 +79,14 @@ public int deleteFiles(SelectedFiles fotos, IProgessListener progessListener) {
this.progessListener = progessListener;
try {
long startTimestamp = 0;
- if (FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (LibGlobal.debugEnabledJpgMetaIo) {
startTimestamp = new Date().getTime();
}
String[] fileNames = fotos.getFileNames();
long now = new Date().getTime();
- int itemsPerProgress = FotoLibGlobal.itemsPerProgress;
+ int itemsPerProgress = LibGlobal.itemsPerProgress;
int itemcount = 0;
int countdown = 0;
int maxCount = fotos.size();
@@ -107,7 +107,7 @@ public int deleteFiles(SelectedFiles fotos, IProgessListener progessListener) {
}
}
onPostProcess(dbgContext, OP_DELETE, fotos, deleteCount, fileNames.length, fileNames, null);
- if (FotoLibGlobal.debugEnabledJpg || FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (LibGlobal.debugEnabledJpg || LibGlobal.debugEnabledJpgMetaIo) {
long dbgLoadEndTimestamp = new Date().getTime();
FileCommands.logger.debug(dbgContext + " process items:" + deleteCount
@@ -177,7 +177,7 @@ public int applyExifChanges(boolean move, MediaDiffCopy exifChanges, SelectedFil
* @param destDirFolder where files are moved/copied to
* @param progessListener */
public int moveOrCopyFilesTo(boolean move, SelectedFiles selectedFiles, File destDirFolder, IProgessListener progessListener) {
- PhotoWorkFlowDto autoProccessData = (!FotoLibGlobal.apmEnabled) ? null : getPhotoWorkFlowDto(destDirFolder);
+ PhotoWorkFlowDto autoProccessData = (!LibGlobal.apmEnabled) ? null : getPhotoWorkFlowDto(destDirFolder);
return moveOrCopyFilesTo(move, selectedFiles, destDirFolder, autoProccessData, progessListener);
}
@@ -243,7 +243,7 @@ protected int moveOrCopyFiles(final boolean move, String what, MediaDiffCopy exi
SelectedFiles fotos, File[] destFiles,
IProgessListener progessListener) {
long startTimestamp = 0;
- if (FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (LibGlobal.debugEnabledJpgMetaIo) {
startTimestamp = new Date().getTime();
}
@@ -263,7 +263,7 @@ protected int moveOrCopyFiles(final boolean move, String what, MediaDiffCopy exi
mModifiedSrcFiles = (move) ? new ArrayList() : null;
mModifiedDestFiles = new ArrayList();
- int itemsPerProgress = FotoLibGlobal.itemsPerProgress;
+ int itemsPerProgress = LibGlobal.itemsPerProgress;
int itemcount = 0;
int countdown = 0;
int maxCount = fotos.size();
@@ -353,7 +353,7 @@ protected int moveOrCopyFiles(final boolean move, String what, MediaDiffCopy exi
String[] modifiedDestFiles = (modifyCount > 0) ? mModifiedDestFiles.toArray(new String[modifyCount]) : null;
onPostProcess(what, opCode, fotos, itemCount, sourceFiles.length, modifiedSourceFiles, modifiedDestFiles);
- if (FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (LibGlobal.debugEnabledJpgMetaIo) {
long dbgLoadEndTimestamp = new Date().getTime();
FileCommands.logger.debug(what + " process items:" + itemCount
@@ -444,7 +444,7 @@ private void addProcessedFiles(boolean move, File dest, File source) {
protected boolean osFileMove(File dest, File source) {
if (source.renameTo(dest)) {
// move within same mountpoint
- if (FotoLibGlobal.debugEnabledJpg) {
+ if (LibGlobal.debugEnabledJpg) {
logger.info("osFileMove(rename) '" + source
+ "' => '" + dest + "'");
}
@@ -457,14 +457,14 @@ protected boolean osFileMove(File dest, File source) {
&& !osFileExists(dest)
&& osFileCopy(dest, source)) {
if (osDeleteFile(source)) {
- if (FotoLibGlobal.debugEnabledJpg) {
+ if (LibGlobal.debugEnabledJpg) {
logger.info("osFileMove(copy+delete) '" + source
+ "' => '" + dest + "'");
}
return true; // move: copy + delete(source) : success
} else {
// cannot delete souce: undo copy
- if (FotoLibGlobal.debugEnabledJpg) {
+ if (LibGlobal.debugEnabledJpg) {
logger.info("osFileMove failed for '" + source
+ "' => '" + dest + "'");
}
@@ -512,7 +512,7 @@ private static boolean _osFileCopy(File targetFullPath, File sourceFullPath, Fil
FileUtils.close(in,"_osFileCopy-close");
FileUtils.close(out,"_osFileCopy-close");
}
- if (FotoLibGlobal.debugEnabledJpg) {
+ if (LibGlobal.debugEnabledJpg) {
logger.info("osFileCopy '" + sourceFullPath
+ "' => '" + targetFullPath + "' success=" + result);
}
@@ -522,7 +522,7 @@ private static boolean _osFileCopy(File targetFullPath, File sourceFullPath, Fil
/** to be replaced by mock/stub in unittests */
protected boolean osDeleteFile(File file) {
final boolean result = file.delete();
- if (FotoLibGlobal.debugEnabledJpg) logger.info("osDeleteFile '" + file + "' success=" + result);
+ if (LibGlobal.debugEnabledJpg) logger.info("osDeleteFile '" + file + "' success=" + result);
return result;
}
@@ -550,7 +550,7 @@ public void addTransactionLog(
MediaTransactionLogEntryDto dto = new MediaTransactionLogEntryDto(currentMediaID, fileFullPath, modificationDate,
mediaTransactionLogEntryType, commandData);
- if (FotoLibGlobal.debugEnabledJpg) {
+ if (LibGlobal.debugEnabledJpg) {
logger.info(getClass().getSimpleName() + ".addTransactionLog(" + dto.toString() + ")");
}
this.log(mediaTransactionLogEntryType.getCommand(fileFullPath, commandData));
diff --git a/fotolib2/src/main/java/de/k3b/io/FileUtils.java b/fotolib2/src/main/java/de/k3b/io/FileUtils.java
index 8f2b2103..85511ba0 100644
--- a/fotolib2/src/main/java/de/k3b/io/FileUtils.java
+++ b/fotolib2/src/main/java/de/k3b/io/FileUtils.java
@@ -1,7 +1,8 @@
/*
* Copyright (c) 2015-2018 by k3b.
*
- * This file is part of AndroFotoFinder / #APhotoManager.
+ * This file is part of #APhotoManager (https://github.com/k3b/APhotoManager/)
+ * and #toGoZip (https://github.com/k3b/ToGoZip/).
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
@@ -36,14 +37,14 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
/**
* Created by k3b on 06.10.2015.
*/
public class FileUtils {
- private static final Logger logger = LoggerFactory.getLogger(FotoLibGlobal.LOG_TAG);
+ private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
private static final String DBG_CONTEXT = "FileUtils:";
public static final String MEDIA_IGNORE_FILENAME = ".nomedia"; // MediaStore.MEDIA_IGNORE_FILENAME;
@@ -123,7 +124,7 @@ public static String tryGetCanonicalPath(File file, String errorValue) {
/** @return true if directory is an alias of an other (symlink-dir). */
public static boolean isSymlinkDir(File directory, boolean errorValue) {
- if (FotoLibGlobal.ignoreSymLinks || (directory == null)) {
+ if (LibGlobal.ignoreSymLinks || (directory == null)) {
return false;
}
@@ -131,7 +132,7 @@ public static boolean isSymlinkDir(File directory, boolean errorValue) {
String canonicalPath = tryGetCanonicalPath(directory, null);
if (canonicalPath != null) {
boolean result = !directory.getAbsolutePath().equals(canonicalPath);
- if (result && FotoLibGlobal.debugEnabled) {
+ if (result && LibGlobal.debugEnabled) {
logger.debug(DBG_CONTEXT + "isSymlinkDir('" + directory.getAbsolutePath() + "') => true because CanonicalPath='" + canonicalPath + "'");
}
@@ -238,7 +239,7 @@ public static void delete(File file, final String fileExt) {
String path = file.getAbsolutePath();
if(fileExt == null || path.endsWith(fileExt)) {
boolean result = file.delete();
- if (FotoLibGlobal.debugEnabled) {
+ if (LibGlobal.debugEnabled) {
// test if delete of file is success or not
if (result) {
logger.info(DBG_CONTEXT + "File {} deleted", file.getAbsolutePath());
@@ -249,7 +250,7 @@ public static void delete(File file, final String fileExt) {
}
}
} else {
- if (FotoLibGlobal.debugEnabled) logger.info(DBG_CONTEXT + "File {} doesn't exist", file.getAbsolutePath());
+ if (LibGlobal.debugEnabled) logger.info(DBG_CONTEXT + "File {} doesn't exist", file.getAbsolutePath());
}
}
diff --git a/fotolib2/src/main/java/de/k3b/io/GalleryFilterParameter.java b/fotolib2/src/main/java/de/k3b/io/GalleryFilterParameter.java
index 22104b72..896bd2e7 100644
--- a/fotolib2/src/main/java/de/k3b/io/GalleryFilterParameter.java
+++ b/fotolib2/src/main/java/de/k3b/io/GalleryFilterParameter.java
@@ -26,7 +26,7 @@
import java.util.Arrays;
import java.util.List;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.io.collections.SelectedItems;
/**
@@ -399,6 +399,6 @@ public int getRatingMin() {
/** get Date Min/Max in date picker compatible format */
public String getDatePath() {
- return DirectoryFormatter.getDatePath(FotoLibGlobal.datePickerUseDecade, getDateMin(), getDateMax());
+ return DirectoryFormatter.getDatePath(LibGlobal.datePickerUseDecade, getDateMin(), getDateMax());
}
}
diff --git a/fotolib2/src/main/java/de/k3b/io/ListUtils.java b/fotolib2/src/main/java/de/k3b/io/ListUtils.java
index d9b93bf6..7a083330 100644
--- a/fotolib2/src/main/java/de/k3b/io/ListUtils.java
+++ b/fotolib2/src/main/java/de/k3b/io/ListUtils.java
@@ -1,7 +1,8 @@
/*
* Copyright (c) 2017-2018 by k3b.
*
- * This file is part of AndroFotoFinder / #APhotoManager and toGoZip.
+ * This file is part of #APhotoManager (https://github.com/k3b/APhotoManager/)
+ * and #toGoZip (https://github.com/k3b/ToGoZip/).
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
diff --git a/fotolib2/src/main/java/de/k3b/io/OSDirectory.java b/fotolib2/src/main/java/de/k3b/io/OSDirectory.java
index 5c19ed3f..9b001f3c 100644
--- a/fotolib2/src/main/java/de/k3b/io/OSDirectory.java
+++ b/fotolib2/src/main/java/de/k3b/io/OSDirectory.java
@@ -26,7 +26,7 @@
import java.util.ArrayList;
import java.util.List;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
/**
* Operating System Directory with load on demand
@@ -34,7 +34,7 @@
* Created by k3b on 04.08.2015.
*/
public class OSDirectory implements IDirectory {
- private static final Logger logger = LoggerFactory.getLogger(FotoLibGlobal.LOG_TAG);
+ private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
private File mCurrent = null;
private List mChilden = null;
@@ -138,7 +138,7 @@ public List getChildren() {
if (isDirectory(file)) {
mChilden.add(createOsDirectory(file, this, null));
}
-// } else if (FotoLibGlobal.debugEnabled) {
+// } else if (LibGlobal.debugEnabled) {
// logger.debug(FileUtils.getDebugString("OSDirectory.getChildren() rejected ", file));
}
}
diff --git a/fotolib2/src/main/java/de/k3b/io/PhotoWorkFlowDto.java b/fotolib2/src/main/java/de/k3b/io/PhotoWorkFlowDto.java
index 1889e91b..6574866e 100644
--- a/fotolib2/src/main/java/de/k3b/io/PhotoWorkFlowDto.java
+++ b/fotolib2/src/main/java/de/k3b/io/PhotoWorkFlowDto.java
@@ -29,7 +29,7 @@
import java.io.Serializable;
import java.util.Properties;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.media.IMetaApi;
import de.k3b.media.MediaAsString;
@@ -40,7 +40,7 @@
*/
public class PhotoWorkFlowDto {
- private static final Logger logger = LoggerFactory.getLogger(FotoLibGlobal.LOG_TAG);
+ private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
/** added to every serialized item if != null. Example "Generated on 2015-10-19 with myApp Version 0815." */
public static String sFileComment = "";
@@ -72,7 +72,7 @@ public PhotoWorkFlowDto load(File outDir) throws IOException {
try {
inputStream = new FileInputStream(apm);
properties.load(inputStream);
- if (FotoLibGlobal.debugEnabled) {
+ if (LibGlobal.debugEnabled) {
logger.debug(this.getClass().getSimpleName() + ": loaded from " + apm + ":" + this);
}
return this;
@@ -117,13 +117,13 @@ public void save() throws IOException {
File apm = getApmFile();
FileOutputStream stream = null;
if (isEmpty()) {
- if (FotoLibGlobal.debugEnabled) {
+ if (LibGlobal.debugEnabled) {
logger.debug(this.getClass().getSimpleName() + ": save delete empty " + apm + ":" + this);
}
apm.delete();
} else {
try {
- if (FotoLibGlobal.debugEnabled) {
+ if (LibGlobal.debugEnabled) {
logger.debug(this.getClass().getSimpleName() + ": save to " + apm + ":" + this);
}
stream = new FileOutputStream(apm);
@@ -142,7 +142,7 @@ public static PhotoWorkFlowDto load(Serializable content) {
String outDir = properties.getProperty(KEY_OUT_DIR);
photoWorkFlowDto = new PhotoWorkFlowDto((outDir != null) ? new File(outDir) : null, properties);
}
- if (FotoLibGlobal.debugEnabled) {
+ if (LibGlobal.debugEnabled) {
logger.debug(PhotoWorkFlowDto.class.getSimpleName() + ": load De-Serialize:" + photoWorkFlowDto);
}
return photoWorkFlowDto;
diff --git a/fotolib2/src/main/java/de/k3b/io/RuleFileNameProcessor.java b/fotolib2/src/main/java/de/k3b/io/RuleFileNameProcessor.java
index bebd258d..f160089f 100644
--- a/fotolib2/src/main/java/de/k3b/io/RuleFileNameProcessor.java
+++ b/fotolib2/src/main/java/de/k3b/io/RuleFileNameProcessor.java
@@ -27,7 +27,7 @@
import java.text.SimpleDateFormat;
import java.util.Date;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
/**
* #93: rule based file renaming for same target directory.
@@ -37,7 +37,7 @@
*/
public class RuleFileNameProcessor extends FileProcessor implements IFileNameProcessor {
- private static final Logger logger = LoggerFactory.getLogger(FotoLibGlobal.LOG_TAG);
+ private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
public static final String APM_FILE_NAME = ".apm";
/** i.e "yyMM" for year and month each with 2 digits */
diff --git a/fotolib2/src/main/java/de/k3b/io/StringUtils.java b/fotolib2/src/main/java/de/k3b/io/StringUtils.java
index 1bff81aa..b9af6dbd 100644
--- a/fotolib2/src/main/java/de/k3b/io/StringUtils.java
+++ b/fotolib2/src/main/java/de/k3b/io/StringUtils.java
@@ -1,7 +1,8 @@
/*
- * Copyright (c) 2017-2018 by k3b.
+ * Copyright (c) 2018 by k3b.
*
- * This file is part of AndroFotoFinder / #APhotoManager.
+ * This file is part of #APhotoManager (https://github.com/k3b/APhotoManager/)
+ * and #toGoZip (https://github.com/k3b/ToGoZip/).
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
@@ -11,8 +12,8 @@
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
*
+ * for more details.
* You should have received a copy of the GNU General Public License along with
* this program. If not, see
*/
diff --git a/fotolib2/src/main/java/de/k3b/io/VISIBILITY.java b/fotolib2/src/main/java/de/k3b/io/VISIBILITY.java
index 39e57db2..f62529bc 100644
--- a/fotolib2/src/main/java/de/k3b/io/VISIBILITY.java
+++ b/fotolib2/src/main/java/de/k3b/io/VISIBILITY.java
@@ -25,7 +25,7 @@
import java.util.ArrayList;
import java.util.List;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
public enum VISIBILITY {
/** take from current settings */
@@ -39,7 +39,7 @@ public enum VISIBILITY {
// #100: if photo has this tag it has visibility PRIVATE
public static final String TAG_PRIVATE = "PRIVATE";
- private static final Logger logger = LoggerFactory.getLogger(FotoLibGlobal.LOG_TAG);
+ private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
public static final VISIBILITY MAX = PRIVATE_PUBLIC;
public final int value;
diff --git a/fotolib2/src/main/java/de/k3b/media/ExifInterfaceEx.java b/fotolib2/src/main/java/de/k3b/media/ExifInterfaceEx.java
index cd080098..03f5f8e1 100644
--- a/fotolib2/src/main/java/de/k3b/media/ExifInterfaceEx.java
+++ b/fotolib2/src/main/java/de/k3b/media/ExifInterfaceEx.java
@@ -34,7 +34,7 @@
import java.util.List;
import java.util.TimeZone;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.io.ListUtils;
import de.k3b.io.VISIBILITY;
@@ -79,7 +79,7 @@ public ExifInterfaceEx(String absoluteJpgPath, InputStream in, IMetaApi xmpExter
this.xmpExtern = xmpExtern;
this.mDbg_context = dbg_context + "->ExifInterfaceEx(" + absoluteJpgPath+ ") ";
- if (FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (LibGlobal.debugEnabledJpgMetaIo) {
logger.debug(this.mDbg_context +
" load: " + MediaUtil.toString(this, false, null, MediaUtil.FieldID.path, MediaUtil.FieldID.clasz));
}
@@ -100,7 +100,7 @@ public void saveAttributes(File inFile, File outFile, boolean deleteInFileOnFini
@Override
public void saveJpegAttributes(InputStream inputStream, OutputStream outputStream, byte[] thumbnail)
throws IOException {
- if (FotoLibGlobal.debugEnabledJpg || FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (LibGlobal.debugEnabledJpg || LibGlobal.debugEnabledJpgMetaIo) {
logger.debug(mDbg_context + " saveJpegAttributes: " + getPath());
}
super.saveJpegAttributes(inputStream, outputStream, thumbnail);
@@ -109,7 +109,7 @@ public void saveJpegAttributes(InputStream inputStream, OutputStream outputStrea
@Override
protected boolean deleteFile(File file) {
boolean result = super.deleteFile(file);
- if (result && FotoLibGlobal.debugEnabledJpg || FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (result && LibGlobal.debugEnabledJpg || LibGlobal.debugEnabledJpgMetaIo) {
logger.debug(mDbg_context + " deleteFile: " + file);
}
return result;
@@ -130,12 +130,12 @@ private void fixDateTakenIfNeccessary(File inFile) {
protected void fixAttributes() {
fixDateTakenIfNeccessary(mExifFile);
- if ((FotoLibGlobal.appName != null) && (null == getAttribute(ExifInterfaceEx.TAG_MAKE))) {
- setAttribute(ExifInterfaceEx.TAG_MAKE, FotoLibGlobal.appName);
+ if ((LibGlobal.appName != null) && (null == getAttribute(ExifInterfaceEx.TAG_MAKE))) {
+ setAttribute(ExifInterfaceEx.TAG_MAKE, LibGlobal.appName);
}
- if ((FotoLibGlobal.appVersion != null) && (null == getAttribute(ExifInterfaceEx.TAG_MODEL))) {
- setAttribute(ExifInterfaceEx.TAG_MODEL, FotoLibGlobal.appVersion);
+ if ((LibGlobal.appVersion != null) && (null == getAttribute(ExifInterfaceEx.TAG_MODEL))) {
+ setAttribute(ExifInterfaceEx.TAG_MODEL, LibGlobal.appVersion);
}
super.fixAttributes();
}
diff --git a/fotolib2/src/main/java/de/k3b/media/ImageMetaReader.java b/fotolib2/src/main/java/de/k3b/media/ImageMetaReader.java
index 013ec574..1527a5fe 100644
--- a/fotolib2/src/main/java/de/k3b/media/ImageMetaReader.java
+++ b/fotolib2/src/main/java/de/k3b/media/ImageMetaReader.java
@@ -42,7 +42,7 @@
import java.util.Date;
import java.util.List;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.io.DateUtil;
import de.k3b.io.ListUtils;
import de.k3b.io.StringUtils;
@@ -82,7 +82,7 @@ public class ImageMetaReader implements IMetaApi, Closeable {
private boolean mInitExecuted = false;
static {
- FotoLibGlobal.itpcWriteSupport = hasItpcWriteSupport();
+ LibGlobal.itpcWriteSupport = hasItpcWriteSupport();
}
private static boolean hasItpcWriteSupport() {
@@ -128,14 +128,14 @@ public ImageMetaReader load(String filename, InputStream inputStream, IMetaApi e
mMetadata = metadata;
if (metadata == null) {
- if (FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (LibGlobal.debugEnabledJpgMetaIo) {
logger.debug(dbg_context +
"load: file not found ");
}
return null;
}
- if (FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (LibGlobal.debugEnabledJpgMetaIo) {
logger.debug(dbg_context +
"loaded: " + MediaUtil.toString(this, false, null, MediaUtil.FieldID.path, MediaUtil.FieldID.clasz));
}
diff --git a/fotolib2/src/main/java/de/k3b/media/JpgMetaWorkflow.java b/fotolib2/src/main/java/de/k3b/media/JpgMetaWorkflow.java
index f2280e4c..5a0d185b 100644
--- a/fotolib2/src/main/java/de/k3b/media/JpgMetaWorkflow.java
+++ b/fotolib2/src/main/java/de/k3b/media/JpgMetaWorkflow.java
@@ -27,7 +27,7 @@
import java.util.EnumSet;
import java.util.List;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.io.FileProcessor;
import de.k3b.io.VISIBILITY;
import de.k3b.transactionlog.TransactionLoggerBase;
@@ -38,7 +38,7 @@
* Created by k3b on 25.08.2015.
*/
public class JpgMetaWorkflow {
- private static final Logger logger = LoggerFactory.getLogger(FotoLibGlobal.LOG_TAG);
+ private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
private final TransactionLoggerBase transactionLogger;
private StringBuilder debugExif(StringBuilder sb, String context, MetaWriterExifXml exif, File filePath) {
@@ -74,7 +74,7 @@ public MetaWriterExifXml saveLatLon(File filePath, Double latitude, Double longi
* Returns new values or null if no change. */
public MetaWriterExifXml applyChanges(File inFilePath, String outFilePath,
long id, boolean deleteOriginalWhenFinished, MediaDiffCopy metaDiffCopy) {
- StringBuilder sb = (FotoLibGlobal.debugEnabled)
+ StringBuilder sb = (LibGlobal.debugEnabled)
? createDebugStringBuilder(inFilePath)
: null;
File outFile = (outFilePath != null) ? new File(outFilePath) : inFilePath;
@@ -105,7 +105,7 @@ public MetaWriterExifXml applyChanges(File inFilePath, String outFilePath,
exif.save("MetaWriterExifXml save");
- if (FotoLibGlobal.preserveJpgFileModificationDate) {
+ if (LibGlobal.preserveJpgFileModificationDate) {
// preseve file modification date
inFilePath.setLastModified(lastModified);
}
@@ -173,7 +173,7 @@ public MetaWriterExifXml applyChanges(File inFilePath, String outFilePath,
protected void deleteFile(File delete) {
if ((delete != null) && delete.exists()) {
delete.delete();
- if (FotoLibGlobal.debugEnabledJpg) {
+ if (LibGlobal.debugEnabledJpg) {
logger.info("JpgMetaWorkflow deleteFile " + delete);
}
}
@@ -181,7 +181,7 @@ protected void deleteFile(File delete) {
/** return modified out file or null if filename must not change due to visibility rule */
protected File handleVisibility(VISIBILITY newVisibility, File outFile, MetaWriterExifXml exif) {
- if (FotoLibGlobal.renamePrivateJpg) {
+ if (LibGlobal.renamePrivateJpg) {
final String oldAbsoluteOutPath = (outFile == null) ? null : outFile.getAbsolutePath();
String newAbsoluteOutPath = MediaUtil.getModifiedPath(oldAbsoluteOutPath, newVisibility);
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaXmpSegment.java b/fotolib2/src/main/java/de/k3b/media/MediaXmpSegment.java
index ab1cda44..78aa942a 100644
--- a/fotolib2/src/main/java/de/k3b/media/MediaXmpSegment.java
+++ b/fotolib2/src/main/java/de/k3b/media/MediaXmpSegment.java
@@ -32,7 +32,7 @@
import java.util.Date;
import java.util.List;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.io.DateUtil;
import de.k3b.io.FileCommands;
import de.k3b.io.GeoUtil;
@@ -46,7 +46,7 @@
public class MediaXmpSegment extends XmpSegment implements IMetaApi {
private static final String dbg_context = "MediaXmpSegment: ";
- private static final Logger logger = LoggerFactory.getLogger(FotoLibGlobal.LOG_TAG);
+ private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
/** the full path of the image where this xmp-file belongs to */
private String path = null;
@@ -190,7 +190,7 @@ public IMetaApi setVisibility(VISIBILITY value) {
@Override
public XmpSegment setXmpMeta(XMPMeta xmpMeta, String dbg_context) {
super.setXmpMeta(xmpMeta, dbg_context);
- if (FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (LibGlobal.debugEnabledJpgMetaIo) {
logger.info(dbg_context + " setXmpMeta " + MediaUtil.toString(this, false, null, MediaUtil.FieldID.path, MediaUtil.FieldID.clasz));
}
@@ -208,7 +208,7 @@ private void fixAttributes(File file) {
setProperty(file.getName(), MediaXmpFieldDefinition.OriginalFileName);
}
if (getPropertyAsString(" fixAttributes AppVersion", MediaXmpFieldDefinition.AppVersion) == null) {
- setProperty(FotoLibGlobal.appName + "-" + FotoLibGlobal.appVersion, MediaXmpFieldDefinition.AppVersion);
+ setProperty(LibGlobal.appName + "-" + LibGlobal.appVersion, MediaXmpFieldDefinition.AppVersion);
}
}
@@ -216,7 +216,7 @@ private void fixAttributes(File file) {
@Override
public XmpSegment save(OutputStream os, boolean humanReadable, String dbg_context) {
super.save(os, humanReadable, dbg_context);
- if (FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (LibGlobal.debugEnabledJpgMetaIo) {
logger.info(dbg_context + " save " + MediaUtil.toString(this, false, null, MediaUtil.FieldID.path, MediaUtil.FieldID.clasz));
}
@@ -238,7 +238,7 @@ public static MediaXmpSegment loadXmpSidecarContentOrNull(String absoluteJpgPath
xmpContent = null;
}
- } else if (FotoLibGlobal.debugEnabledJpgMetaIo) {
+ } else if (LibGlobal.debugEnabledJpgMetaIo) {
logger.error(dbg_context + "file not found");
}
diff --git a/fotolib2/src/main/java/de/k3b/media/MetaWriterExifXml.java b/fotolib2/src/main/java/de/k3b/media/MetaWriterExifXml.java
index 8f1fa239..4f4d513e 100644
--- a/fotolib2/src/main/java/de/k3b/media/MetaWriterExifXml.java
+++ b/fotolib2/src/main/java/de/k3b/media/MetaWriterExifXml.java
@@ -26,7 +26,7 @@
import java.io.IOException;
import java.util.Date;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.io.FileCommands;
import de.k3b.io.FileProcessor;
import de.k3b.io.FileUtils;
@@ -45,7 +45,7 @@
*/
public class MetaWriterExifXml extends MetaApiWrapper implements IMetaApi {
- private static final Logger logger = LoggerFactory.getLogger(FotoLibGlobal.LOG_TAG);
+ private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
private ExifInterfaceEx exif; // not null if exif changes are written to jpg file
private MediaXmpSegment xmp; // not null if exif changes are written to xmp sidecar file.
@@ -70,9 +70,9 @@ public static MetaWriterExifXml create(String absoluteJpgInPath, String absolute
boolean deleteOriginalAfterFinish, String dbg_context)
throws IOException {
return create(absoluteJpgInPath, absoluteJpgOutPath, deleteOriginalAfterFinish, dbg_context,
- FotoLibGlobal.mediaUpdateStrategy.contains("J"), // write jpg file
- FotoLibGlobal.mediaUpdateStrategy.contains("X"), // write xmp file
- FotoLibGlobal.mediaUpdateStrategy.contains("C") // create xmp if it does not exist
+ LibGlobal.mediaUpdateStrategy.contains("J"), // write jpg file
+ LibGlobal.mediaUpdateStrategy.contains("X"), // write xmp file
+ LibGlobal.mediaUpdateStrategy.contains("C") // create xmp if it does not exist
);
}
@@ -95,7 +95,7 @@ public static MetaWriterExifXml create(String absoluteJpgInPath, String absolute
boolean writeJpg, boolean writeXmp, boolean createXmpIfNotExist)
throws IOException {
long startTimestamp = 0;
- if (FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (LibGlobal.debugEnabledJpgMetaIo) {
startTimestamp = new Date().getTime();
}
MediaXmpSegment xmp = MediaXmpSegment.loadXmpSidecarContentOrNull(absoluteJpgInPath, dbg_context);
@@ -153,7 +153,7 @@ public static MetaWriterExifXml create(String absoluteJpgInPath, String absolute
result.absoluteJpgOutPath = (absoluteJpgOutPath != null) ? absoluteJpgOutPath : absoluteJpgInPath;
result.absoluteJpgInPath = absoluteJpgInPath;
result.deleteOriginalAfterFinish = deleteOriginalAfterFinish;
- if (FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (LibGlobal.debugEnabledJpgMetaIo) {
result.dbgLoadEndTimestamp = new Date().getTime();
logger.debug(dbg_context + " load[msec]:" + (result.dbgLoadEndTimestamp - startTimestamp));
}
@@ -178,14 +178,14 @@ public String getAbsoluteJpgOutPath() {
public int save(String dbg_context) throws IOException {
long startTimestamp = 0;
- if (FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (LibGlobal.debugEnabledJpgMetaIo) {
startTimestamp = new Date().getTime();
}
final int result = transferExif(dbg_context)
+ transferXmp(dbg_context);
- if (FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (LibGlobal.debugEnabledJpgMetaIo) {
long endTimestamp = new Date().getTime();
logger.debug(dbg_context
+ " process[msec]:" + (startTimestamp - this.dbgLoadEndTimestamp)
@@ -209,7 +209,7 @@ private int transferXmp(String dbg_context) throws IOException {
Boolean xmpLongFormat = xmp.isLongFormat();
boolean isLongFormat = (xmpLongFormat != null)
? xmpLongFormat.booleanValue()
- : FotoLibGlobal.preferLongXmpFormat;
+ : LibGlobal.preferLongXmpFormat;
changedFiles += saveXmp(xmp, outJpgFullPath, isLongFormat, dbg_context);
@@ -248,7 +248,7 @@ private int saveXmp(MediaXmpSegment xmp,
String outFullJpgPath,
boolean isLongFileName, String dbg_context) throws IOException {
File xmpOutFile = FileCommands.getSidecar(outFullJpgPath, isLongFileName);
- xmp.save(xmpOutFile, FotoLibGlobal.debugEnabledJpgMetaIo, dbg_context);
+ xmp.save(xmpOutFile, LibGlobal.debugEnabledJpgMetaIo, dbg_context);
return 1;
}
diff --git a/fotolib2/src/main/java/de/k3b/media/XmpNamespace.java b/fotolib2/src/main/java/de/k3b/media/XmpNamespace.java
index 826e9085..f7c397de 100644
--- a/fotolib2/src/main/java/de/k3b/media/XmpNamespace.java
+++ b/fotolib2/src/main/java/de/k3b/media/XmpNamespace.java
@@ -26,7 +26,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
/**
* Created by k3b on 10.10.2016.
@@ -44,7 +44,7 @@ public enum XmpNamespace {
;
private static final String dbg_context = XmpNamespace.class.getSimpleName();
- private static final Logger logger = LoggerFactory.getLogger(FotoLibGlobal.LOG_TAG);
+ private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
private final String prefix;
private final String uri;
diff --git a/fotolib2/src/main/java/de/k3b/media/XmpSegment.java b/fotolib2/src/main/java/de/k3b/media/XmpSegment.java
index 953ce7f7..92819236 100644
--- a/fotolib2/src/main/java/de/k3b/media/XmpSegment.java
+++ b/fotolib2/src/main/java/de/k3b/media/XmpSegment.java
@@ -44,7 +44,7 @@
import java.util.Date;
import java.util.List;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.io.FileUtils;
import de.k3b.tagDB.TagConverter;
@@ -56,7 +56,7 @@
public class XmpSegment {
public static final String DBG_PREFIX = "XmpSegment: ";
private static String dbg_context = DBG_PREFIX;
- private static final Logger logger = LoggerFactory.getLogger(FotoLibGlobal.LOG_TAG);
+ private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
// public: can be changed in settings dialog
public static boolean DEBUG = false;
diff --git a/fotolib2/src/main/java/de/k3b/tagDB/TagRepository.java b/fotolib2/src/main/java/de/k3b/tagDB/TagRepository.java
index 60627810..66f36e13 100644
--- a/fotolib2/src/main/java/de/k3b/tagDB/TagRepository.java
+++ b/fotolib2/src/main/java/de/k3b/tagDB/TagRepository.java
@@ -33,7 +33,7 @@
import java.util.Collections;
import java.util.List;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
/**
* Persistence for all known tags.
@@ -44,7 +44,7 @@
public class TagRepository {
// android - log compatible
private static final String dbg_context = "TagRepository: ";
- private static final Logger logger = LoggerFactory.getLogger(FotoLibGlobal.LOG_TAG);
+ private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
/** Lines starting with char are comments. These lines are not interpreted */
public static final java.lang.String COMMENT = "#";
@@ -216,7 +216,7 @@ public List load() {
logger.debug(dbg_context + "load(): " + mItemList.size() + " items from " + this.mFile);
- } else if (FotoLibGlobal.debugEnabled) {
+ } else if (LibGlobal.debugEnabled) {
// logger.debug(dbg_context + "load() cached value : " + mItemList.size() + " items from " + this.mFile);
}
return mItemList;
@@ -274,7 +274,7 @@ public TagRepository save() {
} catch (IOException e) {
e.printStackTrace();
}
- if (FotoLibGlobal.debugEnabled) {
+ if (LibGlobal.debugEnabled) {
logger.debug(dbg_context + "save(): no items for " + this.mFile);
}
return this;
@@ -293,7 +293,7 @@ public void load(List result, Reader reader) throws IOException {
Tag item = loadItem(line);
final boolean valid = isValid(item);
/* // to much log output
- if (FotoLibGlobal.debugEnabled) {
+ if (LibGlobal.debugEnabled) {
logger.debug(dbg_context + "load(" + line + "): " + ((valid) ? "loaded" : "ignored"));
}
*/
@@ -389,7 +389,7 @@ protected boolean saveItem(Writer writer, Tag item, String indent) throws IOExce
writer.write("\n");
}
/* // to much log output
- if (FotoLibGlobal.debugEnabled) {
+ if (LibGlobal.debugEnabled) {
logger.debug(dbg_context + "save(" + line + "): " + ((valid) ? "saved" : "ignored" ));
}
*/
diff --git a/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLogParser.java b/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLogParser.java
index 711f2560..57ab0940 100644
--- a/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLogParser.java
+++ b/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLogParser.java
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2017 by k3b.
+ * Copyright (c) 2018 by k3b.
*
- * This file is part of AndroFotoFinder / #APhotoManager.
+ * This file is part of #APhotoManager (https://github.com/k3b/APhotoManager/)
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
@@ -11,8 +11,8 @@
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
*
+ * for more details.
* You should have received a copy of the GNU General Public License along with
* this program. If not, see
*/
diff --git a/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLoggerBase.java b/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLoggerBase.java
index 8b1d31a6..4e6c0d9c 100644
--- a/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLoggerBase.java
+++ b/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLoggerBase.java
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2017-2018 by k3b.
+ * Copyright (c) 2018 by k3b.
*
- * This file is part of AndroFotoFinder / #APhotoManager.
+ * This file is part of #APhotoManager (https://github.com/k3b/APhotoManager/)
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
@@ -11,8 +11,8 @@
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
*
+ * for more details.
* You should have received a copy of the GNU General Public License along with
* this program. If not, see
*/
@@ -26,7 +26,7 @@
import java.util.EnumSet;
import java.util.List;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.io.DateUtil;
import de.k3b.io.DirectoryFormatter;
import de.k3b.io.FileProcessor;
@@ -124,7 +124,7 @@ public void addChangesCopyMove(boolean move, String newFullPath, String debugCon
}
public void addComment(Object... comment) {
- if (FotoLibGlobal.debugEnabledJpgMetaIo) {
+ if (LibGlobal.debugEnabledJpgMetaIo) {
addChanges(MediaTransactionLogEntryType.COMMENT, ListUtils.toString(" ", comment), true);
}
}
diff --git a/fotolib2/src/test/java/de/k3b/io/FileCommandAutoIntegrationTests.java b/fotolib2/src/test/java/de/k3b/io/FileCommandAutoIntegrationTests.java
index 85d1a1df..88b8164f 100644
--- a/fotolib2/src/test/java/de/k3b/io/FileCommandAutoIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/io/FileCommandAutoIntegrationTests.java
@@ -31,7 +31,7 @@
import java.util.Date;
import java.util.Properties;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.TestUtil;
import de.k3b.io.collections.SelectedFiles;
import de.k3b.media.ExifInterface;
@@ -75,11 +75,11 @@ public static void setUpClass() throws IOException {
}
@Before
public void setUp() throws IOException {
- FotoLibGlobal.appName = "JUnit";
- FotoLibGlobal.appVersion = TEST_CLASS_NAME;
+ LibGlobal.appName = "JUnit";
+ LibGlobal.appVersion = TEST_CLASS_NAME;
ExifInterface.DEBUG = true;
- FotoLibGlobal.debugEnabledJpgMetaIo = true;
+ LibGlobal.debugEnabledJpgMetaIo = true;
}
/// TODO: move to seperate class FileCommandsIntegrationTests
diff --git a/fotolib2/src/test/java/de/k3b/media/ExifInterfaceExIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/ExifInterfaceExIntegrationTests.java
index 57d76a4c..94fbc22a 100644
--- a/fotolib2/src/test/java/de/k3b/media/ExifInterfaceExIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/ExifInterfaceExIntegrationTests.java
@@ -29,7 +29,7 @@
import java.io.IOException;
import java.io.InputStream;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.TestUtil;
import de.k3b.io.DateUtil;
import de.k3b.io.ListUtils;
@@ -46,8 +46,8 @@ public class ExifInterfaceExIntegrationTests {
@BeforeClass
public static void initDirectories() {
- FotoLibGlobal.appName = "JUnit";
- FotoLibGlobal.appVersion = "ExifInterfaceExIntegrationTests";
+ LibGlobal.appName = "JUnit";
+ LibGlobal.appVersion = "ExifInterfaceExIntegrationTests";
}
@Before
diff --git a/fotolib2/src/test/java/de/k3b/media/ExifInterfaceIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/ExifInterfaceIntegrationTests.java
index 1bab36f6..6ed366f1 100644
--- a/fotolib2/src/test/java/de/k3b/media/ExifInterfaceIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/ExifInterfaceIntegrationTests.java
@@ -33,7 +33,7 @@
import java.io.OutputStream;
import java.util.HashMap;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.TestUtil;
import de.k3b.io.FileUtils;
@@ -56,8 +56,8 @@ public class ExifInterfaceIntegrationTests {
"Русский (Russian)" ;
@BeforeClass
public static void initDirectories() {
- FotoLibGlobal.appName = "JUnit";
- FotoLibGlobal.appVersion = "ExifInterfaceIntegrationTests";
+ LibGlobal.appName = "JUnit";
+ LibGlobal.appVersion = "ExifInterfaceIntegrationTests";
FileUtils.delete(OUTDIR, null);
OUTDIR.mkdirs();
diff --git a/fotolib2/src/test/java/de/k3b/media/ImageMetaReaderIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/ImageMetaReaderIntegrationTests.java
index de0c74e0..2f2211dd 100644
--- a/fotolib2/src/test/java/de/k3b/media/ImageMetaReaderIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/ImageMetaReaderIntegrationTests.java
@@ -33,7 +33,7 @@
import java.io.InputStream;
import java.util.List;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.TestUtil;
import de.k3b.io.DateUtil;
import de.k3b.io.ListUtils;
@@ -48,8 +48,8 @@ public class ImageMetaReaderIntegrationTests {
private ImageMetaReader sut = null;
@BeforeClass
public static void initDirectories() {
- FotoLibGlobal.appName = "JUnit";
- FotoLibGlobal.appVersion = "ImageMetaReaderIntegrationTests";
+ LibGlobal.appName = "JUnit";
+ LibGlobal.appVersion = "ImageMetaReaderIntegrationTests";
}
@Before
diff --git a/fotolib2/src/test/java/de/k3b/media/JpgMetaWorkflowIntegratoinTests.java b/fotolib2/src/test/java/de/k3b/media/JpgMetaWorkflowIntegratoinTests.java
index 3ea0f706..39241c9f 100644
--- a/fotolib2/src/test/java/de/k3b/media/JpgMetaWorkflowIntegratoinTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/JpgMetaWorkflowIntegratoinTests.java
@@ -9,7 +9,7 @@
import java.io.IOException;
import java.util.EnumSet;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.TestUtil;
import de.k3b.io.FileUtils;
@@ -46,24 +46,24 @@ public class JpgMetaWorkflowIntegratoinTests {
@BeforeClass
public static void initDirectories() {
- FotoLibGlobal.appName = "JUnit";
- FotoLibGlobal.appVersion = SUT_CLASS_NAME;
+ LibGlobal.appName = "JUnit";
+ LibGlobal.appVersion = SUT_CLASS_NAME;
FileUtils.delete(OUTDIR, null);
OUTDIR.mkdirs();
ExifInterface.DEBUG = true;
- FotoLibGlobal.debugEnabled = true;
+ LibGlobal.debugEnabled = true;
// so you can see that the file was modified
- FotoLibGlobal.preserveJpgFileModificationDate = false;
+ LibGlobal.preserveJpgFileModificationDate = false;
}
@Test
public void shouldUpdateExistingExifWithCreateXmp() throws IOException
{
- FotoLibGlobal.mediaUpdateStrategy = "JXC";
+ LibGlobal.mediaUpdateStrategy = "JXC";
String fileNameSrc = "test-WitExtraData.jpg";
String fileNameDest = "shouldUpdateExistingExifWithCreateXmp.jpg";
diff --git a/fotolib2/src/test/java/de/k3b/media/MediaXmpSegmentIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/MediaXmpSegmentIntegrationTests.java
index 00d496e8..db78d451 100644
--- a/fotolib2/src/test/java/de/k3b/media/MediaXmpSegmentIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/MediaXmpSegmentIntegrationTests.java
@@ -30,7 +30,7 @@
import java.io.InputStream;
import java.util.TimeZone;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.TestUtil;
import de.k3b.io.DateUtil;
import de.k3b.io.ListUtils;
@@ -45,8 +45,8 @@ public class MediaXmpSegmentIntegrationTests {
private IMetaApi sut = null;
@BeforeClass
public static void initDirectories() {
- FotoLibGlobal.appName = "JUnit";
- FotoLibGlobal.appVersion = "MediaXmpSegmentIntegrationTests";
+ LibGlobal.appName = "JUnit";
+ LibGlobal.appVersion = "MediaXmpSegmentIntegrationTests";
}
@Before
diff --git a/fotolib2/src/test/java/de/k3b/media/MediaXmpTests.java b/fotolib2/src/test/java/de/k3b/media/MediaXmpTests.java
index 29ba7334..84d10271 100644
--- a/fotolib2/src/test/java/de/k3b/media/MediaXmpTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/MediaXmpTests.java
@@ -31,7 +31,7 @@
import java.io.InputStream;
import java.util.TimeZone;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.TestUtil;
/**
@@ -46,8 +46,8 @@ public class MediaXmpTests {
@BeforeClass
public static void initDirectories() {
- FotoLibGlobal.appName = "JUnit";
- FotoLibGlobal.appVersion = "MediaXmpTests";
+ LibGlobal.appName = "JUnit";
+ LibGlobal.appVersion = "MediaXmpTests";
}
@Test
diff --git a/fotolib2/src/test/java/de/k3b/media/MetaWriterExifXmlIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/MetaWriterExifXmlIntegrationTests.java
index 0ca732e8..b822b394 100644
--- a/fotolib2/src/test/java/de/k3b/media/MetaWriterExifXmlIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/MetaWriterExifXmlIntegrationTests.java
@@ -30,7 +30,7 @@
import java.io.IOException;
import java.io.Writer;
-import de.k3b.FotoLibGlobal;
+import de.k3b.LibGlobal;
import de.k3b.TestUtil;
import de.k3b.io.FileCommands;
import de.k3b.io.FileUtils;
@@ -46,8 +46,8 @@ public class MetaWriterExifXmlIntegrationTests {
@BeforeClass
public static void initDirectories() {
- FotoLibGlobal.appName = "JUnit";
- FotoLibGlobal.appVersion = "MetaWriterExifXmlIntegrationTests";
+ LibGlobal.appName = "JUnit";
+ LibGlobal.appVersion = "MetaWriterExifXmlIntegrationTests";
OUTDIR.mkdirs();
}
diff --git a/fotolib2/src/test/java/de/k3b/transactionlog/TransactionLogParserTests.java b/fotolib2/src/test/java/de/k3b/transactionlog/TransactionLogParserTests.java
index f526d556..3e70b47e 100644
--- a/fotolib2/src/test/java/de/k3b/transactionlog/TransactionLogParserTests.java
+++ b/fotolib2/src/test/java/de/k3b/transactionlog/TransactionLogParserTests.java
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2017 by k3b.
+ * Copyright (c) 2018 by k3b.
*
- * This file is part of AndroFotoFinder / #APhotoManager.
+ * This file is part of #APhotoManager (https://github.com/k3b/APhotoManager/)
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
@@ -11,8 +11,8 @@
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
*
+ * for more details.
* You should have received a copy of the GNU General Public License along with
* this program. If not, see
*/
diff --git a/fotolib2/src/test/java/de/k3b/translations/TranslationStatistics.java b/fotolib2/src/test/java/de/k3b/translations/TranslationStatistics.java
index ec22341c..71ad86b4 100644
--- a/fotolib2/src/test/java/de/k3b/translations/TranslationStatistics.java
+++ b/fotolib2/src/test/java/de/k3b/translations/TranslationStatistics.java
@@ -1,7 +1,8 @@
/*
* Copyright (c) 2018 by k3b.
*
- * This file is part of AndroFotoFinder / #APhotoManager.
+ * This file is part of #APhotoManager (https://github.com/k3b/APhotoManager/)
+ * and #toGoZip (https://github.com/k3b/ToGoZip/).
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
diff --git a/fotolib2/src/test/java/de/k3b/translations/TranslationStatisticsTests.java b/fotolib2/src/test/java/de/k3b/translations/TranslationStatisticsTests.java
index 2d9dfd21..d59ad809 100644
--- a/fotolib2/src/test/java/de/k3b/translations/TranslationStatisticsTests.java
+++ b/fotolib2/src/test/java/de/k3b/translations/TranslationStatisticsTests.java
@@ -1,7 +1,8 @@
/*
* Copyright (c) 2018 by k3b.
*
- * This file is part of AndroFotoFinder / #APhotoManager.
+ * This file is part of #APhotoManager (https://github.com/k3b/APhotoManager/)
+ * and #toGoZip (https://github.com/k3b/ToGoZip/).
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
@@ -11,8 +12,8 @@
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
*
+ * for more details.
* You should have received a copy of the GNU General Public License along with
* this program. If not, see
*/
From 48243dbdddefbdb66d03f8c775f9010357d882cc Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Sun, 4 Nov 2018 14:07:12 +0100
Subject: [PATCH 03/35] #132: Long press on Exif-Picker butten in
Autoprocessing-Editor: get lat/lon/description/tags from selected photos
---
.../androFotoFinder/AndroFotoFinderApp.java | 4 +-
.../PhotoAutoprocessingEditActivity.java | 135 ++++++++++--------
.../k3b/android/util/AndroidFileCommands.java | 2 +-
.../src/main/java/de/k3b/io/FileCommands.java | 16 +--
fotolib2/src/main/java/de/k3b/io/GeoUtil.java | 12 +-
.../src/main/java/de/k3b/io/ListUtils.java | 28 +++-
...owDto.java => PhotoAutoprocessingDto.java} | 51 ++++---
.../java/de/k3b/io/RuleFileNameProcessor.java | 6 +
.../de/k3b/io/collections/SelectedFiles.java | 4 +
.../src/main/java/de/k3b/media/MediaUtil.java | 59 ++++++++
fotolib2/src/test/java/de/k3b/TestUtil.java | 19 ++-
.../io/FileCommandAutoIntegrationTests.java | 32 ++---
.../ExifInterfaceExIntegrationTests.java | 2 +-
.../media/ExifInterfaceIntegrationTests.java | 6 +-
.../ImageMetaReaderIntegrationTests.java | 2 +-
.../JpgMetaWorkflowIntegratoinTests.java | 2 +-
.../java/de/k3b/media/MediaUtilTests.java | 19 +++
.../MediaXmpSegmentIntegrationTests.java | 2 +-
.../test/java/de/k3b/media/MediaXmpTests.java | 2 +-
.../MetaWriterExifXmlIntegrationTests.java | 12 +-
20 files changed, 290 insertions(+), 125 deletions(-)
rename fotolib2/src/main/java/de/k3b/io/{PhotoWorkFlowDto.java => PhotoAutoprocessingDto.java} (79%)
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java b/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java
index 5c85f272..f6c503c4 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java
@@ -38,7 +38,7 @@
import de.k3b.android.osmdroid.forge.MapsForgeSupport;
import de.k3b.android.util.LogCat;
import de.k3b.database.QueryParameter;
-import de.k3b.io.PhotoWorkFlowDto;
+import de.k3b.io.PhotoAutoprocessingDto;
import de.k3b.media.ExifInterface;
import de.k3b.media.ImageMetaReader;
import uk.co.senab.photoview.PhotoViewAttacher;
@@ -82,7 +82,7 @@ public static RefWatcher getRefWatcher(Context context) {
// create sensible defaults for andorid-independant files from android string resources
QueryParameter.sFileComment = getBookMarkComment(this);
- PhotoWorkFlowDto.sFileComment = getBookMarkComment(this);
+ PhotoAutoprocessingDto.sFileComment = getBookMarkComment(this);
QueryParameter.sParserDefaultFrom = FotoSql.SQL_TABLE_EXTERNAL_CONTENT_URI_FILE.toString();
QueryParameter.sParserDefaultQueryTypeId = FotoSql.QUERY_TYPE_DEFAULT;
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/PhotoAutoprocessingEditActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/PhotoAutoprocessingEditActivity.java
index cfd48782..b2564bea 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/PhotoAutoprocessingEditActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/PhotoAutoprocessingEditActivity.java
@@ -56,21 +56,21 @@
import de.k3b.android.androFotoFinder.queries.FotoSql;
import de.k3b.android.util.ClipboardUtil;
import de.k3b.android.util.IntentUtil;
-import de.k3b.android.util.MediaScanner;
import de.k3b.android.widget.AboutDialogPreference;
import de.k3b.android.widget.ActivityWithAutoCloseDialogs;
import de.k3b.io.ListUtils;
+import de.k3b.io.PhotoAutoprocessingDto;
import de.k3b.io.collections.SelectedFiles;
import de.k3b.io.DateUtil;
import de.k3b.io.RuleFileNameProcessor;
-import de.k3b.io.PhotoWorkFlowDto;
import de.k3b.io.StringUtils;
import de.k3b.media.IMetaApi;
import de.k3b.media.MediaAsString;
+import de.k3b.media.MediaDTO;
import de.k3b.media.MediaUtil;
/**
- * Editor for a WorkflowItem ".apm" files that define
+ * #93: Editor for a WorkflowItem ".apm" files that define
* rules to process one or more photos
* * filename schemata for copied/moved files
* * default properties that every photot should receive.
@@ -86,7 +86,7 @@ public class PhotoAutoprocessingEditActivity extends ActivityWithAutoCloseDialog
* current modified value of the first selected file
*/
private File mCurrentOutDir = null;
- private PhotoWorkFlowDto mCurrentData;
+ private PhotoAutoprocessingDto mCurrentAutoprocessingData;
private SelectedFiles mSelectedFiles;
private RuleFileNameProcessor mProcessor;
@@ -99,7 +99,7 @@ public class PhotoAutoprocessingEditActivity extends ActivityWithAutoCloseDialog
private File exampleSrcfile;
private Date exampleDate;
- public static void showActivity(String debugContext, Activity context, PhotoWorkFlowDto workflow,
+ public static void showActivity(String debugContext, Activity context, PhotoAutoprocessingDto workflow,
String directoryOrApmFileUrl
, SelectedFiles selectedFiles, int requestCode) {
final Intent intent = new Intent().setClass(context,
@@ -139,17 +139,17 @@ protected void onCreate(Bundle savedInstanceState) {
if (mCurrentOutDir.isFile()) mCurrentOutDir = mCurrentOutDir.getParentFile();
}
- mCurrentData = null;
+ mCurrentAutoprocessingData = null;
if (savedInstanceState != null) {
final Serializable settingsAsSerializable = savedInstanceState.getSerializable(SETTINGS_KEY);
- mCurrentData = PhotoWorkFlowDto.load(settingsAsSerializable);
+ mCurrentAutoprocessingData = PhotoAutoprocessingDto.load(settingsAsSerializable);
}
- if ((mCurrentData == null) && (mCurrentOutDir != null)) {
+ if ((mCurrentAutoprocessingData == null) && (mCurrentOutDir != null)) {
try {
- mCurrentData = new PhotoWorkFlowDto();
- mCurrentData.load(mCurrentOutDir);
+ mCurrentAutoprocessingData = new PhotoAutoprocessingDto();
+ mCurrentAutoprocessingData.load(mCurrentOutDir);
} catch (IOException e) {
- onFatalError(mDebugPrefix + "Cannot load .apm from " + mCurrentData, e);
+ onFatalError(mDebugPrefix + "Cannot load .apm from " + mCurrentAutoprocessingData, e);
return;
}
}
@@ -160,34 +160,22 @@ protected void onCreate(Bundle savedInstanceState) {
"onCreate",intent.toUri(Intent.URI_INTENT_SCHEME),
nl,mCurrentOutDir,
nl,"savedInstanceState",savedInstanceState,
- nl,mCurrentData));
+ nl, mCurrentAutoprocessingData));
}
- if ((mCurrentOutDir == null) || (mCurrentData == null)) {
+ if ((mCurrentOutDir == null) || (mCurrentAutoprocessingData == null)) {
onFatalError(mDebugPrefix + "Missing Intent.data parameter. intent="
+ intent.toUri(Intent.URI_INTENT_SCHEME), null);
return;
}
- mCurrentData.setOutDir(mCurrentOutDir);
+ mCurrentAutoprocessingData.setOutDir(mCurrentOutDir);
mProcessor = new RuleFileNameProcessor(mCurrentOutDir);
- if (mCurrentData.getMediaDefaults() == null) {
- File first = mSelectedFiles.getFile(0);
-
- MediaAsString exampleExif = new MediaAsString();
- if ((first != null) && (first.exists())) {
- IMetaApi example = MediaScanner.getInstance(this).getExifFromFile(first);
- if (example != null) {
- exampleExif.setData(example);
- }
- }
-
- // do not predefine these
- exampleExif.setDateTimeTaken(null);
- exampleExif.setPath(null);
- exampleExif.setTitle(null);
- mCurrentData.setMediaDefaults(exampleExif);
+ // if there are no MediaDefaults yet infer them from selected files
+ if (mCurrentAutoprocessingData.getMediaDefaults() == null) {
+ MediaAsString exampleExif = MediaUtil.inferAutoprocessingExifDefaults(new MediaAsString(), mSelectedFiles.getFiles());
+ mCurrentAutoprocessingData.setMediaDefaults(exampleExif);
}
this.exampleSrcfile = mProcessor.getFile(mSelectedFiles.getFile(0));
@@ -228,9 +216,9 @@ public String toString() {
}
private void fromGui() {
- mCurrentData.setName(mEditName.getText().toString());
- mCurrentData.setDateFormat(getSelectedPattern(mSpinnerDatePattern));
- mCurrentData.setNumberFormat(getSelectedPattern(mSpinnerNumberPattern));
+ mCurrentAutoprocessingData.setName(mEditName.getText().toString());
+ mCurrentAutoprocessingData.setDateFormat(getSelectedPattern(mSpinnerDatePattern));
+ mCurrentAutoprocessingData.setNumberFormat(getSelectedPattern(mSpinnerNumberPattern));
}
/** to avoid endless recursion toGui() ... TextView.setText ... afterTextChanged ... toGui() */
@@ -238,9 +226,9 @@ private void fromGui() {
private void toGui() {
- String numberFormat = mCurrentData.getNumberFormat();
- final String namePart = mCurrentData.getName();
- final String dateFormat = mCurrentData.getDateFormat();
+ String numberFormat = mCurrentAutoprocessingData.getNumberFormat();
+ final String namePart = mCurrentAutoprocessingData.getName();
+ final String dateFormat = mCurrentAutoprocessingData.getDateFormat();
inToGuiCount++;
try {
@@ -265,9 +253,9 @@ private void toGui() {
mSelectedFiles.size(),
(exampleSrcfile == null) ? null : exampleSrcfile.getName(),
DateUtil.toIsoDateString(exampleDate),
- mCurrentData.getOutDir(), exampleResultFileName));
+ mCurrentAutoprocessingData.getOutDir(), exampleResultFileName));
- IMetaApi mediaChanges = mCurrentData.getMediaDefaults();
+ IMetaApi mediaChanges = mCurrentAutoprocessingData.getMediaDefaults();
String exifChange = null;
if (mediaChanges != null) {
exifChange = MediaUtil.toString(mediaChanges, false, mLabelGenerator, MediaUtil.FieldID.clasz);
@@ -307,7 +295,7 @@ private String getSelectedPattern(Spinner spinner) {
@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
fromGui();
- savedInstanceState.putSerializable(SETTINGS_KEY, mCurrentData.toSerializable());
+ savedInstanceState.putSerializable(SETTINGS_KEY, mCurrentAutoprocessingData.toSerializable());
if (Global.debugEnabled) {
Log.d(Global.LOG_CONTEXT, mDebugPrefix
+ " onSaveInstanceState " + savedInstanceState);
@@ -328,7 +316,7 @@ private void defineGui() {
mSpinnerDatePattern.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView> parent, View view, int position, long id) {
- mCurrentData.setDateFormat(getSelectedPattern(mSpinnerDatePattern));
+ mCurrentAutoprocessingData.setDateFormat(getSelectedPattern(mSpinnerDatePattern));
toGui();
}
@@ -355,11 +343,11 @@ public void afterTextChanged(Editable s) {
// to avoid endless recursion toGui() ... TextView.setText ... afterTextChanged ... toGui()
if (inToGuiCount == 0) {
String newValue = s.toString();
- if (0 != StringUtils.compare(newValue, mCurrentData.getName())) {
+ if (0 != StringUtils.compare(newValue, mCurrentAutoprocessingData.getName())) {
int start = mEditName.getSelectionStart();
int end = mEditName.getSelectionEnd();
// prevent stackoverflow
- mCurrentData.setName(newValue);
+ mCurrentAutoprocessingData.setName(newValue);
toGui();
mEditName.setSelection(start, end); // prevent cursor from jumping
}
@@ -372,7 +360,7 @@ public void afterTextChanged(Editable s) {
mSpinnerNumberPattern.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView> parent, View view, int position, long id) {
- mCurrentData.setNumberFormat(getSelectedPattern(mSpinnerNumberPattern));
+ mCurrentAutoprocessingData.setNumberFormat(getSelectedPattern(mSpinnerNumberPattern));
toGui();
}
@@ -390,6 +378,12 @@ public void onClick(View v) {
onPickExif();
}
});
+ cmd.setOnLongClickListener(new View.OnLongClickListener() {
+ @Override
+ public boolean onLongClick(View v) {
+ return onReInferExifAndPick();
+ }
+ });
((ImageButton) findViewById(R.id.cmd_file_name_pattern_history)).setOnClickListener(new View.OnClickListener() {
@Override
@@ -414,8 +408,8 @@ private List createDatePatterns() {
private Date getExampleDate(File exampleSrcfile) {
Date exampleValue = null;
- if ((mCurrentData != null) && (mCurrentData.getMediaDefaults() != null)) {
- exampleValue = mCurrentData.getMediaDefaults().getDateTimeTaken();
+ if ((mCurrentAutoprocessingData != null) && (mCurrentAutoprocessingData.getMediaDefaults() != null)) {
+ exampleValue = mCurrentAutoprocessingData.getMediaDefaults().getDateTimeTaken();
}
if (exampleValue == null) {
long lastModified = (exampleSrcfile == null) ? 0 : exampleSrcfile.lastModified();
@@ -428,8 +422,8 @@ private List createNumberPatterns() {
long exampleValue = 1;
/*
- if ((mCurrentData != null) && (mCurrentData.getOutDir() != null)) {
- exampleValue = mCurrentData.getMediaDefaults().getDateTimeTaken();
+ if ((mCurrentAutoprocessingData != null) && (mCurrentAutoprocessingData.getOutDir() != null)) {
+ exampleValue = mCurrentAutoprocessingData.getMediaDefaults().getDateTimeTaken();
}
if (exampleValue == null) exampleValue = new Date();
*/
@@ -501,9 +495,9 @@ private boolean onRenamerPopupMenuClick(MenuItem item) {
private boolean setFileRule(String namePart) {
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
- mCurrentData.setNumberFormat((namePart == null) ? "" : sharedPref.getString(PREF_LAST_RENAME_NUMBER_PATTERN, null));
- mCurrentData.setName((namePart == null) ? "" : namePart);
- mCurrentData.setDateFormat((namePart == null) ? "" : sharedPref.getString(PREF_LAST_RENAME_DATE_PATTERN, null));
+ mCurrentAutoprocessingData.setNumberFormat((namePart == null) ? "" : sharedPref.getString(PREF_LAST_RENAME_NUMBER_PATTERN, null));
+ mCurrentAutoprocessingData.setName((namePart == null) ? "" : namePart);
+ mCurrentAutoprocessingData.setDateFormat((namePart == null) ? "" : sharedPref.getString(PREF_LAST_RENAME_DATE_PATTERN, null));
toGui();
@@ -526,18 +520,43 @@ private void saveLastFilePattern(String dateFormat, String numberFormat) {
*/
private void onPickExif() {
fromGui();
- ExifEditActivity.showActivity("[4]", this, mCurrentData.getMediaDefaults(),
+ ExifEditActivity.showActivity("[4]", this, mCurrentAutoprocessingData.getMediaDefaults(),
null, getSelectedFiles(mDebugPrefix+"EditExif-", getIntent(),
false),
EXIF_EDIT_RESULT_ID, false);
}
+ /**
+ * #132: cmd exif long-press: infer exif from selected and schow exif editor
+ */
+ private boolean onReInferExifAndPick() {
+ fromGui();
+ IMetaApi currentMediaDefaults = mCurrentAutoprocessingData.getMediaDefaults();
+
+ SelectedFiles selectedFiles = getSelectedFiles(mDebugPrefix + "EditExif-", getIntent(),
+ false);
+ IMetaApi inferedMediaDefaults = MediaUtil.inferAutoprocessingExifDefaults(new MediaDTO(), selectedFiles.getFiles());
+
+ if (inferedMediaDefaults.getDescription() != null) currentMediaDefaults.setDescription(inferedMediaDefaults.getDescription());
+ if (inferedMediaDefaults.getLatitude() != null) currentMediaDefaults.setLatitudeLongitude(inferedMediaDefaults.getLatitude(), inferedMediaDefaults.getLongitude());
+
+ if (inferedMediaDefaults.getTags() != null) {
+ List tags = currentMediaDefaults.getTags();
+ ListUtils.include(tags, inferedMediaDefaults.getTags());
+ inferedMediaDefaults.setTags(tags);
+ }
+
+ ExifEditActivity.showActivity("[4]", this, currentMediaDefaults,
+ null, selectedFiles,
+ EXIF_EDIT_RESULT_ID, false);
+ return true;
+ }
/**
* exif editor result
*/
private void onExifChanged(IMetaApi modifiedExif) {
if (modifiedExif != null) {
- mCurrentData.setMediaDefaults(modifiedExif);
+ mCurrentAutoprocessingData.setMediaDefaults(modifiedExif);
toGui();
}
}
@@ -593,7 +612,7 @@ public boolean onCreateOptionsMenu(Menu menu) {
MenuItem item = menu.findItem(android.R.id.paste);
final File clipboardDir = ClipboardUtil.getClipboardDir(this);
- final File apmFile = (clipboardDir == null) ? null : PhotoWorkFlowDto.getApmFile(clipboardDir);
+ final File apmFile = (clipboardDir == null) ? null : PhotoAutoprocessingDto.getApmFile(clipboardDir);
if ((item != null) && (apmFile != null) && apmFile.exists()) {
item.setVisible(true);
}
@@ -645,9 +664,9 @@ private boolean onPaste() {
File dir = ClipboardUtil.getClipboardDir(this);
if (dir != null) {
try {
- PhotoWorkFlowDto srcApm = new PhotoWorkFlowDto().load(dir);
+ PhotoAutoprocessingDto srcApm = new PhotoAutoprocessingDto().load(dir);
if (srcApm != null) {
- mCurrentData.paste(srcApm);
+ mCurrentAutoprocessingData.paste(srcApm);
toGui();
return true;
}
@@ -691,8 +710,8 @@ protected void onResume() {
private void onOk() {
fromGui();
try {
- mCurrentData.save();
- saveLastFilePattern(mCurrentData.getDateFormat(), mCurrentData.getNumberFormat());
+ mCurrentAutoprocessingData.save();
+ saveLastFilePattern(mCurrentAutoprocessingData.getDateFormat(), mCurrentAutoprocessingData.getNumberFormat());
setResult(Activity.RESULT_OK, null);
} catch (IOException e) {
onFatalError("onOk()-save()", e);
@@ -701,7 +720,7 @@ private void onOk() {
}
private void clearFilter() {
- mCurrentData.clear();
+ mCurrentAutoprocessingData.clear();
toGui();
}
diff --git a/app/src/main/java/de/k3b/android/util/AndroidFileCommands.java b/app/src/main/java/de/k3b/android/util/AndroidFileCommands.java
index 9a829140..76f8977a 100644
--- a/app/src/main/java/de/k3b/android/util/AndroidFileCommands.java
+++ b/app/src/main/java/de/k3b/android/util/AndroidFileCommands.java
@@ -440,7 +440,7 @@ public int setGeo(double latitude, double longitude, SelectedFiles selectedItems
String dbgContext = "setGeo";
if (!Double.isNaN(latitude) && !Double.isNaN(longitude) && (selectedItems != null) && (selectedItems.size() > 0)) {
// in case that current activity is destroyed while running async, applicationContext will allow to finish database operation
- File[] files = SelectedFiles.getFiles(selectedItems.getFileNames());
+ File[] files = selectedItems.getFiles();
String errorMessage = checkWriteProtected(R.string.geo_edit_menu_title, files);
if (errorMessage != null) {
diff --git a/fotolib2/src/main/java/de/k3b/io/FileCommands.java b/fotolib2/src/main/java/de/k3b/io/FileCommands.java
index 86b34c54..3f9565d7 100644
--- a/fotolib2/src/main/java/de/k3b/io/FileCommands.java
+++ b/fotolib2/src/main/java/de/k3b/io/FileCommands.java
@@ -164,7 +164,7 @@ protected boolean deleteFileWithSidecar(File file) {
*/
public int applyExifChanges(boolean move, MediaDiffCopy exifChanges, SelectedFiles selectedFiles, IProgessListener progessListener) {
// source files are the same as dest files.
- final File[] destFiles = SelectedFiles.getFiles(selectedFiles.getFileNames());
+ final File[] destFiles = selectedFiles.getFiles();
return moveOrCopyFiles(move, "change_exif", exifChanges, selectedFiles, destFiles, progessListener);
}
@@ -177,7 +177,7 @@ public int applyExifChanges(boolean move, MediaDiffCopy exifChanges, SelectedFil
* @param destDirFolder where files are moved/copied to
* @param progessListener */
public int moveOrCopyFilesTo(boolean move, SelectedFiles selectedFiles, File destDirFolder, IProgessListener progessListener) {
- PhotoWorkFlowDto autoProccessData = (!LibGlobal.apmEnabled) ? null : getPhotoWorkFlowDto(destDirFolder);
+ PhotoAutoprocessingDto autoProccessData = (!LibGlobal.apmEnabled) ? null : getPhotoAutoprocessingDto(destDirFolder);
return moveOrCopyFilesTo(move, selectedFiles, destDirFolder, autoProccessData, progessListener);
}
@@ -193,7 +193,7 @@ public int moveOrCopyFilesTo(boolean move, SelectedFiles selectedFiles, File des
* @param autoProccessData null or data for auto rename/exif data
* @param progessListener */
int moveOrCopyFilesTo(boolean move, SelectedFiles selectedFiles, File destDirFolder,
- PhotoWorkFlowDto autoProccessData, IProgessListener progessListener) {
+ PhotoAutoprocessingDto autoProccessData, IProgessListener progessListener) {
boolean doNotRenameIfSourceInDestFolder = false;
IFileNameProcessor renameProcessor = null;
MediaDiffCopy exifChanges = null;
@@ -227,7 +227,7 @@ int moveOrCopyFilesTo(boolean move,
int result = 0;
if (canProcessFile(move ? OP_MOVE : OP_COPY)) {
if (osCreateDirIfNeccessary(destDirFolder)) {
- File[] destFiles = createDestFiles(renameProcessor, destDirFolder, selectedFiles.getDatesPhotoTaken() , SelectedFiles.getFiles(selectedFiles.getFileNames()));
+ File[] destFiles = createDestFiles(renameProcessor, destDirFolder, selectedFiles.getDatesPhotoTaken() , selectedFiles.getFiles());
result = moveOrCopyFiles(move, (move ? "mov" : "copy"), exifChanges, selectedFiles, destFiles, progessListener);
@@ -258,7 +258,7 @@ protected int moveOrCopyFiles(final boolean move, String what, MediaDiffCopy exi
int fileCount = destFiles.length;
Long[] ids = fotos.getIds();
- File[] sourceFiles = SelectedFiles.getFiles(fotos.getFileNames());
+ File[] sourceFiles = fotos.getFiles();
mModifiedSrcFiles = (move) ? new ArrayList() : null;
mModifiedDestFiles = new ArrayList();
@@ -373,10 +373,10 @@ protected int moveOrCopyFiles(final boolean move, String what, MediaDiffCopy exi
return itemCount;
}
- private PhotoWorkFlowDto getPhotoWorkFlowDto(File destDirFolder) {
- PhotoWorkFlowDto autoProccessData = null;
+ private PhotoAutoprocessingDto getPhotoAutoprocessingDto(File destDirFolder) {
+ PhotoAutoprocessingDto autoProccessData = null;
try {
- autoProccessData = new PhotoWorkFlowDto().load(destDirFolder);
+ autoProccessData = new PhotoAutoprocessingDto().load(destDirFolder);
} catch (IOException e) {
log("cannot load .apm file for '", destDirFolder, "'. ", e.getMessage());
autoProccessData = null;
diff --git a/fotolib2/src/main/java/de/k3b/io/GeoUtil.java b/fotolib2/src/main/java/de/k3b/io/GeoUtil.java
index 4d076233..08fa1ae6 100644
--- a/fotolib2/src/main/java/de/k3b/io/GeoUtil.java
+++ b/fotolib2/src/main/java/de/k3b/io/GeoUtil.java
@@ -162,9 +162,17 @@ public static boolean equals(Double lhs, Double rhs) {
* @return always != null: either GeoUtil.NO_LAT_LON if null, empty, unknown or value
*/
public static Double getValue(Double value) {
- if (value == null) return GeoUtil.NO_LAT_LON;
+ return getValue(value, GeoUtil.NO_LAT_LON);
+ }
+
+ /** normalized getGeoValue with null or NaN are translated to NO_LAT_LON.
+ * #91: Fix Photo without geo may have different representations values for no-value
+ * @return always != null: either GeoUtil.NO_LAT_LON if null, empty, unknown or value
+ */
+ public static Double getValue(Double value, Double noLatLonValue) {
+ if (value == null) return noLatLonValue;
double result = value.doubleValue();
- if (Double.isNaN(result) || (result == IGeoPointInfo.NO_LAT_LON)) return GeoUtil.NO_LAT_LON;
+ if (Double.isNaN(result) || (result == IGeoPointInfo.NO_LAT_LON) || (value == GeoUtil.NO_LAT_LON)) return noLatLonValue;
return value;
}
diff --git a/fotolib2/src/main/java/de/k3b/io/ListUtils.java b/fotolib2/src/main/java/de/k3b/io/ListUtils.java
index 7a083330..5dfe4590 100644
--- a/fotolib2/src/main/java/de/k3b/io/ListUtils.java
+++ b/fotolib2/src/main/java/de/k3b/io/ListUtils.java
@@ -21,6 +21,7 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.List;
/**
@@ -62,7 +63,7 @@ public static List toStringList(Object... list) {
return result;
}
- public static String toString(String elementDelimiter, List> list) {
+ public static String toString(String elementDelimiter, Collection> list) {
StringBuilder result = new StringBuilder();
if (list != null) {
String nextDelim = "";
@@ -95,15 +96,36 @@ public static String toString(String elementDelimiter, Object... list) {
}
return result.toString();
}
+
public static String[] asStringArray(List tags) {
if ((tags == null) || (tags.size() == 0)) return null;
String[] tagsArray = tags.toArray(new String[tags.size()]);
return tagsArray;
}
- /** return null if list has no elements */
+ /**
+ * return null if list has no elements
+ */
public static List emptyAsNull(List list) {
if ((list != null) && (list.size() > 0)) return list;
return null;
}
-}
\ No newline at end of file
+
+ /** add item "itemToBeAddedIfNotInList" to list if it is not in the list yet */
+ public static List include(List list, T itemToBeAddedIfNotInList) {
+ if ((itemToBeAddedIfNotInList != null) && (!list.contains(itemToBeAddedIfNotInList))) {
+ list.add(itemToBeAddedIfNotInList);
+ }
+ return list;
+ }
+
+ /** add all items from "itemsToBeAddedIfNotInList" to list that are not in the list yet */
+ public static List include(List list, Collection itemsToBeAddedIfNotInList) {
+ if (itemsToBeAddedIfNotInList != null) {
+ for (T itemToBeAddedIfNotInList : itemsToBeAddedIfNotInList) {
+ include(list, itemToBeAddedIfNotInList);
+ }
+ }
+ return list;
+ }
+}
diff --git a/fotolib2/src/main/java/de/k3b/io/PhotoWorkFlowDto.java b/fotolib2/src/main/java/de/k3b/io/PhotoAutoprocessingDto.java
similarity index 79%
rename from fotolib2/src/main/java/de/k3b/io/PhotoWorkFlowDto.java
rename to fotolib2/src/main/java/de/k3b/io/PhotoAutoprocessingDto.java
index 6574866e..1f1663e5 100644
--- a/fotolib2/src/main/java/de/k3b/io/PhotoWorkFlowDto.java
+++ b/fotolib2/src/main/java/de/k3b/io/PhotoAutoprocessingDto.java
@@ -34,17 +34,20 @@
import de.k3b.media.MediaAsString;
/**
- * #93: Persistable data for autoproccessing images (auto-rename, auto-add-exif)
+ * #93: Persistable data for autoproccessing images (auto-rename, auto-add-exif).
+ *
+ * Implemented as Properties file.
*
* Created by k3b on 04.08.2017.
*/
-public class PhotoWorkFlowDto {
+public class PhotoAutoprocessingDto {
private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
/** added to every serialized item if != null. Example "Generated on 2015-10-19 with myApp Version 0815." */
public static String sFileComment = "";
+ // KEY_xxx for properties file
private static final String KEY_DATE_FORMAT = "DateFormat";
private static final String KEY_NAME = "Name";
private static final String KEY_NUMBER_FORMAT = "NumberFormat";
@@ -54,16 +57,16 @@ public class PhotoWorkFlowDto {
private final Properties properties;
private File outDir;
- public PhotoWorkFlowDto() {
+ public PhotoAutoprocessingDto() {
this(null, new Properties());
}
- public PhotoWorkFlowDto(File outDir, Properties properties) {
+ public PhotoAutoprocessingDto(File outDir, Properties properties) {
this.outDir = outDir;
this.properties = properties;
}
- public PhotoWorkFlowDto load(File outDir) throws IOException {
+ public PhotoAutoprocessingDto load(File outDir) throws IOException {
this.outDir = outDir;
File apm = getApmFile();
properties.clear();
@@ -77,24 +80,30 @@ public PhotoWorkFlowDto load(File outDir) throws IOException {
}
return this;
} finally {
- FileUtils.close(inputStream,"PhotoWorkFlowDto.load(" + apm + ")");
+ FileUtils.close(inputStream,"PhotoAutoprocessingDto.load(" + apm + ")");
}
}
return null;
}
- public void paste(PhotoWorkFlowDto newData) {
+ public void paste(PhotoAutoprocessingDto newData) {
if (newData != null) {
this.setDateFormat(newData.getDateFormat());
this.setNumberFormat(newData.getNumberFormat());
this.setMediaDefaults(newData.getMediaDefaults());
+
+ // Fix Autoprocessing/PhotoAutoprocessingDto renaming rules that contain source file direcory names.
String name = getTranslateName(newData);
this.setName(name);
}
}
- public String getTranslateName(PhotoWorkFlowDto newData) {
+ /**
+ * Get the fixed rename-name part in case Autoprocessing/PhotoAutoprocessingDto was moved/copied to a
+ * different dir and renaming rules contain source file direcory names.
+ */
+ public String getTranslateName(PhotoAutoprocessingDto newData) {
if (newData != null) {
final RuleFileNameProcessor srcData = (RuleFileNameProcessor) newData.createFileNameProcessor();
if (srcData != null) {
@@ -127,25 +136,25 @@ public void save() throws IOException {
logger.debug(this.getClass().getSimpleName() + ": save to " + apm + ":" + this);
}
stream = new FileOutputStream(apm);
- properties.store(stream, PhotoWorkFlowDto.sFileComment);
+ properties.store(stream, PhotoAutoprocessingDto.sFileComment);
} finally {
- FileUtils.close(stream, "PhotoWorkFlowDto.load(" + apm + ")");
+ FileUtils.close(stream, "PhotoAutoprocessingDto.load(" + apm + ")");
}
}
}
/** Android support: to persist state and to transfer activites via intent. */
- public static PhotoWorkFlowDto load(Serializable content) {
- PhotoWorkFlowDto photoWorkFlowDto = null;
+ public static PhotoAutoprocessingDto load(Serializable content) {
+ PhotoAutoprocessingDto photoAutoprocessingDto = null;
if (content instanceof Properties ) {
Properties properties = (Properties) content;
String outDir = properties.getProperty(KEY_OUT_DIR);
- photoWorkFlowDto = new PhotoWorkFlowDto((outDir != null) ? new File(outDir) : null, properties);
+ photoAutoprocessingDto = new PhotoAutoprocessingDto((outDir != null) ? new File(outDir) : null, properties);
}
if (LibGlobal.debugEnabled) {
- logger.debug(PhotoWorkFlowDto.class.getSimpleName() + ": load De-Serialize:" + photoWorkFlowDto);
+ logger.debug(PhotoAutoprocessingDto.class.getSimpleName() + ": load De-Serialize:" + photoAutoprocessingDto);
}
- return photoWorkFlowDto;
+ return photoAutoprocessingDto;
}
/** Android support: to persist state and to transfer activites via intent */
@@ -162,7 +171,7 @@ public String getDateFormat() {
}
/** DateFormat part for {@link RuleFileNameProcessor} */
- public PhotoWorkFlowDto setDateFormat(String dateFormat) {
+ public PhotoAutoprocessingDto setDateFormat(String dateFormat) {
setProperty(KEY_DATE_FORMAT,dateFormat);
return this;
}
@@ -173,7 +182,7 @@ public String getName() {
}
/** fixed-Name part for {@link RuleFileNameProcessor} */
- public PhotoWorkFlowDto setName(String Name) {
+ public PhotoAutoprocessingDto setName(String Name) {
setProperty(KEY_NAME,Name);
return this;
}
@@ -184,7 +193,7 @@ public String getNumberFormat() {
}
/** NumberFormat part for {@link RuleFileNameProcessor} */
- public PhotoWorkFlowDto setNumberFormat(String NumberFormat) {
+ public PhotoAutoprocessingDto setNumberFormat(String NumberFormat) {
setProperty(KEY_NUMBER_FORMAT,NumberFormat);
return this;
}
@@ -192,7 +201,7 @@ public PhotoWorkFlowDto setNumberFormat(String NumberFormat) {
public File getOutDir() {
return outDir;
}
- public PhotoWorkFlowDto setOutDir(File outDir) {
+ public PhotoAutoprocessingDto setOutDir(File outDir) {
this.outDir = outDir;
return this;
}
@@ -201,12 +210,14 @@ public IFileNameProcessor createFileNameProcessor() {
return new RuleFileNameProcessor(getDateFormat(), getName(), getNumberFormat(), getOutDir());
}
+ /** exif data that should be applied to every jpg file */
public IMetaApi getMediaDefaults() {
String mediaDefaultString = getProperty(KEY_EXIF);
return (mediaDefaultString == null) ? null : new MediaAsString().fromString(mediaDefaultString);
}
- public PhotoWorkFlowDto setMediaDefaults(IMetaApi mediaDefaults) {
+ /** exif data that should be applied to every jpg file */
+ public PhotoAutoprocessingDto setMediaDefaults(IMetaApi mediaDefaults) {
String mediaDefaultString = null;
if (mediaDefaults != null) {
mediaDefaultString = (mediaDefaults instanceof MediaAsString)
diff --git a/fotolib2/src/main/java/de/k3b/io/RuleFileNameProcessor.java b/fotolib2/src/main/java/de/k3b/io/RuleFileNameProcessor.java
index f160089f..b8d24c45 100644
--- a/fotolib2/src/main/java/de/k3b/io/RuleFileNameProcessor.java
+++ b/fotolib2/src/main/java/de/k3b/io/RuleFileNameProcessor.java
@@ -75,6 +75,9 @@ public RuleFileNameProcessor(String dateFormat, String name, String numberFormat
set(dateFormat, name, numberFormat);
}
+ /**
+ * Fix Autoprocessing/PhotoAutoprocessingDto renaming rules that contain source file direcory names.
+ */
public RuleFileNameProcessor(RuleFileNameProcessor ancestor, File newDir) {
this(newDir);
if (ancestor != null) {
@@ -261,6 +264,9 @@ private static boolean isLetter(String name, int offset) {
return result;
}
+ /**
+ * Fix Autoprocessing/PhotoAutoprocessingDto renaming rules that contain source file direcory names.
+ */
public static String translateName(RuleFileNameProcessor srcData, File outDir) {
RuleFileNameProcessor translated = new RuleFileNameProcessor(srcData, outDir);
return translated.mName;
diff --git a/fotolib2/src/main/java/de/k3b/io/collections/SelectedFiles.java b/fotolib2/src/main/java/de/k3b/io/collections/SelectedFiles.java
index 38a2ab85..e2782302 100644
--- a/fotolib2/src/main/java/de/k3b/io/collections/SelectedFiles.java
+++ b/fotolib2/src/main/java/de/k3b/io/collections/SelectedFiles.java
@@ -105,6 +105,10 @@ public static File[] getFiles(String[] fileNames) {
return result;
}
+ public File[] getFiles() {
+ return SelectedFiles.getFiles(getFileNames());
+ }
+
public int getNonEmptyNameCount() {
int result = 0;
if (mFileNames != null) {
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaUtil.java b/fotolib2/src/main/java/de/k3b/media/MediaUtil.java
index b78b473f..9c46d986 100644
--- a/fotolib2/src/main/java/de/k3b/media/MediaUtil.java
+++ b/fotolib2/src/main/java/de/k3b/media/MediaUtil.java
@@ -19,17 +19,23 @@
package de.k3b.media;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.io.File;
import java.io.FilenameFilter;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.EnumSet;
import java.util.List;
+import de.k3b.LibGlobal;
import de.k3b.io.DateUtil;
import de.k3b.io.FileUtils;
import de.k3b.io.GeoUtil;
+import de.k3b.io.ListUtils;
import de.k3b.io.StringUtils;
import de.k3b.io.VISIBILITY;
import de.k3b.tagDB.TagConverter;
@@ -39,6 +45,7 @@
*/
public class MediaUtil {
+ private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
/** image will get this fileextension if updated from private image to public image. */
private static final String EXT_JPG = ".jpg";
@@ -421,4 +428,56 @@ public static int exifOrientationCode2RotationDegrees(int exifOrientationCode, i
}
return notFoundValue;
}
+
+ /** loads IMetaApi from jpg and corresponding xmp */
+ public static IMetaApi loadExifAndXmp(String fileName, String dbg_context) {
+ try {
+ MediaXmpSegment xmp = MediaXmpSegment.loadXmpSidecarContentOrNull(fileName, dbg_context);
+
+ ImageMetaReader jpg = new ImageMetaReader().load(fileName, null, xmp, dbg_context);
+
+ return jpg;
+ } catch (IOException ex) {
+ logger.error(dbg_context, "MediaUtil.loadExifAndXmp", ex);
+ }
+ return null;
+ }
+
+ /** #132: reads lat,lon,description,tags from files until tags and lat/long are found */
+ public static T inferAutoprocessingExifDefaults(T result, File... files) {
+ return inferAutoprocessingExifDefaults(result, files, null,null,null, null);
+ }
+
+ /** #132: reads lat,lon,description,tags from files until tags and lat/long are found */
+ public static T inferAutoprocessingExifDefaults(T result,
+ File[] files,
+ Double latitude,
+ Double longitude,
+ String description,
+ List _tags) {
+ List tags = (_tags == null) ? new ArrayList() : _tags;
+
+ int exampleCount = files.length;
+ int index = 0;
+ while ((index < exampleCount) && ((latitude == null) || (longitude == null) || (tags.size() == 0))) {
+ File exampleFile = files[index++];
+
+ if ((exampleFile != null) && (exampleFile.exists())) {
+ IMetaApi example = MediaUtil.loadExifAndXmp(exampleFile.getPath(),"infer defaults for autoprocessing");
+ if (example != null) {
+ ListUtils.include(tags, example.getTags());
+ latitude = GeoUtil.getValue(example.getLatitude(), latitude);
+ longitude = GeoUtil.getValue(example.getLongitude(), longitude);
+ if (StringUtils.isNullOrEmpty(description)) description = example.getDescription();
+ }
+ }
+ }
+ result.setLatitudeLongitude(latitude,longitude)
+ .setDescription(description)
+ .setTags(tags);
+
+ return result;
+ }
+
+
}
\ No newline at end of file
diff --git a/fotolib2/src/test/java/de/k3b/TestUtil.java b/fotolib2/src/test/java/de/k3b/TestUtil.java
index 1538b047..14c5c7be 100644
--- a/fotolib2/src/test/java/de/k3b/TestUtil.java
+++ b/fotolib2/src/test/java/de/k3b/TestUtil.java
@@ -35,8 +35,14 @@
import de.k3b.tagDB.TagConverter;
public class TestUtil {
+ // where unittest-files are processed
public static final File OUTDIR_ROOT = new File("./build/test-results/metafiles");
+ // these test files exist as embedded resources
+ public static final String TEST_FILE_JPG_WITH_EXIF = "test-WitExtraData.jpg";
+ public static final String TEST_FILE_XMP_WITH_EXIF = "test-WitExtraData.xmp";
+ public static final String TEST_FILE_JPG_WITH_NO_EXIF = "NoExif.jpg";
+
public static Reader createReader(String csvSrc) {
return new java.io.StringReader(csvSrc);
// return new InputStreamReader(new ByteArrayInputStream(csvSrc.getBytes("UTF-8")));
@@ -76,12 +82,23 @@ public static InputStream getResourceInputStream(String fileName) {
return inputStream;
}
- public static void saveTestResourceAs(String resourceName, File destination) throws IOException {
+ public static File saveTestResourceAs(String resourceName, File destination) throws IOException {
InputStream sourceStream = getResourceInputStream(resourceName);
FileUtils.copyReplace(sourceStream, destination);
FileUtils.close(sourceStream,resourceName);
destination.setLastModified(DateUtil.parseIsoDate("1972-03-04T05:06:07").getTime());
+ return destination;
+ }
+
+ public static File[] saveTestResourcesIn(File destinationFolder, String... resourceNames) throws IOException {
+ File[] result = new File[resourceNames.length];
+
+ for(int i = 0; i testItems = new HashMap();
diff --git a/fotolib2/src/test/java/de/k3b/media/ImageMetaReaderIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/ImageMetaReaderIntegrationTests.java
index 2f2211dd..07288f57 100644
--- a/fotolib2/src/test/java/de/k3b/media/ImageMetaReaderIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/ImageMetaReaderIntegrationTests.java
@@ -55,7 +55,7 @@ public static void initDirectories() {
@Before
public void setup() throws IOException {
ImageMetaReader.DEBUG = true;
- sut = getMeta("test-WitExtraData.jpg");
+ sut = getMeta(TestUtil.TEST_FILE_JPG_WITH_EXIF);
}
@Test
diff --git a/fotolib2/src/test/java/de/k3b/media/JpgMetaWorkflowIntegratoinTests.java b/fotolib2/src/test/java/de/k3b/media/JpgMetaWorkflowIntegratoinTests.java
index 39241c9f..0fecabb5 100644
--- a/fotolib2/src/test/java/de/k3b/media/JpgMetaWorkflowIntegratoinTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/JpgMetaWorkflowIntegratoinTests.java
@@ -64,7 +64,7 @@ public static void initDirectories() {
public void shouldUpdateExistingExifWithCreateXmp() throws IOException
{
LibGlobal.mediaUpdateStrategy = "JXC";
- String fileNameSrc = "test-WitExtraData.jpg";
+ String fileNameSrc = TestUtil.TEST_FILE_JPG_WITH_EXIF;
String fileNameDest = "shouldUpdateExistingExifWithCreateXmp.jpg";
File testJpg = copy(fileNameSrc, fileNameDest);
diff --git a/fotolib2/src/test/java/de/k3b/media/MediaUtilTests.java b/fotolib2/src/test/java/de/k3b/media/MediaUtilTests.java
index 16538376..c7c28385 100644
--- a/fotolib2/src/test/java/de/k3b/media/MediaUtilTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/MediaUtilTests.java
@@ -26,6 +26,8 @@
import org.junit.Assert;
import org.junit.Test;
+import java.io.File;
+import java.io.IOException;
import java.util.List;
import de.k3b.TestUtil;
@@ -179,9 +181,26 @@ public void shouldNotCalculateModifiedPath() {
check(null, "/path/to/file.jpg", VISIBILITY.DEFAULT);
}
+
private void check(String expected, String actual, VISIBILITY visibility) {
Assert.assertEquals(visibility +
"(" + actual + ")=>" +expected, expected, MediaUtil.getModifiedPath(actual,visibility));
}
+ /***** Integrationtests via file system *********/
+ private static final File INDIR = new File(TestUtil.OUTDIR_ROOT, "MediaUtilTests");
+
+ @Test
+ public void shouldInferAutoprocessingExifDefaultsFromExistingFiles() throws IOException {
+ File[] jpgFilesToAnalyse = TestUtil.saveTestResourcesIn(INDIR,
+ TestUtil.TEST_FILE_JPG_WITH_NO_EXIF,
+ TestUtil.TEST_FILE_JPG_WITH_EXIF);
+ MediaAsString result = MediaUtil.inferAutoprocessingExifDefaults(new MediaAsString(),
+ jpgFilesToAnalyse);
+
+ Assert.assertEquals(
+ "regression: description, lat, lon, tags should be identical to " + TestUtil.TEST_FILE_JPG_WITH_EXIF,
+ ",,ImageDescription,,27.818611,-15.764444,\"Marker1, Marker2\"", result.toString());
+ }
+
}
diff --git a/fotolib2/src/test/java/de/k3b/media/MediaXmpSegmentIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/MediaXmpSegmentIntegrationTests.java
index db78d451..013802d8 100644
--- a/fotolib2/src/test/java/de/k3b/media/MediaXmpSegmentIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/MediaXmpSegmentIntegrationTests.java
@@ -52,7 +52,7 @@ public static void initDirectories() {
@Before
public void setup() throws IOException {
// MediaXmpSegment.DEBUG = true;
- sut = getMeta("test-WitExtraData.xmp");
+ sut = getMeta(TestUtil.TEST_FILE_XMP_WITH_EXIF);
TimeZone.setDefault(DateUtil.UTC);
}
diff --git a/fotolib2/src/test/java/de/k3b/media/MediaXmpTests.java b/fotolib2/src/test/java/de/k3b/media/MediaXmpTests.java
index 84d10271..2775b947 100644
--- a/fotolib2/src/test/java/de/k3b/media/MediaXmpTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/MediaXmpTests.java
@@ -54,7 +54,7 @@ public static void initDirectories() {
public void shouldReadExistingXmpFile() throws IOException {
TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
MediaXmpSegment sut = new MediaXmpSegment();
- InputStream fis = getStream("images/test-WitExtraData.xmp");
+ InputStream fis = TestUtil.getResourceInputStream(TestUtil.TEST_FILE_XMP_WITH_EXIF);
sut = new MediaXmpSegment();
sut.load(fis, "JUnit");
fis.close();
diff --git a/fotolib2/src/test/java/de/k3b/media/MetaWriterExifXmlIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/MetaWriterExifXmlIntegrationTests.java
index b822b394..fb62d072 100644
--- a/fotolib2/src/test/java/de/k3b/media/MetaWriterExifXmlIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/MetaWriterExifXmlIntegrationTests.java
@@ -58,7 +58,7 @@ public void emptyWriteEmptyExifXmpCreate() throws IOException
ExifInterfaceEx.fixDateOnSave = false;
File out = new File(OUTDIR,"emptyWriteEmptyExifXmpCreate.jpg");
- TestUtil.saveTestResourceAs("NoExif.jpg", out);
+ TestUtil.saveTestResourceAs(TestUtil.TEST_FILE_JPG_WITH_NO_EXIF, out);
MetaWriterExifXml sut = MetaWriterExifXml.create(out.getAbsolutePath(), null, false, "JUnit"
, true, true, true); //exif, xmp, create
@@ -87,8 +87,8 @@ public void existingWriteEmptyExifXmp() throws IOException
ExifInterfaceEx.fixDateOnSave = false;
File out = new File(OUTDIR,"existingWriteEmptyExifXmp.jpg");
- TestUtil.saveTestResourceAs("test-WitExtraData.jpg", out);
- TestUtil.saveTestResourceAs("test-WitExtraData.xmp", FileCommands.getSidecar(out.getAbsolutePath(), false));
+ TestUtil.saveTestResourceAs(TestUtil.TEST_FILE_JPG_WITH_EXIF, out);
+ TestUtil.saveTestResourceAs(TestUtil.TEST_FILE_XMP_WITH_EXIF, FileCommands.getSidecar(out.getAbsolutePath(), false));
MetaWriterExifXml sut = MetaWriterExifXml.create(out.getAbsolutePath(), null, false, "JUnit"
, true, true, true); //exif, xmp, create
@@ -114,7 +114,7 @@ public void existingWriteEmptyExifXmp() throws IOException
public void existingWriteValueExifXmpCreate() throws IOException
{
File out = new File(OUTDIR,"existingWriteValueExifXmpCreate.jpg");
- TestUtil.saveTestResourceAs("test-WitExtraData.jpg", out);
+ TestUtil.saveTestResourceAs(TestUtil.TEST_FILE_JPG_WITH_EXIF, out);
MetaWriterExifXml sut = MetaWriterExifXml.create(out.getAbsolutePath(), null, false, "JUnit"
, true, true, true); //exif, xmp, create
@@ -144,7 +144,7 @@ private static MediaDTO createTestValue() {
public void emptyWriteValuesXmpCreate() throws IOException
{
File out = new File(OUTDIR,"emptyWriteValuesXmpCreate.jpg");
- TestUtil.saveTestResourceAs("NoExif.jpg", out);
+ TestUtil.saveTestResourceAs(TestUtil.TEST_FILE_JPG_WITH_NO_EXIF, out);
MetaWriterExifXml sut = MetaWriterExifXml.create(out.getAbsolutePath(), null, false, "JUnit"
, false, true, true); //exif, xmp, create
@@ -165,7 +165,7 @@ public void emptyWriteValuesXmpCreate() throws IOException
public void emptyWriteValuesExifOnly() throws IOException
{
File out = new File(OUTDIR,"emptyWriteValuesExifOnly.jpg");
- TestUtil.saveTestResourceAs("NoExif.jpg", out);
+ TestUtil.saveTestResourceAs(TestUtil.TEST_FILE_JPG_WITH_NO_EXIF, out);
MetaWriterExifXml sut = MetaWriterExifXml.create(out.getAbsolutePath(), null, false, "JUnit"
, true, false, false); //exif, xmp, create
From 044bd4ce4b97423e9ca489b92ad6ee207d6522ac Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Sun, 11 Nov 2018 11:53:29 +0100
Subject: [PATCH 04/35] #133: Additional filtercriteria date-last-modified from
... to
---
.../GalleryFilterActivity.java | 42 +-
.../androFotoFinder/queries/FotoSql.java | 120 +-
.../de/k3b/android/util/MediaScanner.java | 7 +-
.../k3b/android/widget/BaseQueryActivity.java | 118 +-
.../res/layout/activity_gallery_filter.xml | 1001 ++++++++++-------
.../tagDB/TagSqlQueryParserTests.java | 3 +-
.../metadata/android/en-US/changelogs/41.txt | 2 +
.../de/k3b/io/GalleryFilterParameter.java | 46 +-
.../main/java/de/k3b/io/IGalleryFilter.java | 4 +
.../de/k3b/io/GalleryFilterParameterTest.java | 7 +-
10 files changed, 875 insertions(+), 475 deletions(-)
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/GalleryFilterActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/GalleryFilterActivity.java
index 5a0e00dd..21d0d33b 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/GalleryFilterActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/GalleryFilterActivity.java
@@ -213,6 +213,17 @@ public void onClick(View v) {
LibGlobal.datePickerUseDecade, path);
}
});
+ cmd = (Button) findViewById(R.id.cmd_date_modified);
+ cmd.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ String path = getAsGalleryFilter().getDateModifiedPath();
+ showDirectoryPickerForFilterParamValue(
+ mDebugPrefix + " date modified picker " + path,
+ FotoSql.queryGroupByDateModified, false,
+ LibGlobal.datePickerUseDecade, path);
+ }
+ });
cmd = (Button) findViewById(R.id.cmd_select_lat_lon);
cmd.setOnClickListener(new View.OnClickListener() {
@Override
@@ -342,6 +353,7 @@ private void loadLastFilter() {
loadLastFilter(sharedPref, FotoSql.QUERY_TYPE_GALLERY);
loadLastFilter(sharedPref, FotoSql.QUERY_TYPE_GROUP_DATE);
loadLastFilter(sharedPref, FotoSql.QUERY_TYPE_GROUP_PLACE);
+ loadLastFilter(sharedPref, FotoSql.QUERY_TYPE_GROUP_DATE_MODIFIED);
}
private void loadLastFilter(SharedPreferences sharedPref, int queryTypeID) {
@@ -394,6 +406,8 @@ private class FilterValue implements IGalleryFilter {
private EditText mDateFrom;
private EditText mDateTo;
+ private EditText mDateModifiedFrom;
+ private EditText mDateModifiedTo;
private EditText mLongitudeFrom;
private EditText mLongitudeTo;
private EditText mLatitudeTo;
@@ -415,6 +429,8 @@ private class FilterValue implements IGalleryFilter {
this.mTagsExclude = (EditText) findViewById(R.id.edit_tags_exclude);
this.mDateFrom = (EditText) findViewById(R.id.edit_date_from);
this.mDateTo = (EditText) findViewById(R.id.edit_date_to);
+ this.mDateModifiedFrom = (EditText) findViewById(R.id.edit_date_modified_from);
+ this.mDateModifiedTo = (EditText) findViewById(R.id.edit_date_modified_to);
this.mLatitudeFrom = (EditText) findViewById(R.id.edit_latitude_from);
this.mLatitudeTo = (EditText) findViewById(R.id.edit_latitude_to);
this.mLongitudeFrom = (EditText) findViewById(R.id.edit_longitude_from);
@@ -451,13 +467,18 @@ public void onClick(View v) {
R.id.cmd_path_history,
R.id.cmd_date_from_history,
R.id.cmd_date_to_history,
+ R.id.cmd_date_modified_from_history,
+ R.id.cmd_date_modified_to_history,
R.id.cmd_lat_from_history, R.id.cmd_lat_to_history, R.id.cmd_lon_from_history, R.id.cmd_lon_to_history ,
R.id.cmd_any_history,
R.id.cmd_tags_include_history,
R.id.cmd_tags_exclude_history} ,
mPath ,
mDateFrom ,
- mDateTo, mLatitudeFrom, mLatitudeTo, mLongitudeFrom, mLongitudeTo,
+ mDateTo,
+ mDateModifiedFrom ,
+ mDateModifiedTo,
+ mLatitudeFrom, mLatitudeTo, mLongitudeFrom, mLongitudeTo,
mAny ,
mTagsInclude ,
mTagsExclude);
@@ -508,7 +529,7 @@ protected void showLatLon(boolean noGeoInfo) {
private void show(boolean checked, int... ids) {
for(int id:ids)
- findViewById(id).setVisibility((!checked) ? View.VISIBLE : View.INVISIBLE );
+ findViewById(id).setVisibility((!checked) ? View.VISIBLE : View.GONE );
}
/** minimum latitude, in degrees north. -90..+90 */
@@ -569,6 +590,16 @@ public long getDateMax() {
return convertDate(mDateTo.getText().toString());
}
+ @Override
+ public long getDateModifiedMin() {
+ return convertDate(mDateModifiedFrom.getText().toString());
+ }
+
+ @Override
+ public long getDateModifiedMax() {
+ return convertDate(mDateModifiedTo.getText().toString());
+ }
+
@Override
public boolean isNonGeoOnly() {
return mWithNoGeoInfo.isChecked();
@@ -615,6 +646,8 @@ public IGalleryFilter get(IGalleryFilter src) {
mTagsExclude .setText(GalleryFilterParameter.convertList(src.getTagsAllExcluded()));
mDateFrom.setText(convertDate(src.getDateMin()));
mDateTo.setText(convertDate(src.getDateMax()));
+ mDateModifiedFrom.setText(convertDate(src.getDateModifiedMin()));
+ mDateModifiedTo.setText(convertDate(src.getDateModifiedMax()));
mWithNoGeoInfo.setChecked(src.isNonGeoOnly());
mWithNoTags.setChecked(src.isWithNoTags());
mRatingBar.setRating(src.getRatingMin());
@@ -840,7 +873,10 @@ private void onDirectoryDataLoadCompleteForFilterParamValue(IDirectory directory
int menuResId = 0; // no menu in app lock mode
if (!LockScreen.isLocked(this)) {
- menuResId = (queryId == FotoSql.QUERY_TYPE_GROUP_DATE) ? R.menu.menu_context_datepicker : R.menu.menu_context_dirpicker;
+ menuResId = R.menu.menu_context_dirpicker;
+ if ((queryId == FotoSql.QUERY_TYPE_GROUP_DATE) || (queryId == FotoSql.QUERY_TYPE_GROUP_DATE)) {
+ menuResId = R.menu.menu_context_datepicker;
+ }
}
dlg.setContextMenuId(menuResId);
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java
index ee853eaa..c13e5d9c 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java
@@ -92,6 +92,9 @@ public class FotoSql extends FotoSqlBase {
public static final int QUERY_TYPE_GROUP_PLACE = 14;
public static final int QUERY_TYPE_GROUP_PLACE_MAP = 141;
+ public static final int QUERY_TYPE_GROUP_DATE_MODIFIED = 16;
+
+
public static final int QUERY_TYPE_GROUP_COPY = 20;
public static final int QUERY_TYPE_GROUP_MOVE = 21;
@@ -139,6 +142,10 @@ public class FotoSql extends FotoSqlBase {
public static final String SQL_COL_EXT_MEDIA_TYPE = MediaStore.Files.FileColumns.MEDIA_TYPE;
public static final int MEDIA_TYPE_IMAGE = MediaStore.Files.FileColumns.MEDIA_TYPE_IMAGE; // 1
+
+ // used to translate between LAST_MODIFIED in database (secs since 1970) and internal format (java date milli secs simce 1970)
+ private static final int LAST_MODIFIED_FACTOR = 1000;
+
public static final int MEDIA_TYPE_IMAGE_PRIVATE = 1000 + MEDIA_TYPE_IMAGE; // 1001 APhoto manager specific
public static final int MEDIA_TYPE_ALBUM_FILE = 0;
@@ -156,12 +163,19 @@ public class FotoSql extends FotoSqlBase {
private static final String FILTER_EXPR_LON_MIN = SQL_COL_LON + " >= ?";
protected static final String FILTER_EXPR_RATING_MIN = SQL_COL_EXT_RATING + " >= ?";
+ // SQL_COL_DATE_TAKEN and "?" in milli-seconds since 1970
private static final String FILTER_EXPR_DATE_MAX = SQL_COL_DATE_TAKEN + " < ?";
private static final String FILTER_EXPR_DATE_MIN = SQL_COL_DATE_TAKEN + " >= ?";
+
+ // SQL_COL_LAST_MODIFIED in seconds since 1970; "?" in milli-seconds since 1970
+ private static final String FILTER_EXPR_DATE_MODIFIED_MAX = SQL_COL_LAST_MODIFIED + " < ?";
+ private static final String FILTER_EXPR_DATE_MODIFIED_MIN = SQL_COL_LAST_MODIFIED + " >= ?";
protected static final String FILTER_EXPR_PATH_LIKE = "(" + SQL_COL_PATH + " like ?)";
// same format as dir. i.e. description='/2014/12/24/' or '/mnt/sdcard/pictures/'
- public static final String SQL_EXPR_DAY = "strftime('/%Y/%m/%d/', " + SQL_COL_DATE_TAKEN + " /1000, 'unixepoch', 'localtime')";
+ public static final String SQL_EXPR_DAY = "strftime('/%Y/%m/%d/', " + SQL_COL_DATE_TAKEN + " / " +
+ LAST_MODIFIED_FACTOR + ", 'unixepoch', 'localtime')";
+ public static final String SQL_EXPR_DAY_MODIFIED = "strftime('/%Y/%m/%d/', " + SQL_COL_LAST_MODIFIED + ", 'unixepoch', 'localtime')";
public static final QueryParameter queryGroupByDate = new QueryParameter()
.setID(QUERY_TYPE_GROUP_DATE)
@@ -176,6 +190,19 @@ public class FotoSql extends FotoSqlBase {
.addGroupBy(SQL_EXPR_DAY)
.addOrderBy(SQL_EXPR_DAY);
+ public static final QueryParameter queryGroupByDateModified = new QueryParameter()
+ .setID(QUERY_TYPE_GROUP_DATE_MODIFIED)
+ .addColumn(
+ "max(" + SQL_COL_PK + ") AS " + SQL_COL_PK,
+ SQL_EXPR_DAY_MODIFIED + " AS " + SQL_COL_DISPLAY_TEXT,
+ "count(*) AS " + SQL_COL_COUNT,
+ "max(" + SQL_COL_GPS + ") AS " + SQL_COL_GPS,
+ "max(" + SQL_COL_PATH + ") AS " + SQL_COL_PATH)
+ .addFrom(SQL_TABLE_EXTERNAL_CONTENT_URI_FILE_NAME)
+ .addWhere(FILTER_EXPR_PRIVATE_PUBLIC)
+ .addGroupBy(SQL_EXPR_DAY_MODIFIED)
+ .addOrderBy(SQL_EXPR_DAY_MODIFIED);
+
public static final String SQL_EXPR_FOLDER = "substr(" + SQL_COL_PATH + ",1,length(" + SQL_COL_PATH + ") - length(" + MediaStore.Images.Media.DISPLAY_NAME + "))";
public static final QueryParameter queryGroupByDir = new QueryParameter()
.setID(QUERY_TYPE_GROUP_ALBUM)
@@ -328,17 +355,27 @@ public static void filter2Query(QueryParameter resultQuery, IGalleryFilter filte
addWhereFilterLatLon(resultQuery, filter);
addWhereDateMinMax(resultQuery, filter.getDateMin(), filter.getDateMax());
+ addWhereDateModifiedMinMax(resultQuery, filter.getDateModifiedMin(), filter.getDateModifiedMax());
String path = filter.getPath();
if ((path != null) && (path.length() > 0)) resultQuery.addWhere(FILTER_EXPR_PATH_LIKE, path);
}
}
- public static void addWhereDateMinMax(QueryParameter resultQuery, final long dateMin, final long dateMax) {
+ public static void addWhereDateMinMax(QueryParameter resultQuery, final long dateMinInMilliSecs1970, final long dateMaxInMilliSecs1970) {
+
+ // SQL_COL_DATE_TAKEN and "?" in milli-seconds since 1970 no translaton neccessary
+ if (dateMinInMilliSecs1970 != 0) resultQuery.addWhere(FILTER_EXPR_DATE_MIN, Long.toString(dateMinInMilliSecs1970));
+
+ if (dateMaxInMilliSecs1970 != 0) resultQuery.addWhere(FILTER_EXPR_DATE_MAX, Long.toString(dateMaxInMilliSecs1970));
+ }
+
+ public static void addWhereDateModifiedMinMax(QueryParameter resultQuery, final long dateMinInMilliSecs1970, final long dateMaxInMilliSecs1970) {
- if (dateMin != 0) resultQuery.addWhere(FILTER_EXPR_DATE_MIN, Long.toString(dateMin));
+ // SQL_COL_LAST_MODIFIED in seconds since 1970; translate from MilliSecs
+ if (dateMinInMilliSecs1970 != 0) resultQuery.addWhere(FILTER_EXPR_DATE_MODIFIED_MIN, Long.toString(dateMinInMilliSecs1970 / LAST_MODIFIED_FACTOR));
- if (dateMax != 0) resultQuery.addWhere(FILTER_EXPR_DATE_MAX, Long.toString(dateMax));
+ if (dateMaxInMilliSecs1970 != 0) resultQuery.addWhere(FILTER_EXPR_DATE_MODIFIED_MAX, Long.toString(dateMaxInMilliSecs1970 / LAST_MODIFIED_FACTOR));
}
/** translates a query back to filter */
@@ -348,9 +385,14 @@ public static IGalleryFilter parseQuery(QueryParameter query, boolean removeFrom
parseQueryGeo(query, filter, removeFromSourceQuery);
filter.setRatingMin(GalleryFilterParameter.parseRating(getParam(query, FILTER_EXPR_RATING_MIN, removeFromSourceQuery)));
- filter.setDate(getParam(query, FILTER_EXPR_DATE_MIN, removeFromSourceQuery), getParam(query, FILTER_EXPR_DATE_MAX, removeFromSourceQuery));
+ filter.setDate(getParam(query, FILTER_EXPR_DATE_MIN, removeFromSourceQuery),
+ getParam(query, FILTER_EXPR_DATE_MAX, removeFromSourceQuery));
filter.setPath(getFilePath(query, removeFromSourceQuery));
+ // SQL_COL_LAST_MODIFIED in seconds since 1970; translate from MilliSecs
+ filter.setDateModified(getParamWithFix(query, FILTER_EXPR_DATE_MODIFIED_MIN, removeFromSourceQuery, LAST_MODIFIED_FACTOR),
+ getParamWithFix(query, FILTER_EXPR_DATE_MODIFIED_MAX, removeFromSourceQuery, LAST_MODIFIED_FACTOR));
+
return filter;
}
return null;
@@ -404,6 +446,18 @@ protected static String getParam(QueryParameter query, String expresion, boolean
return ((result != null) && (result.length > 0)) ? result[0] : null;
}
+ /** @return return param for expression inside query. null if expression is not in query or number of params is not 1. */
+ protected static long getParamWithFix(QueryParameter query, String expresion, boolean removeFromSourceQuery, long factor) {
+ try {
+ String svalue = getParam(query, expresion, removeFromSourceQuery);
+ long lvalue = Long.parseLong(svalue);
+ return lvalue * factor;
+ } catch (Exception ignore) {
+
+ }
+ return 0;
+ }
+
/** @return return all params for expression inside query. null if expression is not in query */
protected static String[] getParams(QueryParameter query, String expresion, boolean removeFromSourceQuery) {
return query.getWhereParameter(expresion, removeFromSourceQuery);
@@ -467,11 +521,16 @@ public static void addWhereFilterLatLon(QueryParameter query, double latitudeMin
public static void addPathWhere(QueryParameter newQuery, String selectedAbsolutePath, int dirQueryID) {
if ((selectedAbsolutePath != null) && (selectedAbsolutePath.length() > 0)) {
- if (QUERY_TYPE_GROUP_DATE == dirQueryID) {
- addWhereDatePath(newQuery, selectedAbsolutePath);
- } else {
- // selectedAbsolutePath is assumed to be a file path i.e. /mnt/sdcard/pictures/
- addWhereDirectoryPath(newQuery, selectedAbsolutePath);
+ switch (dirQueryID) {
+ case QUERY_TYPE_GROUP_DATE:
+ addWhereDatePath(newQuery, selectedAbsolutePath);
+ break;
+ case QUERY_TYPE_GROUP_DATE_MODIFIED:
+ addWhereDateModifiedPath(newQuery, selectedAbsolutePath);
+ break;
+ default:
+ // selectedAbsolutePath is assumed to be a file path i.e. /mnt/sdcard/pictures/
+ addWhereDirectoryPath(newQuery, selectedAbsolutePath);
}
}
}
@@ -497,6 +556,17 @@ private static void addWhereDirectoryPath(QueryParameter newQuery, String select
* path has format /year/month/day/ or /year/month/ or /year/ or /
*/
private static void addWhereDatePath(QueryParameter newQuery, String selectedAbsolutePath) {
+ addWhereDatePath(newQuery, selectedAbsolutePath, SQL_COL_DATE_TAKEN, FILTER_EXPR_DATE_MIN, FILTER_EXPR_DATE_MAX);
+ }
+
+ /**
+ * path has format /year/month/day/ or /year/month/ or /year/ or /
+ */
+ private static void addWhereDateModifiedPath(QueryParameter newQuery, String selectedAbsolutePath) {
+ addWhereDatePath(newQuery, selectedAbsolutePath, SQL_COL_LAST_MODIFIED, FILTER_EXPR_DATE_MODIFIED_MIN, FILTER_EXPR_DATE_MODIFIED_MAX);
+ }
+
+ private static void addWhereDatePath(QueryParameter newQuery, String selectedAbsolutePath, String sqlColDate, String filterExprDateMin, String filterExprDateMax) {
Date from = new Date();
Date to = new Date();
@@ -504,13 +574,13 @@ private static void addWhereDatePath(QueryParameter newQuery, String selectedAbs
if (to.getTime() == 0) {
newQuery
- .addWhere(SQL_COL_DATE_TAKEN + " in (0,-1, null)")
- .addOrderBy(SQL_COL_DATE_TAKEN + " desc");
+ .addWhere(sqlColDate + " in (0,-1, null)")
+ .addOrderBy(sqlColDate + " desc");
} else {
newQuery
- .addWhere(FILTER_EXPR_DATE_MIN, "" + from.getTime())
- .addWhere(FILTER_EXPR_DATE_MAX, "" + to.getTime())
- .addOrderBy(SQL_COL_DATE_TAKEN + " desc");
+ .addWhere(filterExprDateMin, "" + from.getTime())
+ .addWhere(filterExprDateMax, "" + to.getTime())
+ .addOrderBy(sqlColDate + " desc");
}
}
@@ -522,6 +592,8 @@ public static QueryParameter getQuery(int queryID) {
return queryDetail;
case QUERY_TYPE_GROUP_DATE:
return queryGroupByDate;
+ case QUERY_TYPE_GROUP_DATE_MODIFIED:
+ return queryGroupByDateModified;
case QUERY_TYPE_GROUP_ALBUM:
return queryGroupByDir;
case QUERY_TYPE_GROUP_PLACE:
@@ -569,6 +641,8 @@ public static String getName(Context context, int id) {
return context.getString(R.string.gallery_title);
case QUERY_TYPE_GROUP_DATE:
return context.getString(R.string.sort_by_date);
+ case QUERY_TYPE_GROUP_DATE_MODIFIED:
+ return context.getString(R.string.sort_by_modification);
case QUERY_TYPE_GROUP_ALBUM:
return context.getString(R.string.sort_by_folder);
@@ -624,14 +698,22 @@ public static boolean set(GalleryFilterParameter dest, String selectedAbsolutePa
case FotoSql.QUERY_TYPE_GROUP_ALBUM:
dest.setPath(selectedAbsolutePath + "/%");
return true;
- case FotoSql.QUERY_TYPE_GROUP_DATE:
+ case FotoSql.QUERY_TYPE_GROUP_DATE: {
+ Date from = new Date();
+ Date to = new Date();
+
+ DirectoryFormatter.getDates(selectedAbsolutePath, from, to);
+ dest.setDate(from.getTime(), to.getTime());
+ return true;
+ }
+ case FotoSql.QUERY_TYPE_GROUP_DATE_MODIFIED: {
Date from = new Date();
Date to = new Date();
DirectoryFormatter.getDates(selectedAbsolutePath, from, to);
- dest.setDateMin(from.getTime());
- dest.setDateMax(to.getTime());
+ dest.setDateModified(from.getTime(), to.getTime());
return true;
+ }
case FotoSql.QUERY_TYPE_GROUP_PLACE_MAP:
case FotoSql.QUERY_TYPE_GROUP_PLACE:
IGeoRectangle geo = DirectoryFormatter.parseLatLon(selectedAbsolutePath);
@@ -1150,7 +1232,7 @@ public static Long getId(Uri uriWithId) {
public static void addDateAdded(ContentValues values) {
long now = new Date().getTime();
- values.put(SQL_COL_DATE_ADDED, now / 1000);//sec
+ values.put(SQL_COL_DATE_ADDED, now / LAST_MODIFIED_FACTOR);//sec
}
@NonNull
diff --git a/app/src/main/java/de/k3b/android/util/MediaScanner.java b/app/src/main/java/de/k3b/android/util/MediaScanner.java
index 06f19bb3..1ea4c3fc 100644
--- a/app/src/main/java/de/k3b/android/util/MediaScanner.java
+++ b/app/src/main/java/de/k3b/android/util/MediaScanner.java
@@ -75,9 +75,6 @@ abstract public class MediaScanner {
protected static final String DB_LATITUDE = MediaStore.Images.Media.LATITUDE;
*/
- // the DB_XXXX fields are updated directly by the scanner
- // private fields are updated by base scanner
- private static final String DB_DATE_MODIFIED = MediaStore.MediaColumns.DATE_MODIFIED;
private static final String DB_SIZE = MediaStore.MediaColumns.SIZE;
private static final String DB_WIDTH = MediaStore.MediaColumns.WIDTH;
private static final String DB_HEIGHT = MediaStore.MediaColumns.HEIGHT;
@@ -342,7 +339,7 @@ protected MediaContentValues getExifFromFile(ContentValues values, File jpgFile)
MediaXmpSegment xmpContent = MediaXmpSegment.loadXmpSidecarContentOrNull(absoluteJpgPath, "getExifFromFile");
final long xmpFilelastModified = getXmpFilelastModified(xmpContent);
- values.put(DB_DATE_MODIFIED, jpgFile.lastModified() / 1000);
+ values.put(FotoSql.SQL_COL_LAST_MODIFIED, jpgFile.lastModified() / 1000);
values.put(DB_SIZE, jpgFile.length());
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) && mWidth > 0 && mHeight > 0) {
@@ -448,7 +445,7 @@ private static void setPathRelatedFieldsIfNeccessary(ContentValues values, Strin
public static String setFileFields(ContentValues values, File file) {
String newAbsolutePath = FileUtils.tryGetCanonicalPath(file, file.getAbsolutePath());
setPathRelatedFieldsIfNeccessary(values, newAbsolutePath, null);
- values.put(DB_DATE_MODIFIED, file.lastModified() / 1000);
+ values.put(FotoSql.SQL_COL_LAST_MODIFIED, file.lastModified() / 1000);
values.put(DB_SIZE, file.length());
return newAbsolutePath;
}
diff --git a/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java b/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java
index d3e387a7..2e54f7c3 100644
--- a/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java
+++ b/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java
@@ -130,6 +130,8 @@ protected class GalleryQueryParameter {
private static final int SUB_FILTER_MODE_ALBUM = 4;
private static final int SUB_FILTER_MODE_DATE = 5;
+ private static final int SUB_FILTER_MODE_DATE_MODIFIED = 6;
+
/**
* mCurrentSubFilterMode = SUB_FILTER_MODE_XXX: which filter addon is currently active:
* Filter = basefilter + mCurrentSubFilterMode
@@ -253,6 +255,9 @@ private QueryParameter calculateEffectiveGalleryContentQuery(QueryParameter root
case SUB_FILTER_MODE_DATE:
FotoSql.addWhereDateMinMax(result, currentSubFilterSettings.getDateMin(), currentSubFilterSettings.getDateMax());
break;
+ case SUB_FILTER_MODE_DATE_MODIFIED:
+ FotoSql.addWhereDateModifiedMinMax(result, currentSubFilterSettings.getDateModifiedMin(), currentSubFilterSettings.getDateModifiedMax());
+ break;
}
}
@@ -522,8 +527,11 @@ protected class FolderApi {
// either folder picker or date picker
private static final int QUERY_TYPE_GROUP_DATE = FotoSql.QUERY_TYPE_GROUP_DATE;
+ private static final int QUERY_TYPE_GROUP_DATE_MODIFIED = FotoSql.QUERY_TYPE_GROUP_DATE_MODIFIED;
+
private IDirectory mDirectoryRoot = null;
private IDirectory mDateRoot = null;
+ private IDirectory mDateModifiedRoot = null;
/**
* true if activity should show navigator dialog after loading mDirectoryRoot is complete
@@ -539,6 +547,10 @@ private void openDatePicker() {
openPicker(BaseQueryActivity.GalleryQueryParameter.SUB_FILTER_MODE_DATE, QUERY_TYPE_GROUP_DATE);
}
+ private void openDateModifiedPicker() {
+ openPicker(GalleryQueryParameter.SUB_FILTER_MODE_DATE_MODIFIED, QUERY_TYPE_GROUP_DATE_MODIFIED);
+ }
+
private void openFolderPicker() {
openPicker(BaseQueryActivity.GalleryQueryParameter.SUB_FILTER_MODE_PATH, QUERY_TYPE_GROUP_ALBUM);
}
@@ -555,8 +567,8 @@ private void openPicker(final int filterMode, int _dirQueryID) {
mGalleryQueryParameter.mDirQueryID = dirQueryID;
- final boolean loadDate = (dirQueryID == QUERY_TYPE_GROUP_DATE);
- final IDirectory currentDirectoryRoot = loadDate ? this.mDateRoot : this.mDirectoryRoot;
+ boolean loadDate = (dirQueryID == QUERY_TYPE_GROUP_DATE) || (dirQueryID == QUERY_TYPE_GROUP_DATE_MODIFIED);
+ final IDirectory currentDirectoryRoot = getiDirectoryRoot(dirQueryID);
if (currentDirectoryRoot == null) {
// not loaded yet. load directoryRoot in background
;
@@ -567,28 +579,31 @@ private void openPicker(final int filterMode, int _dirQueryID) {
mergedBaseQuery.setID(dirQueryID);
DirectoryLoaderTask loader = new DirectoryLoaderTask(context, loadDate ? LibGlobal.datePickerUseDecade : false,
- mDebugPrefix + " from openPicker(loadDate=" +
- loadDate + ")") {
+ mDebugPrefix + " from openPicker(dirQueryID=" +
+ FotoSql.getName(getApplicationContext(), dirQueryID) + ")") {
@Override
protected void onPostExecute(IDirectory directoryRoot) {
- onDirectoryDataLoadComplete(loadDate, directoryRoot);
+ onDirectoryDataLoadComplete(dirQueryID, directoryRoot);
}
};
-
- if (!loadDate) {
- // limit valbums to matching parent-path query
- QueryParameter vAlbumQueryWithPathExpr = FotoSql.copyPathExpressions(FotoSql.queryVAlbum, mergedBaseQuery);
- if (vAlbumQueryWithPathExpr == null)
- vAlbumQueryWithPathExpr = FotoSql.queryVAlbum;
-
- // load dir-s + "*.album"
- loader.execute(mergedBaseQuery, vAlbumQueryWithPathExpr);
- } else {
- loader.execute(mergedBaseQuery);
+ switch (dirQueryID) {
+ case QUERY_TYPE_GROUP_DATE:
+ case QUERY_TYPE_GROUP_DATE_MODIFIED:
+ loader.execute(mergedBaseQuery);
+ break;
+ default:
+ // limit valbums to matching parent-path query
+ QueryParameter vAlbumQueryWithPathExpr = FotoSql.copyPathExpressions(FotoSql.queryVAlbum, mergedBaseQuery);
+ if (vAlbumQueryWithPathExpr == null)
+ vAlbumQueryWithPathExpr = FotoSql.queryVAlbum;
+
+ // load dir-s + "*.album"
+ loader.execute(mergedBaseQuery, vAlbumQueryWithPathExpr);
}
+
} else {
Log.e(Global.LOG_CONTEXT, mDebugPrefix + " this.mDirQueryID undefined "
- + mGalleryQueryParameter.mDirQueryID);
+ + FotoSql.getName(getApplicationContext(), mGalleryQueryParameter.mDirQueryID));
}
// if not loaded yet
} else {
@@ -620,18 +635,35 @@ protected void onPostExecute(IDirectory directoryRoot) {
}
}
- private void onDirectoryDataLoadComplete(final boolean loadDate, IDirectory directoryRoot) {
+ private IDirectory getiDirectoryRoot(int dirQueryID) {
+ switch (dirQueryID) {
+ case QUERY_TYPE_GROUP_DATE:
+ return this.mDateRoot;
+ case QUERY_TYPE_GROUP_DATE_MODIFIED:
+ return this.mDateModifiedRoot;
+ default:
+ return this.mDirectoryRoot;
+ }
+ }
+
+ private void onDirectoryDataLoadComplete(int dirQueryID, IDirectory directoryRoot) {
if (directoryRoot == null) {
final String message = getString(R.string.folder_err_load_failed_format, FotoSql.getName(BaseQueryActivity.this, mGalleryQueryParameter.getDirQueryID()));
Toast.makeText(BaseQueryActivity.this, message, Toast.LENGTH_LONG).show();
} else {
boolean mustDefineNavigation;
- if (loadDate) {
- mustDefineNavigation= (mGalleryQueryParameter.getCurrentSubFilterSettings().getDatePath() != null);
- this.mDateRoot = directoryRoot;
- } else {
- mustDefineNavigation= (mGalleryQueryParameter.getCurrentSubFilterSettings().getPath() != null);
- this.mDirectoryRoot = directoryRoot;
+ switch (dirQueryID) {
+ case QUERY_TYPE_GROUP_DATE:
+ mustDefineNavigation= (mGalleryQueryParameter.getCurrentSubFilterSettings().getDatePath() != null);
+ this.mDateRoot = directoryRoot;
+ break;
+ case QUERY_TYPE_GROUP_DATE_MODIFIED:
+ mustDefineNavigation = (mGalleryQueryParameter.getCurrentSubFilterSettings().getDateModifiedPath() != null);
+ this.mDateModifiedRoot = directoryRoot;
+ break;
+ default:
+ mustDefineNavigation = (mGalleryQueryParameter.getCurrentSubFilterSettings().getPath() != null);
+ this.mDirectoryRoot = directoryRoot;
}
final boolean mustShowFolderPicker = (directoryRoot != null) && (this.mMustShowNavigator);
@@ -642,8 +674,8 @@ private void onDirectoryDataLoadComplete(final boolean loadDate, IDirectory dire
Log.i(Global.LOG_CONTEXT, mDebugPrefix + "onDirectoryDataLoadComplete(" +
"mustDefineNavigation=" + mustDefineNavigation +
", mustShowFolderPicker=" + mustShowFolderPicker +
- ", content=" + name + ",loadDate=" +
- loadDate + ")");
+ ", content=" + name + ",dirQueryID=" +
+ FotoSql.getName(getApplicationContext(), dirQueryID) + ")");
}
if (mustDefineNavigation) {
@@ -652,10 +684,15 @@ private void onDirectoryDataLoadComplete(final boolean loadDate, IDirectory dire
Global.debugMemory(mDebugPrefix, "onDirectoryDataLoadComplete");
if (mustShowFolderPicker) {
- if (loadDate) {
- openDatePicker();
- } else {
- openFolderPicker();
+ switch (dirQueryID) {
+ case QUERY_TYPE_GROUP_DATE:
+ openDatePicker();
+ break;
+ case QUERY_TYPE_GROUP_DATE_MODIFIED:
+ openDateModifiedPicker();
+ break;
+ default:
+ openFolderPicker();
}
}
}
@@ -669,6 +706,7 @@ private void refreshSelection() {
private void invalidateDirectories(String why) {
mDirectoryRoot = invalidateDirectories(why, mDirectoryRoot);
mDateRoot = invalidateDirectories(why, mDateRoot);
+ mDateModifiedRoot = invalidateDirectories(why, mDateModifiedRoot);
}
private IDirectory invalidateDirectories(String why, IDirectory directoryRoot) {
@@ -841,6 +879,20 @@ private void navigateTo(String selectedAbsolutePath, int queryTypeId) {
this.mGalleryQueryParameter.mDirQueryID = queryTypeId;
setTitle();
+ reloadGui(why);
+ } else if (mGalleryQueryParameter.mCurrentSubFilterMode == GalleryQueryParameter.SUB_FILTER_MODE_DATE_MODIFIED) {
+ final String why = "FotoGalleryActivity.navigateTo date modified";
+ Log.d(Global.LOG_CONTEXT, why + selectedAbsolutePath + " from " + currentSubFilterSettings.getDateModifiedPath());
+
+ Date from = new Date();
+ Date to = new Date();
+ DirectoryFormatter.getDates(selectedAbsolutePath, from, to);
+
+ currentSubFilterSettings.setDateModified(from.getTime(), to.getTime());
+ this.mGalleryQueryParameter.mCurrentSubFilterMode = GalleryQueryParameter.SUB_FILTER_MODE_DATE_MODIFIED;
+ this.mGalleryQueryParameter.mDirQueryID = queryTypeId;
+ setTitle();
+
reloadGui(why);
} else if (mGalleryQueryParameter.mCurrentSubFilterMode == GalleryQueryParameter.SUB_FILTER_MODE_PATH) {
GalleryFilterPathState state = new GalleryFilterPathState()
@@ -966,11 +1018,17 @@ public boolean onPrepareOptionsMenu(Menu menu) {
protected boolean onOptionsItemSelected(MenuItem item, SelectedItems selectedItems) {
// Handle presses on the action bar items
switch (item.getItemId()) {
+ case R.id.cmd_date:
case R.id.cmd_select_date:
getFolderApi().openDatePicker();
return true;
+ case R.id.cmd_date_modified:
+ getFolderApi().openDateModifiedPicker();
+ return true;
+
case R.id.cmd_select_folder:
+ case R.id.cmd_path:
getFolderApi().openFolderPicker();
return true;
diff --git a/app/src/main/res/layout/activity_gallery_filter.xml b/app/src/main/res/layout/activity_gallery_filter.xml
index ed028b10..58dda9cf 100644
--- a/app/src/main/res/layout/activity_gallery_filter.xml
+++ b/app/src/main/res/layout/activity_gallery_filter.xml
@@ -1,7 +1,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Structure:
+ lbl_any + edit_any + cmd_any_history + cmd_any
-
+ edit_date_from
+ edit_date_to
-
-
-
-
-
+ chk_with_no_tags
+ edit_tags_include
+ edit_tags_exclude
-
-
-
-
-
-
+ lbl_geo_end_invisible
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
- android:layout_alignBottom="@+id/cmd_select_lat_lon"
- android:layout_toLeftOf="@+id/cmd_select_lat_lon"
- android:layout_toStartOf="@+id/cmd_select_lat_lon" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/test/java/de/k3b/android/androFotoFinder/tagDB/TagSqlQueryParserTests.java b/app/src/test/java/de/k3b/android/androFotoFinder/tagDB/TagSqlQueryParserTests.java
index 6d0988d9..9d831a34 100644
--- a/app/src/test/java/de/k3b/android/androFotoFinder/tagDB/TagSqlQueryParserTests.java
+++ b/app/src/test/java/de/k3b/android/androFotoFinder/tagDB/TagSqlQueryParserTests.java
@@ -36,7 +36,7 @@
public class TagSqlQueryParserTests {
@Test
public void shouldParseFull() throws Exception {
- String FILTER_STRING = "1.23,2.34;3.45,4.56;2001-02-03,2005-12-31;/some/path/;q,^;%filter%;tag1,tag2,tag3;utag1,utag2,utag3;notags;3;4";
+ String FILTER_STRING = "1.23,2.34;3.45,4.56;2001-02-03,2005-12-31;/some/path/;q,^;%filter%;tag1,tag2,tag3;utag1,utag2,utag3;notags;3;4;2004-02-03,2009-12-31";
assertFilterQueryFilter(FILTER_STRING);
}
@@ -98,6 +98,7 @@ private QueryParameter assertFilterQueryFilter(String expectedFilterString, Stri
public void assertGFilterQueryGFilter() {
assertGFilterQueryGFilter("InAnyField", createPublicGalleryFilterParameter().setInAnyField("%1% %2%"));
assertGFilterQueryGFilter("Date", createPublicGalleryFilterParameter().setDate("1997-12-24","2005-11-30"));
+ assertGFilterQueryGFilter("Date Modified", createPublicGalleryFilterParameter().setDateModified("1999-12-24","2009-11-30"));
assertGFilterQueryGFilter("Path", createPublicGalleryFilterParameter().setPath("%1%"));
GalleryFilterParameter gfLL = createPublicGalleryFilterParameter();
gfLL.setLatitude("12.34", "34.56").setLogitude("45.67", "56.78");
diff --git a/fastlane/metadata/android/en-US/changelogs/41.txt b/fastlane/metadata/android/en-US/changelogs/41.txt
index 88af999e..f4d9fe79 100644
--- a/fastlane/metadata/android/en-US/changelogs/41.txt
+++ b/fastlane/metadata/android/en-US/changelogs/41.txt
@@ -1,2 +1,4 @@
Changes from 0.7.2 to 0.7.3
+* #132 improved Autoprocessing-Editor: Long press on Exif-Picker butten "..." : get lat/lon/description/tags from selected photos
+* #133: Additional filtercriteria date-last-modified from ... to
diff --git a/fotolib2/src/main/java/de/k3b/io/GalleryFilterParameter.java b/fotolib2/src/main/java/de/k3b/io/GalleryFilterParameter.java
index 896bd2e7..1c08cf84 100644
--- a/fotolib2/src/main/java/de/k3b/io/GalleryFilterParameter.java
+++ b/fotolib2/src/main/java/de/k3b/io/GalleryFilterParameter.java
@@ -48,6 +48,9 @@ public class GalleryFilterParameter extends GeoRectangle implements IGalleryFilt
private long dateMin = 0;
private long dateMax = 0;
+ private long dateModifiedMin = 0;
+ private long dateModifiedMax = 0;
+
private boolean withNoTags = false;
/** one of the VISIBILITY_.XXXX values */
@@ -60,8 +63,8 @@ public class GalleryFilterParameter extends GeoRectangle implements IGalleryFilt
public GalleryFilterParameter get(IGalleryFilter src) {
super.get(src);
if (src != null) {
- this.setDateMax(src.getDateMax());
- this.setDateMin(src.getDateMin());
+ this.setDate(src.getDateMin(), src.getDateMax());
+ this.setDateModified(src.getDateModifiedMin(), src.getDateModifiedMax());
this.setPath(src.getPath());
this.setWithNoTags(src.isWithNoTags());
this.setVisibility(src.getVisibility());
@@ -116,6 +119,32 @@ public GalleryFilterParameter setDate(long min, long max) {
return setDateMin(min).setDateMax(max);
}
+ @Override
+ public long getDateModifiedMin() {
+ return dateModifiedMin;
+ }
+
+ public GalleryFilterParameter setDateModifiedMin(long dateModifiedMin) {
+ this.dateModifiedMin = dateModifiedMin;return this;
+ }
+
+ @Override
+ public long getDateModifiedMax() {
+ return dateModifiedMax;
+ }
+
+ public GalleryFilterParameter setDateModifiedMax(long dateModifiedMax) {
+ this.dateModifiedMax = dateModifiedMax; return this;
+ }
+
+ public GalleryFilterParameter setDateModified(String min, String max) {
+ return setDateModified(parseDate(min), parseDate(max));
+ }
+
+ public GalleryFilterParameter setDateModified(long min, long max) {
+ return setDateModifiedMin(min).setDateModifiedMax(max);
+
+ }
@Override
public boolean isWithNoTags() {
return withNoTags;
@@ -232,6 +261,7 @@ protected StringBuilder toStringBuilder() {
appendSubFields(result, (getVisibility() != VISIBILITY.DEFAULT) ? (""+getVisibility().value):"");
appendSubFields(result, (getRatingMin() > 0) ? (""+getRatingMin()) : "");
+ appendSubFields(result, format(getDateModifiedMin()), format(getDateModifiedMax()));
return result;
}
@@ -323,6 +353,12 @@ private void assign(int field, int subfield, String value) {
case 10 :
setRatingMin(parseRating(value));
break;
+ case 11 :
+ if (subfield == 0)
+ setDateModifiedMin(parseDate(value));
+ else
+ setDateModifiedMax(parseDate(value));
+ break;
default:break;
}
}
@@ -356,6 +392,8 @@ public static boolean isEmpty(IGalleryFilter filter) {
return (GeoRectangle.isEmpty(filter)
&& (filter.getDateMin() == 0)
&& (filter.getDateMax() == 0)
+ && (filter.getDateModifiedMin() == 0)
+ && (filter.getDateModifiedMax() == 0)
&& (!filter.isNonGeoOnly())
&& (!filter.isWithNoTags())
&& (filter.getRatingMin() <= 0)
@@ -401,4 +439,8 @@ public int getRatingMin() {
public String getDatePath() {
return DirectoryFormatter.getDatePath(LibGlobal.datePickerUseDecade, getDateMin(), getDateMax());
}
+ /** get Date Min/Max in date picker compatible format */
+ public String getDateModifiedPath() {
+ return DirectoryFormatter.getDatePath(LibGlobal.datePickerUseDecade, getDateModifiedMin(), getDateModifiedMax());
+ }
}
diff --git a/fotolib2/src/main/java/de/k3b/io/IGalleryFilter.java b/fotolib2/src/main/java/de/k3b/io/IGalleryFilter.java
index 6f27d8fb..1cbe6369 100644
--- a/fotolib2/src/main/java/de/k3b/io/IGalleryFilter.java
+++ b/fotolib2/src/main/java/de/k3b/io/IGalleryFilter.java
@@ -38,6 +38,10 @@ public interface IGalleryFilter extends IGeoRectangle {
long getDateMax();
+ long getDateModifiedMin();
+
+ long getDateModifiedMax();
+
/** number defining current sorting */
int getSortID();
diff --git a/fotolib2/src/test/java/de/k3b/io/GalleryFilterParameterTest.java b/fotolib2/src/test/java/de/k3b/io/GalleryFilterParameterTest.java
index 3cec7b05..a997cccc 100644
--- a/fotolib2/src/test/java/de/k3b/io/GalleryFilterParameterTest.java
+++ b/fotolib2/src/test/java/de/k3b/io/GalleryFilterParameterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2017 by k3b.
+ * Copyright (c) 2015-2018 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -30,13 +30,13 @@
*/
public class GalleryFilterParameterTest {
- public static final String FILTER_STRING_FULL_EXAMPLE = "1.23,2.34;3.45,4.56;2001-02-03,2005-12-31;/some/path/;q,^;filter;tag1,tag2,tag3;utag1,utag2,utag3;notags;3;4";
+ public static final String FILTER_STRING_FULL_EXAMPLE = "1.23,2.34;3.45,4.56;2001-02-03,2005-12-31;/some/path/;q,^;filter;tag1,tag2,tag3;utag1,utag2,utag3;notags;3;4;2004-02-03,2007-12-31";
@Test
public void toStringFullTest() {
GalleryFilterParameter sut = new GalleryFilterParameter();
sut.setLatitude(1.23,3.45).setLogitude(2.34, 4.56);
- sut.setDateMin(Date.valueOf("2001-02-03").getTime()).setDateMax(Date.valueOf("2005-12-31").getTime());
+ sut.setDate(Date.valueOf("2001-02-03").getTime(), Date.valueOf("2005-12-31").getTime());
sut.setPath("/some/path/");
sut.setSortID('q');
sut.setSortAscending(true);
@@ -46,6 +46,7 @@ public void toStringFullTest() {
sut.setVisibility(VISIBILITY.PRIVATE_PUBLIC);
sut.setWithNoTags(true);
sut.setRatingMin(4);
+ sut.setDateModified(Date.valueOf("2004-02-03").getTime(), Date.valueOf("2007-12-31").getTime());
assertEquals(FILTER_STRING_FULL_EXAMPLE, sut.toString());
assertEquals("not empty", false, GalleryFilterParameter.isEmpty(sut));
From b6b3e4407db95f0e0614356b64fddb213ed945bb Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Tue, 13 Nov 2018 23:58:10 +0100
Subject: [PATCH 05/35] #108: Zip-file export/backup
---
app/src/main/AndroidManifest.xml | 21 +++++-
.../res/layout/activity_gallery_filter.xml | 72 ++++++++++---------
app/src/main/res/values/strings.xml | 9 +++
3 files changed, 67 insertions(+), 35 deletions(-)
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index c2e771c1..aefdd560 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -236,11 +236,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ android:label="@string/backup_title">
@@ -253,7 +268,7 @@
-
+
diff --git a/app/src/main/res/layout/activity_gallery_filter.xml b/app/src/main/res/layout/activity_gallery_filter.xml
index 58dda9cf..5caead85 100644
--- a/app/src/main/res/layout/activity_gallery_filter.xml
+++ b/app/src/main/res/layout/activity_gallery_filter.xml
@@ -95,9 +95,10 @@
android:layout_alignBaseline="@+id/lbl_any"
android:layout_alignBottom="@+id/cmd_any"
android:layout_alignTop="@+id/cmd_any"
- android:layout_toEndOf="@+id/lbl_any"
android:layout_toLeftOf="@+id/cmd_any_history"
+ android:layout_toStartOf="@+id/cmd_any_history"
android:layout_toRightOf="@+id/lbl_any"
+ android:layout_toEndOf="@+id/lbl_any"
android:ellipsize="end"
android:inputType="text"
android:lines="1"
@@ -114,8 +115,8 @@
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/edit_any"
- android:layout_toEndOf="@+id/cmd_any_history"
android:layout_toRightOf="@+id/cmd_any_history"
+ android:layout_toEndOf="@+id/cmd_any_history"
android:text="@string/btn_popup" />
@@ -227,8 +229,9 @@
android:layout_height="wrap_content"
android:layout_below="@+id/cmd_date"
android:layout_toLeftOf="@+id/cmd_date_from_history"
- android:layout_toRightOf="@+id/lbl_date"
android:layout_toStartOf="@+id/cmd_date_from_history"
+ android:layout_toRightOf="@+id/lbl_date"
+ android:layout_toEndOf="@+id/lbl_date"
android:ems="10"
android:inputType="date" />
@@ -248,6 +251,7 @@
android:layout_height="wrap_content"
android:layout_below="@+id/edit_date_to"
android:layout_toRightOf="@+id/chk_public"
+ android:layout_toEndOf="@+id/chk_public"
android:text="@string/lbl_images_private" />
@@ -266,11 +270,11 @@
android:id="@+id/cmd_tags_include"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_below="@+id/chk_with_no_tags"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
- android:layout_below="@+id/chk_with_no_tags"
- android:layout_toEndOf="@+id/cmd_any_history"
android:layout_toRightOf="@+id/cmd_any_history"
+ android:layout_toEndOf="@+id/cmd_any_history"
android:text="@string/btn_popup" />
@@ -344,10 +348,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/cmd_tags_exclude"
- android:layout_toEndOf="@+id/edit_any"
android:layout_toLeftOf="@+id/cmd_any"
- android:layout_toRightOf="@+id/edit_any"
android:layout_toStartOf="@+id/cmd_any"
+ android:layout_toRightOf="@+id/edit_any"
+ android:layout_toEndOf="@+id/edit_any"
android:background="@android:drawable/ic_menu_more" />
@@ -458,19 +464,19 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/cmd_select_lat_lon"
- android:layout_toEndOf="@+id/edit_any"
android:layout_toLeftOf="@+id/cmd_any"
- android:layout_toRightOf="@+id/edit_any"
android:layout_toStartOf="@+id/cmd_any"
+ android:layout_toRightOf="@+id/edit_any"
+ android:layout_toEndOf="@+id/edit_any"
android:background="@android:drawable/ic_menu_more" />
@@ -531,6 +538,7 @@
android:layout_alignStart="@+id/edit_longitude_from"
android:layout_below="@+id/edit_longitude_from"
android:layout_toLeftOf="@+id/cmd_lon_from_history"
+ android:layout_toStartOf="@+id/cmd_lon_from_history"
android:ems="10"
android:inputType="numberDecimal|numberSigned" />
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 045453af..9da73db9 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -262,5 +262,14 @@ You can undo hiding by calling the mediascanner from gallery-menu."
-->
Bookmark folder
+
+
+ Backup
+
+ Output Zip
+ Folder
+ File
+ Generate Zip-Subfolders below
+
From d9a07e05dae01f54a052231db8466b1f729918a7 Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Wed, 14 Nov 2018 16:13:31 +0100
Subject: [PATCH 06/35] #108: Zip-file export/backup initial layout
---
.../androFotoFinder/BackupActivity.java | 760 ++++++++++++++++++
app/src/main/res/layout/activity_backup.xml | 336 ++++++++
app/src/main/res/values/donottranslate.xml | 5 +-
app/src/main/res/values/strings.xml | 12 +-
4 files changed, 1109 insertions(+), 4 deletions(-)
create mode 100644 app/src/main/java/de/k3b/android/androFotoFinder/BackupActivity.java
create mode 100644 app/src/main/res/layout/activity_backup.xml
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/BackupActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/BackupActivity.java
new file mode 100644
index 00000000..92544d64
--- /dev/null
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/BackupActivity.java
@@ -0,0 +1,760 @@
+/*
+ * Copyright (c) 2018 by k3b.
+ *
+ * This file is part of AndroFotoFinder / #APhotoManager.
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see
+ */
+
+package de.k3b.android.androFotoFinder;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.net.Uri;
+import android.os.Bundle;
+import android.preference.PreferenceManager;
+import android.support.annotation.NonNull;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.PopupMenu;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Serializable;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import de.k3b.android.androFotoFinder.queries.FotoSql;
+import de.k3b.android.util.ClipboardUtil;
+import de.k3b.android.util.IntentUtil;
+import de.k3b.android.widget.AboutDialogPreference;
+import de.k3b.android.widget.ActivityWithAutoCloseDialogs;
+import de.k3b.io.ListUtils;
+import de.k3b.io.PhotoAutoprocessingDto;
+import de.k3b.io.collections.SelectedFiles;
+import de.k3b.io.DateUtil;
+import de.k3b.io.RuleFileNameProcessor;
+import de.k3b.io.StringUtils;
+import de.k3b.media.IMetaApi;
+import de.k3b.media.MediaAsString;
+import de.k3b.media.MediaDTO;
+import de.k3b.media.MediaUtil;
+
+/**
+ * #93: Editor for a WorkflowItem ".apm" files that define
+ * rules to process one or more photos
+ * * filename schemata for copied/moved files
+ * * default properties that every photot should receive.
+ */
+public class BackupActivity extends ActivityWithAutoCloseDialogs implements Common {
+ private static final String mDebugPrefix = "Backup-";
+ private static final String SETTINGS_KEY = "BackupCurrent-";
+ private static final int EXIF_EDIT_RESULT_ID = 86441;
+ private static final String PREF_LAST_RENAME_DATE_PATTERN = "LastRenameDatePattern";
+ private static final String PREF_LAST_RENAME_NUMBER_PATTERN = "LastRenameNumberPattern";
+
+ /**
+ * current modified value of the first selected file
+ */
+ private File mCurrentOutDir = null;
+ private PhotoAutoprocessingDto mCurrentAutoprocessingData;
+ private SelectedFiles mSelectedFiles;
+
+ private RuleFileNameProcessor mProcessor;
+
+ private TextView mPreview;
+ private Spinner mSpinnerDatePattern;
+ private EditText mEditName;
+ private Spinner mSpinnerNumberPattern;
+ private TextView mExifChanges;
+ private File exampleSrcfile;
+ private Date exampleDate;
+
+ public static void showActivity(String debugContext, Activity context, PhotoAutoprocessingDto workflow,
+ String directoryOrApmFileUrl
+ , SelectedFiles selectedFiles, int requestCode) {
+ final Intent intent = new Intent().setClass(context,
+ BackupActivity.class);
+
+ intent.setAction(Intent.ACTION_EDIT);
+
+ if (workflow != null) {
+ intent.putExtra(SETTINGS_KEY, workflow.toSerializable());
+ }
+
+ if (directoryOrApmFileUrl != null) {
+ intent.setData(Uri.parse(directoryOrApmFileUrl));
+ }
+
+ AffUtils.putSelectedFiles(intent, selectedFiles);
+
+ if (Global.debugEnabled) {
+ Log.d(Global.LOG_CONTEXT, mDebugPrefix + context.getClass().getSimpleName()
+ + " > BackupActivity.showActivity " + intent.toUri(Intent.URI_INTENT_SCHEME));
+ }
+
+ IntentUtil.startActivity(debugContext, context, requestCode, intent);
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ Global.debugMemory(mDebugPrefix, "onCreate");
+ super.onCreate(savedInstanceState);
+
+ Intent intent = getIntent();
+ mSelectedFiles = getSelectedFiles("onCreate ", intent, false);
+
+ // Edit dir or edit ".apm"
+ mCurrentOutDir = IntentUtil.getFile(intent.getData());
+ if (mCurrentOutDir != null) {
+ if (mCurrentOutDir.isFile()) mCurrentOutDir = mCurrentOutDir.getParentFile();
+ }
+
+ mCurrentAutoprocessingData = null;
+ if (savedInstanceState != null) {
+ final Serializable settingsAsSerializable = savedInstanceState.getSerializable(SETTINGS_KEY);
+ mCurrentAutoprocessingData = PhotoAutoprocessingDto.load(settingsAsSerializable);
+ }
+ if ((mCurrentAutoprocessingData == null) && (mCurrentOutDir != null)) {
+ try {
+ mCurrentAutoprocessingData = new PhotoAutoprocessingDto();
+ mCurrentAutoprocessingData.load(mCurrentOutDir);
+ } catch (IOException e) {
+ onFatalError(mDebugPrefix + "Cannot load .apm from " + mCurrentAutoprocessingData, e);
+ return;
+ }
+ }
+
+ if (Global.debugEnabled) {
+ final String nl = "\n\t.";
+ Log.d(Global.LOG_CONTEXT, ListUtils.toString(" ", mDebugPrefix,
+ "onCreate",intent.toUri(Intent.URI_INTENT_SCHEME),
+ nl,mCurrentOutDir,
+ nl,"savedInstanceState",savedInstanceState,
+ nl, mCurrentAutoprocessingData));
+ }
+
+ if ((mCurrentOutDir == null) || (mCurrentAutoprocessingData == null)) {
+ onFatalError(mDebugPrefix + "Missing Intent.data parameter. intent="
+ + intent.toUri(Intent.URI_INTENT_SCHEME), null);
+ return;
+ }
+
+ mCurrentAutoprocessingData.setOutDir(mCurrentOutDir);
+ mProcessor = new RuleFileNameProcessor(mCurrentOutDir);
+
+ // if there are no MediaDefaults yet infer them from selected files
+ if (mCurrentAutoprocessingData.getMediaDefaults() == null) {
+ MediaAsString exampleExif = MediaUtil.inferAutoprocessingExifDefaults(new MediaAsString(), mSelectedFiles.getFiles());
+ mCurrentAutoprocessingData.setMediaDefaults(exampleExif);
+ }
+ this.exampleSrcfile = mProcessor.getFile(mSelectedFiles.getFile(0));
+
+ final Date[] datesPhotoTaken = mSelectedFiles.getDatesPhotoTaken();
+
+ this.exampleDate = ((datesPhotoTaken != null) && (datesPhotoTaken.length > 0))
+ ? datesPhotoTaken[0]
+ : getExampleDate(mProcessor.getFile(this.exampleSrcfile));
+
+
+ defineGui();
+ toGui();
+ }
+
+ private void onFatalError(String msg, Exception exception) {
+ Log.e(Global.LOG_CONTEXT, msg, exception);
+ Toast.makeText(this, msg, Toast.LENGTH_LONG).show();
+ setResult(Activity.RESULT_CANCELED, null);
+ finish();
+ }
+
+ /**
+ * simple dto for spinner with pattern and example
+ */
+ private static class Pattern {
+ private final String pattern;
+ private final String value;
+
+ Pattern(String pattern, String value, boolean longString) {
+ this.pattern = pattern;
+ this.value = value + ((longString && (value.length() > 0)) ? (" (" + pattern + ")") : "");
+ }
+
+ @Override
+ public String toString() {
+ return value;
+ }
+ }
+
+ private void fromGui() {
+ mCurrentAutoprocessingData.setName(mEditName.getText().toString());
+ mCurrentAutoprocessingData.setDateFormat(getSelectedPattern(mSpinnerDatePattern));
+ mCurrentAutoprocessingData.setNumberFormat(getSelectedPattern(mSpinnerNumberPattern));
+ }
+
+ /** to avoid endless recursion toGui() ... TextView.setText ... afterTextChanged ... toGui() */
+ private int inToGuiCount = 0;
+
+
+ private void toGui() {
+ String numberFormat = mCurrentAutoprocessingData.getNumberFormat();
+ final String namePart = mCurrentAutoprocessingData.getName();
+ final String dateFormat = mCurrentAutoprocessingData.getDateFormat();
+
+ inToGuiCount++;
+ try {
+ mEditName.setText(namePart);
+ select(mSpinnerDatePattern, dateFormat);
+ select(mSpinnerNumberPattern, numberFormat);
+
+ String exampleResultFileName = createExampleResultFileName(dateFormat, namePart, numberFormat);
+
+ // !!! where to get "copy"/"move" from?
+ String photoOperation = ""; // getString(R.string.move_menu_title);
+
+ // %1$s %2$d Photos\n\t%3$s (%4$s), ...\nTo %5$s\n\t%6$s
+ /*
+ Copy 5 Photos
+ hello.jpg (2017-08-02), ...
+ To .../path/toFile/
+ 1708NewName0001.jpg
+ */
+ mPreview.setText(getString(R.string.preview_message_format,
+ photoOperation,
+ mSelectedFiles.size(),
+ (exampleSrcfile == null) ? null : exampleSrcfile.getName(),
+ DateUtil.toIsoDateString(exampleDate),
+ mCurrentAutoprocessingData.getOutDir(), exampleResultFileName));
+
+ IMetaApi mediaChanges = mCurrentAutoprocessingData.getMediaDefaults();
+ String exifChange = null;
+ if (mediaChanges != null) {
+ exifChange = MediaUtil.toString(mediaChanges, false, mLabelGenerator, MediaUtil.FieldID.clasz);
+ }
+ mExifChanges.setText(exifChange);
+ } finally {
+ inToGuiCount--;
+ }
+ }
+
+ private String createExampleResultFileName(String dateFormat, String baseName, String numberFormat) {
+ mProcessor.set(dateFormat, baseName, numberFormat);
+
+ File file = mProcessor.getNextFile(null, exampleDate, StringUtils.isNullOrEmpty(numberFormat) ? 0 : 1);
+ if(file != null) return file.getName();
+ return null;
+ }
+
+ private void select(Spinner spinner, String selectedValueOrNull) {
+ ArrayAdapter adapter = (ArrayAdapter) spinner.getAdapter();
+ int count = adapter.getCount();
+ String selectedValue = selectedValueOrNull == null ? "" : selectedValueOrNull;
+
+ for (int i = 0; i < count; i++) {
+ Pattern p = adapter.getItem(i);
+ if (StringUtils.compare(p.pattern, selectedValue) == 0) {
+ spinner.setSelection(i);
+ }
+ }
+ }
+
+ private String getSelectedPattern(Spinner spinner) {
+ Pattern sel = (Pattern) spinner.getSelectedItem();
+ return (sel == null) ? null : sel.pattern;
+ }
+
+ @Override
+ public void onSaveInstanceState(Bundle savedInstanceState) {
+ fromGui();
+ savedInstanceState.putSerializable(SETTINGS_KEY, mCurrentAutoprocessingData.toSerializable());
+ if (Global.debugEnabled) {
+ Log.d(Global.LOG_CONTEXT, mDebugPrefix
+ + " onSaveInstanceState " + savedInstanceState);
+ }
+
+ super.onSaveInstanceState(savedInstanceState);
+ }
+
+ /**
+ * load layout and bind layout members
+ */
+ private void defineGui() {
+ setContentView(R.layout.activity_backup);
+
+ mPreview = (TextView) findViewById(R.id.lbl_preview);
+ mSpinnerDatePattern = (Spinner) findViewById(R.id.sp_date_pattern);
+ mSpinnerDatePattern.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, createDatePatterns()));
+ mSpinnerDatePattern.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id) {
+ mCurrentAutoprocessingData.setDateFormat(getSelectedPattern(mSpinnerDatePattern));
+ toGui();
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+
+ }
+ });
+
+ mEditName = (EditText) findViewById(R.id.edit_name);
+ mEditName.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ // to avoid endless recursion toGui() ... TextView.setText ... afterTextChanged ... toGui()
+ if (inToGuiCount == 0) {
+ String newValue = s.toString();
+ if (0 != StringUtils.compare(newValue, mCurrentAutoprocessingData.getName())) {
+ int start = mEditName.getSelectionStart();
+ int end = mEditName.getSelectionEnd();
+ // prevent stackoverflow
+ mCurrentAutoprocessingData.setName(newValue);
+ toGui();
+ mEditName.setSelection(start, end); // prevent cursor from jumping
+ }
+ }
+ }
+ });
+
+ mSpinnerNumberPattern = (Spinner) findViewById(R.id.sp_number_pattern);
+ mSpinnerNumberPattern.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, createNumberPatterns()));
+ mSpinnerNumberPattern.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id) {
+ mCurrentAutoprocessingData.setNumberFormat(getSelectedPattern(mSpinnerNumberPattern));
+ toGui();
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+
+ }
+ });
+ mExifChanges = (TextView) findViewById(R.id.lbl_exif_changes);
+
+ Button cmd = (Button) findViewById(R.id.cmd_pick_exif);
+ cmd.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ onPickExif();
+ }
+ });
+ cmd.setOnLongClickListener(new View.OnLongClickListener() {
+ @Override
+ public boolean onLongClick(View v) {
+ return onReInferExifAndPick();
+ }
+ });
+
+ ((ImageButton) findViewById(R.id.cmd_file_name_pattern_history)).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ onOpenRenamerPopupMenu(v);
+ }
+ });
+
+ }
+
+ private List createDatePatterns() {
+ String[] patternValues = getResources().getStringArray(R.array.date_patterns);
+ ArrayList result = new ArrayList();
+ for (String patternValue : patternValues) {
+ String formattedExample = (!StringUtils.isNullOrEmpty(patternValue))
+ ? new SimpleDateFormat(patternValue).format(this.exampleDate)
+ : "";
+ result.add(new Pattern(patternValue, formattedExample, true));
+ }
+ return result;
+ }
+
+ private Date getExampleDate(File exampleSrcfile) {
+ Date exampleValue = null;
+ if ((mCurrentAutoprocessingData != null) && (mCurrentAutoprocessingData.getMediaDefaults() != null)) {
+ exampleValue = mCurrentAutoprocessingData.getMediaDefaults().getDateTimeTaken();
+ }
+ if (exampleValue == null) {
+ long lastModified = (exampleSrcfile == null) ? 0 : exampleSrcfile.lastModified();
+ exampleValue = (lastModified == 0) ? new Date() : new Date(lastModified);
+ }
+ return exampleValue;
+ }
+
+ private List createNumberPatterns() {
+ long exampleValue = 1;
+
+ /*
+ if ((mCurrentAutoprocessingData != null) && (mCurrentAutoprocessingData.getOutDir() != null)) {
+ exampleValue = mCurrentAutoprocessingData.getMediaDefaults().getDateTimeTaken();
+ }
+ if (exampleValue == null) exampleValue = new Date();
+ */
+
+ String[] patternValues = getResources().getStringArray(R.array.number_patterns);
+ ArrayList result = new ArrayList();
+ for (String patternValue : patternValues) {
+ String formattedExample = (!StringUtils.isNullOrEmpty(patternValue))
+ ? new DecimalFormat(patternValue).format(exampleValue)
+ : "";
+ result.add(new Pattern(patternValue, formattedExample, false));
+ }
+ return result;
+ }
+
+ private void onOpenRenamerPopupMenu(View anchor) {
+ PopupMenu popup = createRenamerPopupMenu(anchor);
+ popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
+ @Override
+ public boolean onMenuItemClick(MenuItem item) {
+ return onRenamerPopupMenuClick(item);
+ }
+ });
+
+ if (popup != null) {
+ popup.show();
+ }
+ }
+
+ private PopupMenu createRenamerPopupMenu(View anchor) {
+ PopupMenu popup = new PopupMenu(this, anchor);
+ MenuInflater inflater = popup.getMenuInflater();
+ inflater.inflate(R.menu.menu_renamer_context, popup.getMenu());
+
+ String name = this.mProcessor.getDirBaseName();
+ setMenuItem(popup, R.id.cmd_dir, name);
+ name = getParentDirBaseName();
+ setMenuItem(popup, R.id.cmd_subdir_dir, name);
+ return popup;
+ }
+
+ private String getParentDirBaseName() {
+ return this.mProcessor.getParentDirBaseName() + "-" + this.mProcessor.getDirBaseName();
+ }
+
+ private void setMenuItem(PopupMenu popup, int menuId, String dirBaseName) {
+ MenuItem menuitem = popup.getMenu().findItem(menuId);
+ if ((dirBaseName != null) && (menuitem != null)) {
+ SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
+
+ String dateFormat = sharedPref.getString(PREF_LAST_RENAME_DATE_PATTERN, null);
+ String numberFormat = sharedPref.getString(PREF_LAST_RENAME_NUMBER_PATTERN, null);
+ menuitem.setTitle(createExampleResultFileName(dateFormat, dirBaseName, numberFormat));
+ }
+ }
+
+ private boolean onRenamerPopupMenuClick(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.cmd_clear:
+ return setFileRule(null);
+ case R.id.cmd_dir:
+ return setFileRule(this.mProcessor.getDirBaseName());
+ case R.id.cmd_subdir_dir:
+ return setFileRule(this.getParentDirBaseName());
+ }
+ return false;
+ }
+
+ private boolean setFileRule(String namePart) {
+ SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
+
+ mCurrentAutoprocessingData.setNumberFormat((namePart == null) ? "" : sharedPref.getString(PREF_LAST_RENAME_NUMBER_PATTERN, null));
+ mCurrentAutoprocessingData.setName((namePart == null) ? "" : namePart);
+ mCurrentAutoprocessingData.setDateFormat((namePart == null) ? "" : sharedPref.getString(PREF_LAST_RENAME_DATE_PATTERN, null));
+
+ toGui();
+
+ return true;
+ }
+
+ private void saveLastFilePattern(String dateFormat, String numberFormat) {
+ SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
+ SharedPreferences.Editor edit = sharedPref.edit();
+
+ edit.putString(PREF_LAST_RENAME_DATE_PATTERN, dateFormat);
+ edit.putString(PREF_LAST_RENAME_NUMBER_PATTERN, numberFormat);
+
+ edit.apply();
+
+ }
+
+ /**
+ * cmd exif press: schow exif editor
+ */
+ private void onPickExif() {
+ fromGui();
+ ExifEditActivity.showActivity("[4]", this, mCurrentAutoprocessingData.getMediaDefaults(),
+ null, getSelectedFiles(mDebugPrefix+"EditExif-", getIntent(),
+ false),
+ EXIF_EDIT_RESULT_ID, false);
+ }
+
+ /**
+ * #132: cmd exif long-press: infer exif from selected and schow exif editor
+ */
+ private boolean onReInferExifAndPick() {
+ fromGui();
+ IMetaApi currentMediaDefaults = mCurrentAutoprocessingData.getMediaDefaults();
+
+ SelectedFiles selectedFiles = getSelectedFiles(mDebugPrefix + "EditExif-", getIntent(),
+ false);
+ IMetaApi inferedMediaDefaults = MediaUtil.inferAutoprocessingExifDefaults(new MediaDTO(), selectedFiles.getFiles());
+
+ if (inferedMediaDefaults.getDescription() != null) currentMediaDefaults.setDescription(inferedMediaDefaults.getDescription());
+ if (inferedMediaDefaults.getLatitude() != null) currentMediaDefaults.setLatitudeLongitude(inferedMediaDefaults.getLatitude(), inferedMediaDefaults.getLongitude());
+
+ if (inferedMediaDefaults.getTags() != null) {
+ List tags = currentMediaDefaults.getTags();
+ ListUtils.include(tags, inferedMediaDefaults.getTags());
+ inferedMediaDefaults.setTags(tags);
+ }
+
+ ExifEditActivity.showActivity("[4]", this, currentMediaDefaults,
+ null, selectedFiles,
+ EXIF_EDIT_RESULT_ID, false);
+ return true;
+ }
+ /**
+ * exif editor result
+ */
+ private void onExifChanged(IMetaApi modifiedExif) {
+ if (modifiedExif != null) {
+ mCurrentAutoprocessingData.setMediaDefaults(modifiedExif);
+ toGui();
+ }
+ }
+
+ @NonNull
+ private SelectedFiles getSelectedFiles(String dbgContext, Intent intent, boolean mustLoadIDs) {
+ if (intent == null) return null;
+
+ SelectedFiles result = AffUtils.getSelectedFiles(intent);
+
+ if (result == null) {
+ String path = IntentUtil.getFilePath(this, IntentUtil.getUri(intent));
+ File rootDirFile = new File(path);
+ String[] fileNames = rootDirFile.list(MediaUtil.JPG_FILENAME_FILTER);
+
+ int itemCount = (fileNames != null) ? fileNames.length : 0;
+
+ // convert to absolute paths
+ String parentDirString = rootDirFile.getAbsolutePath();
+ for (int i = 0; i < itemCount; i++) {
+ fileNames[i] = parentDirString + "/" + fileNames[i];
+ }
+
+ Long[] ids = null;
+
+ if (itemCount > 0) {
+ if ((mustLoadIDs) && (ids == null)) {
+ ids = new Long[itemCount];
+ Map idMap = FotoSql.execGetPathIdMap(this, fileNames);
+
+ for (int i = 0; i < itemCount; i++) {
+ ids[i] = idMap.get(fileNames[i]);
+ }
+ }
+
+ }
+ result = new SelectedFiles(fileNames,
+ ids, null);
+ }
+
+ if (Global.debugEnabled && (intent != null)) {
+ Log.d(Global.LOG_CONTEXT, mDebugPrefix + dbgContext + intent.toUri(Intent.URI_INTENT_SCHEME));
+ }
+
+ return result;
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ // Inflate the menu; this adds items to the action bar if it is present.
+ getMenuInflater().inflate(R.menu.menu_edit_common, menu);
+ getMenuInflater().inflate(R.menu.menu_autoprocessing, menu);
+
+ MenuItem item = menu.findItem(android.R.id.paste);
+ final File clipboardDir = ClipboardUtil.getClipboardDir(this);
+ final File apmFile = (clipboardDir == null) ? null : PhotoAutoprocessingDto.getApmFile(clipboardDir);
+ if ((item != null) && (apmFile != null) && apmFile.exists()) {
+ item.setVisible(true);
+ }
+
+ item = menu.findItem(android.R.id.copy);
+ if ((item != null) && (mCurrentOutDir == null)) {
+ item.setVisible(false);
+ }
+ AboutDialogPreference.onPrepareOptionsMenu(this, menu);
+
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ // Handle action bar item clicks here. The action bar will
+ // automatically handle clicks on the Home/Up button, so long
+ // as you specify a parent activity in AndroidManifest.xml.
+ int id = item.getItemId();
+
+ switch (id) {
+ case R.id.cmd_cancel:
+ setResult(Activity.RESULT_CANCELED, null);
+ finish();
+ return true;
+ case R.id.cmd_ok:
+ onOk();
+ return true;
+ case R.id.cmd_clear:
+ clearFilter();
+ return true;
+ case R.id.cmd_about:
+ AboutDialogPreference.createAboutDialog(this).show();
+ return true;
+ case R.id.cmd_settings:
+ SettingsActivity.showActivity(this);
+ return true;
+
+ case android.R.id.copy:
+ return ClipboardUtil.addDirToClipboard(this, mCurrentOutDir);
+ case android.R.id.paste:
+ return onPaste();
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+ }
+
+ private boolean onPaste() {
+ File dir = ClipboardUtil.getClipboardDir(this);
+ if (dir != null) {
+ try {
+ PhotoAutoprocessingDto srcApm = new PhotoAutoprocessingDto().load(dir);
+ if (srcApm != null) {
+ mCurrentAutoprocessingData.paste(srcApm);
+ toGui();
+ return true;
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Call back from sub-activities.
+ * Process Change StartTime (longpress start), Select StopTime before stop
+ * (longpress stop) or filter change for detailReport
+ */
+ @Override
+ protected void onActivityResult(final int requestCode,
+ final int resultCode, final Intent intent) {
+ super.onActivityResult(requestCode, resultCode, intent);
+
+ switch (requestCode) {
+ case EXIF_EDIT_RESULT_ID:
+ if (resultCode != 0) {
+ onExifChanged(ExifEditActivity.getExifParam(intent));
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ @Override
+ protected void onResume() {
+ Global.debugMemory(mDebugPrefix, "onResume");
+ super.onResume();
+ }
+
+ /**
+ * save exif changes back to image and database
+ */
+ private void onOk() {
+ fromGui();
+ try {
+ mCurrentAutoprocessingData.save();
+ saveLastFilePattern(mCurrentAutoprocessingData.getDateFormat(), mCurrentAutoprocessingData.getNumberFormat());
+ setResult(Activity.RESULT_OK, null);
+ } catch (IOException e) {
+ onFatalError("onOk()-save()", e);
+ }
+ finish();
+ }
+
+ private void clearFilter() {
+ mCurrentAutoprocessingData.clear();
+ toGui();
+ }
+
+ /**
+ * implement resource based labels for MediaUtil.toString(...)
+ */
+ private MediaUtil.ILabelGenerator mLabelGenerator = new MediaUtil.ILabelGenerator() {
+ @Override
+ public String get(MediaUtil.FieldID id) {
+ switch (id) {
+ case dateTimeTaken:
+ return getString2(R.string.lbl_date);
+ case title:
+ return getString2(R.string.lbl_title);
+ case description:
+ return getString2(R.string.lbl_description);
+ case latitude_longitude:
+ return getString2(R.string.lbl_latitude_short) + "/" + getString(R.string.lbl_longitude_short) + " ";
+ case rating:
+ return getString2(R.string.lbl_rating);
+ case visibility:
+ return getString2(R.string.lbl_image_visibility);
+ case tags:
+ return getString2(R.string.lbl_tag);
+ case path:
+ case clasz:
+ return null;
+ }
+ return null;
+ }
+ };
+
+ public final String getString2(int resId) {
+ return "\n" + getString(resId) + " ";
+ }
+}
+
diff --git a/app/src/main/res/layout/activity_backup.xml b/app/src/main/res/layout/activity_backup.xml
new file mode 100644
index 00000000..2edab2b5
--- /dev/null
+++ b/app/src/main/res/layout/activity_backup.xml
@@ -0,0 +1,336 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml
index b71e7e6e..338c5b44 100644
--- a/app/src/main/res/values/donottranslate.xml
+++ b/app/src/main/res/values/donottranslate.xml
@@ -28,7 +28,10 @@ this program. If not, see
LogCat SQL
LogCat JPG
LogCat geo map
-
+
RESET
LogCat gridview/listview
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 9da73db9..da6f2fb2 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -257,7 +257,7 @@ You can undo hiding by calling the mediascanner from gallery-menu."
replaced by android.R.string.xxx @android:string/xxx : btn_cancel btn_no btn_yes btn_okcopy_menu_title
sperate boomark picker is deprecated. now open via folder picker
- Load album from …
+ Load album from …
note: with ver 0.7.0 'bookmark' will become 'virtual album'
-->
@@ -266,10 +266,16 @@ You can undo hiding by calling the mediascanner from gallery-menu."
Backup
- Output Zip
- Folder
+ Where: Output Zip
File
+ Folder
Generate Zip-Subfolders below
+
+ When:
+
From 205b1e258f6e200499c8e1642edc5eda3776b21b Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Wed, 14 Nov 2018 17:39:50 +0100
Subject: [PATCH 07/35] Update to as-3.2/gradle-4.6/buildTools 3.2.1
---
.travis.yml | 3 +-
app/build.gradle | 56 ++++++++++++------------
build.gradle | 3 +-
gradle/wrapper/gradle-wrapper.properties | 4 +-
4 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 7f142be6..5c58b406 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,8 +18,7 @@ android:
# values in gradle.properties and .travis must be the same
# - build-tools-24.0.2
- - build-tools-27.0.1
- - android-23
+ - android-21
- add-on
- extra
diff --git a/app/build.gradle b/app/build.gradle
index a427725f..0e55302f 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -10,7 +10,6 @@ apply plugin: 'ch.raffael.pegdown-doclet'
android {
// appXXX are defined in gradle.properties
compileSdkVersion = Integer.valueOf(appCompileSdkVersion)
- buildToolsVersion = appBuildToolsVersion
defaultConfig {
// fdroid-release 'de.k3b.android.androFotoFinder'
@@ -84,6 +83,7 @@ android {
abortOnError false
}
+ buildToolsVersion = '28.0.3'
}
// task from https://stackoverflow.com/questions/45848521/how-to-sync-android-project-by-gradle-task/45856729#45856729
@@ -100,52 +100,52 @@ task('increaseVersionCode') << {
}
dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- compile project(':fotolib2')
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation project(':fotolib2')
- // compile project(':k3b-geoHelper')
- compile 'com.github.k3b:k3b-geoHelper:1.1.5'
+ // implementation project(':k3b-geoHelper')
+ implementation 'com.github.k3b:k3b-geoHelper:1.1.5'
// https://github.com/nostra13/Android-Universal-Image-Loader
- compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
+ implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
// zoomable image view
// from https://github.com/chrisbanes/PhotoView
- // compile 'com.github.chrisbanes.photoview:library:1.2.3'
- // compile project(':fotoview.library') // local copy of PhotoView
- compile 'com.github.k3b:PhotoView:v1.2.6.k3b-7-SNAPSHOT' // via jitpack.io last bugfix on 2018-10-17
+ // implementation 'com.github.chrisbanes.photoview:library:1.2.3'
+ // implementation project(':fotoview.library') // local copy of PhotoView
+ implementation 'com.github.k3b:PhotoView:v1.2.6.k3b-7-SNAPSHOT' // via jitpack.io last bugfix on 2018-10-17
// for view-pager
- compile 'com.android.support:support-v4:21.0.2'
- // compile 'com.android.support:support-v4:23.1.1'
- // compile 'com.android.support:support-v4:21.0.2'
- // compile 'com.android.support:appcompat-v7:21.0.2'
+ implementation 'com.android.support:support-v4:21.0.2'
+ // implementation 'com.android.support:support-v4:23.1.1'
+ // implementation 'com.android.support:support-v4:21.0.2'
+ // implementation 'com.android.support:appcompat-v7:21.0.2'
// exif support
// https://github.com/drewnoakes/metadata-extractor/wiki/GettingStarted licence: http://www.apache.org/licenses/LICENSE-2.0
// 2.10.1 includes more recent xmpcore that generates java-8 bytecode not supported by android yet
- compile ('com.drewnoakes:metadata-extractor:2.10.1') { transitive = false; } // 2.8.1
+ implementation ('com.drewnoakes:metadata-extractor:2.10.1') { transitive = false; } // 2.8.1
- // compile 'com.adobe.xmp:xmpcore:6.1.10' // update for drewnoakes:metadata-extractor requires java-8 compiler does not run on my android-4.4.
- compile 'com.adobe.xmp:xmpcore:5.1.2' // current version for drewnoakes:metadata-extractor
+ // implementation 'com.adobe.xmp:xmpcore:6.1.10' // update for drewnoakes:metadata-extractor requires java-8 compiler does not run on my android-4.4.
+ implementation 'com.adobe.xmp:xmpcore:5.1.2' // current version for drewnoakes:metadata-extractor
- // compile 'com.github.k3b:slideDateTimePicker:v1.0.5' // via jitpack.io
+ // implementation 'com.github.k3b:slideDateTimePicker:v1.0.5' // via jitpack.io
- // compile 'org.apache.commons:commons-configuration2:2.1.1'
+ // implementation 'org.apache.commons:commons-configuration2:2.1.1'
// this is osmdroid
- // compile 'org.osmdroid:osmdroid-android:5.4:release@aar'
- // compile ('org.osmdroid:osmdroid-mapsforge:5.4:release@aar')
- compile 'org.osmdroid:osmdroid-android:6.0.1'
- compile ('org.osmdroid:osmdroid-mapsforge:6.0.1')
+ // implementation 'org.osmdroid:osmdroid-android:5.4:release@aar'
+ // implementation ('org.osmdroid:osmdroid-mapsforge:5.4:release@aar')
+ implementation 'org.osmdroid:osmdroid-android:6.0.1'
+ implementation ('org.osmdroid:osmdroid-mapsforge:6.0.1')
//Mapsforge rendering and database support, which is LGPL
- compile 'org.mapsforge:mapsforge-map-android:0.6.1'
- compile 'org.mapsforge:mapsforge-map:0.6.1'
+ implementation 'org.mapsforge:mapsforge-map-android:0.6.1'
+ implementation 'org.mapsforge:mapsforge-map:0.6.1'
- compile 'org.slf4j:slf4j-api:1.7.7@jar'
- compile 'eu.lp0.slf4j:slf4j-android:1.7.7-1@jar'
+ implementation 'org.slf4j:slf4j-api:1.7.7@jar'
+ implementation 'eu.lp0.slf4j:slf4j-android:1.7.7-1@jar'
- testCompile 'junit:junit:4.11'
- testCompile 'org.slf4j:slf4j-simple:1.7.7'
+ testImplementation 'junit:junit:4.11'
+ testImplementation 'org.slf4j:slf4j-simple:1.7.7'
}
diff --git a/build.gradle b/build.gradle
index ad47ec8e..b718056a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -8,7 +8,7 @@ buildscript {
}
dependencies {
// see https://jcenter.bintray.com/com/android/tools/build/gradle/
- classpath 'com.android.tools.build:gradle:3.0.1'
+ classpath 'com.android.tools.build:gradle:3.2.1'
// markdown & unl-diagrams in javadoc
// https://github.com/Abnaxos/pegdown-doclet
@@ -21,6 +21,7 @@ buildscript {
allprojects {
repositories {
+ google()
jcenter()
maven { url 'https://jitpack.io' }
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 65e6202b..3981a143 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Tue Apr 11 16:11:39 CEST 2017
+#Wed Nov 14 17:02:23 CET 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
From 4a5e881a1897dc4591191c14ed5a10e411160f58 Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Wed, 14 Nov 2018 17:46:57 +0100
Subject: [PATCH 08/35] Update to as-3.2/gradle-4.6/buildTools 3.2.1
---
.travis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index 5c58b406..97510b9b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,7 +18,7 @@ android:
# values in gradle.properties and .travis must be the same
# - build-tools-24.0.2
- - android-21
+ - android-23
- add-on
- extra
From 44c4d35339112b4f91a1ec5769aa2a79f0c8feea Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Wed, 14 Nov 2018 17:54:43 +0100
Subject: [PATCH 09/35] Update to as-3.2/gradle-4.6/buildTools 3.2.1/travis
---
.travis.yml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index 97510b9b..f9253d02 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,7 +17,7 @@ android:
- tools
# values in gradle.properties and .travis must be the same
- # - build-tools-24.0.2
+ - build-tools-28.0.3
- android-23
- add-on
@@ -29,6 +29,8 @@ before_install:
# git update-index --chmod=+x gradlew
# instead of
# - chmod +x gradlew
+# https://stackoverflow.com/questions/52274229/travis-ci-android-28-licenses-have-not-been-accepted
+- yes | sdkmanager "platforms;android-28"
script:
- jdk_switcher use oraclejdk8
From ef884c841b03e4cf523add36c5968a43f368665e Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Sun, 16 Dec 2018 11:00:18 +0100
Subject: [PATCH 10/35] Refactored LogCat to allow output via outputstream for
Android5ff/StorageAccessFramework for ToGoZip
---
.../androFotoFinder/AndroFotoFinderApp.java | 38 +++++++-
.../main/java/de/k3b/android/util/LogCat.java | 91 +++++++++----------
2 files changed, 79 insertions(+), 50 deletions(-)
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java b/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java
index f6c503c4..1674e5b2 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java
@@ -23,9 +23,11 @@
import android.content.Context;
import android.support.annotation.NonNull;
import android.util.Log;
+import android.widget.Toast;
import org.osmdroid.api.IMapView;
+import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
@@ -51,6 +53,8 @@
* Created by k3b on 14.07.2015.
*/
public class AndroFotoFinderApp extends Application {
+ private static String fileNamePrefix = "androFotofinder.logcat-";
+
private LogCat mCrashSaveToFile = null;
@@ -88,10 +92,40 @@ public static RefWatcher getRefWatcher(Context context) {
QueryParameter.sParserDefaultQueryTypeId = FotoSql.QUERY_TYPE_DEFAULT;
QueryParameter.sParserDefaultSelect = new ArrayList();
Collections.addAll(QueryParameter.sParserDefaultSelect, FotoSql.DEFAULT_GALLERY_COLUMNS);
- mCrashSaveToFile = new LogCat(this, Global.LOG_CONTEXT, HugeImageLoader.LOG_TAG,
+ mCrashSaveToFile = new LogCat(Global.LOG_CONTEXT, HugeImageLoader.LOG_TAG,
PhotoViewAttacher.LOG_TAG, CupcakeGestureDetector.LOG_TAG,
LibGlobal.LOG_TAG, ThumbNailUtils.LOG_TAG, IMapView.LOGTAG,
- ExifInterface.LOG_TAG, ImageMetaReader.LOG_TAG);
+ ExifInterface.LOG_TAG, ImageMetaReader.LOG_TAG) {
+
+ public void saveToFile() {
+ final File logFile = getOutpuFile();
+ String message = (logFile != null)
+ ? "saving errorlog ('LocCat') to " + logFile.getAbsolutePath()
+ : "Saving errorlog ('LocCat') is disabled. See Settings 'Diagnostics' for details";
+ Log.e(Global.LOG_CONTEXT, message);
+ Toast.makeText(AndroFotoFinderApp.this , message, Toast.LENGTH_LONG).show();
+
+ saveLogCat(logFile, null, mTags);
+ }
+
+ private File getOutpuFile() {
+ File logDirectory = Global.logCatDir;
+ if (logDirectory == null) return null;
+
+ // Datetime as part of the crash-log-filename
+ // i.e. /mnt/sdcard/copy/log/androFotofinder.logcat-20160509-195217.txt
+
+ File logFile = new File(logDirectory,
+ getLocalLogFileName(fileNamePrefix));
+
+ // create log folder
+ logDirectory.mkdirs();
+
+ return logFile;
+ }
+
+
+ };
ThumbNailUtils.init(this, null);
diff --git a/app/src/main/java/de/k3b/android/util/LogCat.java b/app/src/main/java/de/k3b/android/util/LogCat.java
index 33db7dec..54e86bca 100644
--- a/app/src/main/java/de/k3b/android/util/LogCat.java
+++ b/app/src/main/java/de/k3b/android/util/LogCat.java
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2015-2016 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
- * This file is part of AndroFotoFinder.
+ * This file is part of AndroFotoFinder / #APhotoManager / ToGoZip.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
@@ -19,90 +19,85 @@
package de.k3b.android.util;
-import android.content.Context;
import android.util.Log;
-import android.widget.Toast;
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
-import de.k3b.android.androFotoFinder.Global;
+import de.k3b.io.FileUtils;
/**
* UncaughtException writes apps own logcat content to logfile, if Global.logCatDir is defined.
*
* Created by k3b on 04.11.2015.
*/
-public class LogCat implements Thread.UncaughtExceptionHandler {
+public abstract class LogCat implements Thread.UncaughtExceptionHandler {
private Thread.UncaughtExceptionHandler mPreviousUncaughtExceptionHandler;
- private final Context mAppContext;
- private final String[] mTags;
+ protected final String[] mTags;
// Datetime as part of the crash-log-filename
// inspired by http://stackoverflow.com/questions/36617172/android-mediascanner-in-uncaughtexceptionhandler-not-scanning-file
private static DateFormat fmtDateTime2String = new SimpleDateFormat("yyyyMMdd-HHmmss", Locale.ROOT);
- public LogCat(Context appContext, String... tags) {
+ public LogCat(String... tags) {
fmtDateTime2String.setTimeZone(TimeZone.getTimeZone("UTC"));
- mAppContext = appContext;
+ if ((tags == null) || (tags.length < 1)) {
+ throw new IllegalArgumentException("LogCat must have at least one loggger name.");
+ }
this.mTags = tags;
mPreviousUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(this);
}
- public void saveToFile() {
- saveToFile(mAppContext, mTags);
- }
-
- private static void saveToFile(Context context, String... tags) {
- File logDirectory = Global.logCatDir;
-
- // Datetime as part of the crash-log-filename
- // i.e. /mnt/sdcard/copy/log/androFotofinder.logcat-20160509-195217.txt
- File logFile = (logDirectory == null) ? null : new File(logDirectory,
- "androFotofinder.logcat-"
- + fmtDateTime2String.format(new Date(System.currentTimeMillis()))
- + ".txt");
- String message = (logFile != null)
- ? "saving errorlog ('LocCat') to " + logFile.getAbsolutePath()
- : "Saving errorlog ('LocCat') is disabled. See Settings 'Diagnostics' for details";
- Log.e(Global.LOG_CONTEXT, message);
- if (context != null) {
- Toast.makeText(context, message, Toast.LENGTH_LONG).show();
- }
-
- if (logDirectory != null) {
+ public abstract void saveToFile();
- // create log folder
- logDirectory.mkdirs();
+ protected void saveLogCat(File logFile, OutputStream outputStream, String[] tags) {
+ StringBuilder cmdline = new StringBuilder();
- StringBuilder cmdline = new StringBuilder();
+ // see http://developer.android.com/tools/debugging/debugging-log.html#filteringOutput
+ cmdline.append("logcat -d -v long");
+ if (logFile != null) {
+ cmdline.append(" -f ").append(logFile);
+ }
+ cmdline.append(" -s ");
+ for (String tag : tags) {
+ cmdline.append(tag).append(":D ");
+ }
- // see http://developer.android.com/tools/debugging/debugging-log.html#filteringOutput
- cmdline.append("logcat -d -v long -f ").append(logFile).append(" -s ");
- for (String tag : tags) {
- cmdline.append(tag).append(":D ");
- }
- // clear the previous logcat and then write the new one to the file
- try {
- Runtime.getRuntime().exec(cmdline.toString());
- } catch (IOException e) {
- e.printStackTrace();
+ // clear the previous logcat and then write the new one to the file
+ try {
+ Process process = Runtime.getRuntime().exec(cmdline.toString());
+ if (outputStream != null) {
+ final InputStream inputStream = process.getInputStream();
+ if (inputStream != null) {
+ FileUtils.copy(inputStream, outputStream);
+ inputStream.close();
+ }
}
+ } catch (IOException e) {
+ e.printStackTrace();
}
}
+ protected String getLocalLogFileName(String fileNamePrefix) {
+ return fileNamePrefix
+ + fmtDateTime2String.format(new Date(System.currentTimeMillis()))
+ + ".txt";
+ }
+
public void clear() {
- clear(mAppContext, mTags);
+ clear(mTags);
}
- private static void clear(Context context, String... tags) {
+ private static void clear(String... tags) {
StringBuilder cmdline = new StringBuilder();
// see http://developer.android.com/tools/debugging/debugging-log.html#filteringOutput
@@ -123,7 +118,7 @@ public void uncaughtException(Thread thread, Throwable ex) {
try {
// Do your stuff with the exception
- Log.e(Global.LOG_CONTEXT,"LogCat.uncaughtException " + ex, ex);
+ Log.e(mTags[0],"LogCat.uncaughtException " + ex, ex);
saveToFile();
} catch (Exception e) {
/* Ignore */
From 76e02fba0a7ddd6c918996d6de9f6e1ce4eb6f5b Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Sun, 16 Dec 2018 11:04:59 +0100
Subject: [PATCH 11/35] bugfix
---
app/src/main/java/de/k3b/android/util/FileManagerUtil.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/src/main/java/de/k3b/android/util/FileManagerUtil.java b/app/src/main/java/de/k3b/android/util/FileManagerUtil.java
index 0953676b..f5e68481 100644
--- a/app/src/main/java/de/k3b/android/util/FileManagerUtil.java
+++ b/app/src/main/java/de/k3b/android/util/FileManagerUtil.java
@@ -38,7 +38,9 @@
public class FileManagerUtil {
private static Intent getIntentShowInFilemanager(Activity context, String path) {
if ((path != null) && (path.length() > 0)) {
- final Uri pathUri = Uri.fromFile(new File(path));
+ final Uri pathUri = (path.indexOf(':') > 0)
+ ? Uri.parse(path)
+ : Uri.fromFile(new File(path));
Intent startIntent = new Intent();
startIntent.setAction(Intent.ACTION_VIEW);
From 162278ed233e7d8da83736521512caa8a360a4a3 Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Sun, 16 Dec 2018 12:00:20 +0100
Subject: [PATCH 12/35] #108: Zip-file export/backup: Started BackupActivity
---
app/src/main/AndroidManifest.xml | 8 +-
.../k3b/android/androFotoFinder/AffUtils.java | 26 +-
.../androFotoFinder/BackupActivity.java | 706 ++++--------------
.../GalleryFilterActivity.java | 5 +-
.../gallery/cursor/GalleryCursorFragment.java | 13 +-
.../queries/AndroidAlbumUtils.java | 55 +-
.../menu_gallery_multiselect_mode_all.xml | 10 +-
.../menu/menu_gallery_non_selected_only.xml | 10 +-
app/src/main/res/menu/menu_image_commands.xml | 4 +-
app/src/main/res/values/strings.xml | 4 +-
fotolib2/build.gradle | 2 +-
.../src/main/java/de/k3b/zip/IZipConfig.java | 35 +
.../main/java/de/k3b/zip/LibZipGlobal.java | 35 +
.../main/java/de/k3b/zip/ZipConfigDto.java | 98 +++
.../java/de/k3b/zip/ZipConfigRepository.java | 74 ++
15 files changed, 485 insertions(+), 600 deletions(-)
create mode 100644 fotolib2/src/main/java/de/k3b/zip/IZipConfig.java
create mode 100644 fotolib2/src/main/java/de/k3b/zip/LibZipGlobal.java
create mode 100644 fotolib2/src/main/java/de/k3b/zip/ZipConfigDto.java
create mode 100644 fotolib2/src/main/java/de/k3b/zip/ZipConfigRepository.java
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index aefdd560..b99fa630 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,6 +1,6 @@
-
+
+
+
+
-
+
+
+
-
-
Backup
+ Backup to zip
Where: Output Zip
File
diff --git a/fotolib2/build.gradle b/fotolib2/build.gradle
index a55aada7..f5051ab3 100644
--- a/fotolib2/build.gradle
+++ b/fotolib2/build.gradle
@@ -26,7 +26,7 @@ dependencies {
// https://jitpack.io/com/github/k3b/ToGoZip/L2.0.15/build.log
// https://jitpack.io/com/github/k3b/ToGoZip/libK3bZip/L2.0.15/
- // implementation('com.github.k3b.ToGoZip:libK3bZip:L2.0.15') { transitive = false; }
+ implementation('com.github.k3b.ToGoZip:libK3bZip:L2.0.15') { transitive = false; }
}
diff --git a/fotolib2/src/main/java/de/k3b/zip/IZipConfig.java b/fotolib2/src/main/java/de/k3b/zip/IZipConfig.java
new file mode 100644
index 00000000..3b39653d
--- /dev/null
+++ b/fotolib2/src/main/java/de/k3b/zip/IZipConfig.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2018-2019 by k3b.
+ *
+ * This file is part of #toGoZip (https://github.com/k3b/ToGoZip/).
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see
+ */
+package de.k3b.zip;
+
+import java.util.Date;
+
+public interface IZipConfig {
+ Date getDateModifiedFrom();
+ String getZipRelPath ();
+ String getZipName ();
+ String getZipDir ();
+ String getFilter ();
+
+ void setDateModifiedFrom(Date value);
+ void setZipRelPath(String value);
+ void setZipName(String value);
+ void setZipDir(String value);
+ void setFilter(String value);
+}
diff --git a/fotolib2/src/main/java/de/k3b/zip/LibZipGlobal.java b/fotolib2/src/main/java/de/k3b/zip/LibZipGlobal.java
new file mode 100644
index 00000000..ca16687e
--- /dev/null
+++ b/fotolib2/src/main/java/de/k3b/zip/LibZipGlobal.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2018-2019 by k3b.
+ *
+ * This file is part of #toGoZip (https://github.com/k3b/ToGoZip/).
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see
+ */
+
+package de.k3b.zip;
+
+/**
+ * Public Global stuff for the zip specific parts of the lib.
+ *
+ * Created by k3b on 2018-12-14.
+ */
+public class LibZipGlobal {
+ /** LOG_CONTEXT is used as logging source for filtering logging messages that belong to this */
+ public static final String LOG_TAG = "k3b.zip";
+
+ /**
+ * Global.xxxxx. Non final values may be changed from outside (SettingsActivity or commandline parameter)
+ */
+ public static boolean debugEnabled = false;
+}
diff --git a/fotolib2/src/main/java/de/k3b/zip/ZipConfigDto.java b/fotolib2/src/main/java/de/k3b/zip/ZipConfigDto.java
new file mode 100644
index 00000000..baa0372d
--- /dev/null
+++ b/fotolib2/src/main/java/de/k3b/zip/ZipConfigDto.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2018-2019 by k3b.
+ *
+ * This file is part of #toGoZip (https://github.com/k3b/ToGoZip/).
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see
+ */
+package de.k3b.zip;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class ZipConfigDto implements IZipConfig, Serializable {
+ private Date dateModifiedFrom ;
+ private String zipRelPath ;
+ private String zipName ;
+ private String zipDir ;
+ private String filter ;
+
+ public ZipConfigDto(IZipConfig source) {
+ loadFrom(source);
+ }
+
+ public void loadFrom(IZipConfig source) {
+ copy(this,source);
+ }
+
+ public static void copy(IZipConfig dest, IZipConfig source) {
+ if ((null != dest) && (null != source)) {
+ dest.setDateModifiedFrom (source.getDateModifiedFrom());
+ dest.setZipRelPath (source.getZipRelPath ());
+ dest.setZipName (source.getZipName ());
+ dest.setZipDir (source.getZipDir ());
+ dest.setFilter (source.getFilter ());
+ }
+ }
+
+ @Override
+ public Date getDateModifiedFrom() {
+ return dateModifiedFrom;
+ }
+
+ @Override
+ public void setDateModifiedFrom(Date dateModifiedFrom) {
+ this.dateModifiedFrom = dateModifiedFrom;
+ }
+
+ @Override
+ public String getZipRelPath() {
+ return zipRelPath;
+ }
+
+ @Override
+ public void setZipRelPath(String zipRelPath) {
+ this.zipRelPath = zipRelPath;
+ }
+
+ @Override
+ public String getZipName() {
+ return zipName;
+ }
+
+ @Override
+ public void setZipName(String zipName) {
+ this.zipName = zipName;
+ }
+
+ @Override
+ public String getZipDir() {
+ return zipDir;
+ }
+
+ @Override
+ public void setZipDir(String zipDir) {
+ this.zipDir = zipDir;
+ }
+
+ @Override
+ public String getFilter() {
+ return filter;
+ }
+
+ @Override
+ public void setFilter(String filter) {
+ this.filter = filter;
+ }
+}
diff --git a/fotolib2/src/main/java/de/k3b/zip/ZipConfigRepository.java b/fotolib2/src/main/java/de/k3b/zip/ZipConfigRepository.java
new file mode 100644
index 00000000..b20bb20b
--- /dev/null
+++ b/fotolib2/src/main/java/de/k3b/zip/ZipConfigRepository.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018-2019 by k3b.
+ *
+ * This file is part of #toGoZip (https://github.com/k3b/ToGoZip/).
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see
+ */
+package de.k3b.zip;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Date;
+import java.util.Properties;
+
+import de.k3b.io.DateUtil;
+import de.k3b.io.StringUtils;
+
+public class ZipConfigRepository implements IZipConfig {
+ private static final String FILE_SUFFIX = ".zip.apm.config";
+ private Properties data = new Properties();
+ public static boolean isZipConfig(String uri) {
+ if (uri == null) return false;
+ return uri.endsWith(FILE_SUFFIX);
+ }
+
+ public ZipConfigRepository load(InputStream inputsteam, Object uri) throws IOException {
+ data.clear();
+ data.load(inputsteam);
+ return this;
+ }
+
+ @Override
+ public Date getDateModifiedFrom() {
+ return DateUtil.parseIsoDate(get("DateModifiedFrom"));
+ }
+
+ @Override public String getZipRelPath() {return get("ZipRelPath");}
+ @Override public String getZipName () {return get("ZipName");}
+ @Override public String getZipDir () {return get("ZipDir");}
+ @Override public String getFilter () {return get("Filter");}
+
+ @Override
+ public void setDateModifiedFrom(Date value) {
+ set("DateModifiedFrom",DateUtil.toIsoDateTimeString(value));
+ }
+
+ @Override public void setZipRelPath(String value) {set("ZipRelPath",value);}
+ @Override public void setZipName (String value) {set("ZipName",value);}
+ @Override public void setZipDir (String value) {set("ZipDir",value);}
+ @Override public void setFilter (String value) {set("Filter",value);}
+
+
+ private void set(String key, String value) {
+ if (StringUtils.isNullOrEmpty(value))
+ data.remove(key);
+ else
+ data.put(key, value);
+ }
+
+ private String get(String key) {
+ return data.getProperty(key);
+ }
+}
From a546a79c61f7a9da7c9d09e917ce707e3fd24ba1 Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Sun, 16 Dec 2018 19:33:24 +0100
Subject: [PATCH 13/35] #21: updated ja translations by naofum
---
app/src/main/res/values-ja/strings.xml | 361 +++++++++++++------------
1 file changed, 186 insertions(+), 175 deletions(-)
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index a63ae2c3..ef6f4a0d 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -21,129 +21,128 @@
*/
-->
- \"A Photo Manager\"%1$s\" について
- 地図表示エリアを選択
- 背景
- ブックマーク %1$s を削除しました。
- ブックマーク %1$s を削除できません。
- このブックマークを削除しますか?
- \'%1$s\' のバージョン %2$s と %3$s で生成されました。詳細は https://github.com/k3b/APhotoManager/wiki/intentapi#sql を参照してください。
- … からブックマークを読み込む
- … としてブックマークを保存
- 変更
- 一時停止
- %1$d/%2$d ファイルをコピーしました
- 削除
- "これらのファイルを完全に削除してもよろしいですか?
+ \"A Photo Manager\"%1$s\" について
+ 地図表示エリアを選択
+ 背景
+ アルバム
+ ブックマーク %1$s を削除しました。
+ ブックマーク %1$s を削除できません。
+ このブックマークを削除しますか?
+ \'%1$s\' のバージョン %2$s と %3$s で生成されました。詳細は https://github.com/k3b/APhotoManager/wiki/intentapi#sql を参照してください。
+ … としてブックマークを保存
+ 変更
+ 一時停止
+ %1$d/%2$d ファイルをコピーしました
+ 削除
+ "これらのファイルを完全に削除してもよろしいですか?
%1$s
この操作を元に戻すことはできません。"
- 写真を削除しますか?
- %1$d/%2$d ファイルを削除しました
- コピー先
- 移転先
- 詳細
- 写真エディターを選択
- 写真エディターが見つかりません
- 編集
- 書き込み保護された \'%1$s\'。\n\n \'%2$s\' はできません。
- \'%1$s\' は有効な日付ではありません。
- \'%1$s\' は、有効な座標ではありません。
- フィルター
- %1$s を選択
- フォルダー %1$s の読み込みに失敗しました
- フォルダーのフィルター
- 写真
- 地図に表示
- 外部地理アプリで表示
- 位置情報を設定
- 選択した写真に位置情報を変更しています
- 位置情報選択機能がありません
- 写真の新しい位置情報を選択
- SQL エラー \'%1$s\'\n\n%2$s
- 無効な SQL です。デフォルトを再読み込みしています
- システムエラーです。終了します
- \'%1$s\' というファイルは既に存在します。\n 上書きしてもよろしいですか?
- ファイル \'%1$s\' の名前を変更できません。
- %1$s の写真が見つかりません。
- 写真が、まだメディア データベース %1$s に見つかりません。%2$d の新しいファイルをスキャンしています。行方不明の写真はすぐに利用できるようになります。
- "読み込み中(%1$d) …"
- %1$d の写真を更新しました。
- 日付
- 緯度
- 経度
- パス
- 位置情報なし
- 新しいフォルダー
- フォルダーを作成
- %1$s を作成できません
- %1$s を作成しました
- さらに ...
- 移動
- %1$d/%2$d ファイルを移動しました
- Map Tiles (c) OpenStreetMap 貢献者
- 上書きしますか?
- 名前の変更
- %1$d/%2$d ファイルの名前を変更しました
- スキャンを開始する場所?
- Android のメディアスキャン中の写真ファイルは処理できません。後でもう一度試してください。
- メディア スキャン
- %1$d のメディア データベース項目が更新されました
- %1$d を選択
- 画像のフォルダーを選択すると、OK が有効になります
- 選択したもののみ
- 選択: すべての表示を追加
- 選択: すべての表示を削除
- レポート フォルダー
- 診断
- … 実行した SQL を含みます。
- … グリッド/リストビュー項目を含みます。
- LogCat メモリ消費量
- LogCat jpg/xmp メタデータの読み取り/書き込み
- … of 3rd party libraries.
- LogCat その他。
- … 他のログ メッセージを含みます。
- LogCat をクリア
- LogCat をファイルに保存
- エラーログのフォルダー
- ミリ秒後に、自動アクションバー非表示
- 高品質の初期写真表示 (低速、より多くのメモリが必要)
- 初期の写真表示で、品質を向上させます
- ミリ秒単位のスライド ショー間隔
- 言語
- (デバイスの言語)
- 最大。地図に選択マーカー
- 位置情報履歴数の設定
- 位置情報履歴ファイルの設定
- 複数選択をクリア
- … コピー/移動/名前の変更/… 後に。
- 設定
- 送信/共有プロバイダーが見つかりません
- 複数送信: 項目の件数が超過しました
- 共有/送信
- 新しいギャラリーに表示
- スライド ショー
- 日付
- フォルダー
- 名前
- 長さ
- 並び替えない
- 場所
- 並べ変え
- %1$d/%2$d ファイルを更新しました
- 合わせてズーム
- 大きな写真の幅/高さ
- 写真の幅と高さがこれより大きい場合、画像の詳細表示でサムネイルを表示します。 (省メモリ、高速、ただし低品質)
- サムネイル フォルダー
- ローカル *.map 地図ファイルを使用する
- pc 経由で手動でダウンロードしたもの
- *.map 地図ファイル フォルダー
- 写真を表示
- 重複を修復
- 写真から地域を選択
- 地図から地域を選択
- 画像を非表示
- "よろしいですか?
+ 写真を削除しますか?
+ %1$d/%2$d ファイルを削除しました
+ コピー先
+ 移転先
+ 詳細
+ 写真エディターを選択
+ 写真エディターが見つかりません
+ 編集
+ 書き込み保護された \'%1$s\'。\n\n \'%2$s\' はできません。
+ \'%1$s\' は有効な日付ではありません。
+ \'%1$s\' は、有効な座標ではありません。
+ フィルター
+ %1$s を選択
+ フォルダー %1$s の読み込みに失敗しました
+ フォルダーのフィルター
+ 写真
+ 地図に表示
+ 外部地理アプリで表示
+ 位置情報を設定
+ 選択した写真に位置情報を変更しています
+ 位置情報選択機能がありません
+ 写真の新しい位置情報を選択
+ SQL エラー \'%1$s\'\n\n%2$s
+ 無効な SQL です。デフォルトを再読み込みしています
+ システムエラーです。終了します
+ \'%1$s\' というファイルは既に存在します。\n 上書きしてもよろしいですか?
+ ファイル \'%1$s\' の名前を変更できません。
+ %1$s の写真が見つかりません。
+ 写真が、まだメディア データベース %1$s に見つかりません。%2$d の新しいファイルをスキャンしています。行方不明の写真はすぐに利用できるようになります。
+ "読み込み中(%1$d) …"
+ %1$d の写真を更新しました。
+ 日付
+ 緯度
+ 経度
+ パス
+ 位置情報なし
+ 新しいフォルダー
+ フォルダーを作成
+ %1$s を作成できません
+ %1$s を作成しました
+ さらに ...
+ 移動
+ %1$d/%2$d ファイルを移動しました
+ Map Tiles (c) OpenStreetMap 貢献者
+ 上書きしますか?
+ 名前の変更
+ %1$d/%2$d ファイルの名前を変更しました
+ スキャンを開始する場所?
+ Android のメディアスキャン中の写真ファイルは処理できません。後でもう一度試してください。
+ メディア スキャン
+ %1$d のメディア データベース項目が更新されました
+ %1$d を選択
+ 画像のフォルダーを選択すると、OK が有効になります
+ 選択したもののみ
+ 選択: すべての表示を追加
+ 選択: すべての表示を削除
+ 診断
+ … 実行した SQL を含みます。
+ … グリッド/リストビュー項目を含みます。
+ LogCat メモリ消費量
+ LogCat jpg/xmp メタデータの読み取り/書き込み
+ … of 3rd party libraries.
+ LogCat その他。
+ … 他のログ メッセージを含みます。
+ LogCat をクリア
+ LogCat をファイルに保存
+ エラーログのフォルダー
+ ミリ秒後に、自動アクションバー非表示
+ 高品質の初期写真表示 (低速、より多くのメモリが必要)
+ 初期の写真表示で、品質を向上させます
+ ミリ秒単位のスライド ショー間隔
+ 言語
+ (デバイスの言語)
+ 最大。地図に選択マーカー
+ 位置情報履歴数の設定
+ 位置情報履歴ファイルの設定
+ 複数選択をクリア
+ … コピー/移動/名前の変更/… 後に。
+ 設定
+ 送信/共有プロバイダーが見つかりません
+ 複数送信: 項目の件数が超過しました
+ 共有/送信
+ 新しいギャラリーに表示
+ スライド ショー
+ 日付
+ フォルダー
+ 名前
+ 長さ
+ 並び替えない
+ 場所
+ 並べ変え
+ %1$d/%2$d ファイルを更新しました
+ 合わせてズーム
+ 大きな写真の幅/高さ
+ 写真の幅と高さがこれより大きい場合、画像の詳細表示でサムネイルを表示します。 (省メモリ、高速、ただし低品質)
+ サムネイル フォルダー
+ ローカル *.map 地図ファイルを使用する
+ pc 経由で手動でダウンロードしたもの
+ *.map 地図ファイル フォルダー
+ 写真を表示
+ 重複を修復
+ 写真から地域を選択
+ 地図から地域を選択
+ 画像を非表示
+ "よろしいですか?
下のすべてのメディアファイル (写真、ビデオ、オーディオ)
@@ -152,65 +151,77 @@
を、メディアデータベース、ギャラリーアプリ、メディアスキャナーから非表示にしますか?
ギャラリーメニューからメディアスキャナーを呼び出して、非表示を元に戻すことができます。"
- フォルダーまたはファイル名の一部。%=ワイルドカード
- 検索
- タグ、タイトル、説明、パスの一部
- 公開画像
- 非公開画像
- タグなし
- +タグ
- -タグ
- タグ
- タグを選択
- ここに入力してフィルター ...
- 一致するタグが見つかりません
- タグを設定
- 新しいタグを作成
- 新規_タグ
- 子を削除
- 影響を受けた写真のタグを更新
- タグ名を長押しするとメニューが開きます
- アクティビティ, 人, 場所, テーマ, プロジェクト
- 変更の書き込み
- jpg および xmp (見つからない場合は作成)
- jpg (および xmp、存在する場合)
- jpg ファイルのみ
- xmp ファイルのみ
- 長い Xmp サイドカー ファイル名?
- 長い: file.jpg.xmp; 短い: file.xmp
-
- コンテキストをロード ...
-
- Exif を編集
- タイトル
- 説明
- 評価
-
- 評価
- 最終更新
-
- 写真の自動処理を編集
- ファイル名のパターン
- Exif
-
+ コンテキストをロード ...
+
+ Exif を編集
+ タイトル
+ 説明
+ 評価
+
+ 評価
+ 最終更新
+
+ 写真の自動処理を編集
+ ファイル名のパターン
+ Exif
+
- "%1$s %2$d の写真\n\t%3$s (%4$s), …\nから %5$s\n\t%6$s"
-
- サイズ
- 幅
-
- 公開範囲
-
- アプリを保護/ピン留め
- アプリの保護を解除/ピン留め解除
-
- 非公開の名前を変更 ...jpg から ....jpg-p
-
+ サイズ
+ 幅
+
+ 公開範囲
+
+ アプリを保護/ピン留め
+ アプリの保護を解除/ピン留め解除
+
+ 非公開の名前を変更 ...jpg から ....jpg-p
+ クリア
+ ファイルマネージャーで開く
+
+ 検索バー
+ 日付の選択: 十年を使用
+ つまり 2010* からの 2010, 2011,...2019
+ 日付フィルター
+
+ 仮想アルバムを編集
+
- クリア
- ファイルマネージャーで開く
+ レポート フォルダー
From 16a2226da82ffb21b8da05e9fb67f8ef99399f2f Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Sun, 16 Dec 2018 20:30:49 +0100
Subject: [PATCH 14/35] #21: updated nl translations by Klaas Swart (verydutch)
---
README.md | 2 +-
app/src/debug/res/values-nl/fdroid.xml | 63 ++++
app/src/main/res/values-nl/html-pages.xml | 56 +++
app/src/main/res/values-nl/strings.xml | 351 ++++++++++--------
app/src/main/res/values/donottranslate.xml | 2 +-
.../metadata/android/en-US/changelogs/41.txt | 1 +
.../android/nl-NL/full_description.txt | 21 ++
.../android/nl-NL/short_description.txt | 1 +
fastlane/metadata/android/nl-NL/title.txt | 1 +
9 files changed, 338 insertions(+), 160 deletions(-)
create mode 100644 app/src/debug/res/values-nl/fdroid.xml
create mode 100644 app/src/main/res/values-nl/html-pages.xml
create mode 100644 fastlane/metadata/android/nl-NL/full_description.txt
create mode 100644 fastlane/metadata/android/nl-NL/short_description.txt
create mode 100644 fastlane/metadata/android/nl-NL/title.txt
diff --git a/README.md b/README.md
index 1a925f94..e1fabe3e 100644
--- a/README.md
+++ b/README.md
@@ -27,7 +27,7 @@ Privacy:
* Geotagging: Shows photos in a [geographic map](https://github.com/k3b/APhotoManager/wiki/geographic-map) from [openstreetmap](http://www.openstreetmap.org)
* Buildin file manager for photos: find, sort, view, copy, delete, Show in map, set gps exif data, send, edit exif, ... .
* Fast [find](https://github.com/k3b/APhotoManager/wiki/Filter-View) local photos by (sub-)folder, date, [geographic map](https://github.com/k3b/APhotoManager/wiki/geographic-map)or [tags (keywords)](https://github.com/k3b/APhotoManager/wiki/Tags).
-* [Translations](https://crowdin.com/project/AndroFotoFinder): ar, de , en , it , fr , ja , nl, pl, ro , ru tr , uk , zh-CN , zh-TW
+* [Translations](https://crowdin.com/project/AndroFotoFinder): ar, de , en , it , fr , ja , nl , pl, ro , ru tr , uk , zh-CN , zh-TW
* [![Crowdin](https://d322cqt584bo4o.cloudfront.net/androFotoFinder/localized.svg)](https://crowdin.com/project/androFotoFinder)Help us to translate into other languages.
---
diff --git a/app/src/debug/res/values-nl/fdroid.xml b/app/src/debug/res/values-nl/fdroid.xml
new file mode 100644
index 00000000..f209c25b
--- /dev/null
+++ b/app/src/debug/res/values-nl/fdroid.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+ Een foto beheerder
+
+ Lokale foto\'s beheren: vinden/kopieren/Exif bewerken en weergeven in galerij of op kaart.
+
+
+
diff --git a/app/src/main/res/values-nl/html-pages.xml b/app/src/main/res/values-nl/html-pages.xml
new file mode 100644
index 00000000..8b964163
--- /dev/null
+++ b/app/src/main/res/values-nl/html-pages.xml
@@ -0,0 +1,56 @@
+
+
+
+ A Photo Manager
+
+
+Beheer van lokale foto's: vinden/kopieren/Exif-bewerken en weergave in galerij of op kaart. Beschikt over
+
+
+Snelzoeken foto's door labels(keywords), (sub-) map, geo-, titel, datum...
+ Resultaat weergeven in de galerij of landkaarten van OpenStreetMap.
+ Detail weergave functies zoomen, jatten voor volgende/vorige beeld.
+ Ingebouwd bestandsbheer voor foto's: zoeken, sorteren, weergeven, kopiëren, verwijderen, delen,....
+ Exif-metadata bewerken: datum, titel, beschrijving, labels(keywords), geo, rating,...
+ Optionele map-regel gebaseerde autoprocessing: foto's worden automatisch gewijzigd en krijgen geo, labels, titel,... als je kopieert/verplaatst
+ Markeer beelden als 'Particulier' om ze te verbergen voor andere Galerij-Apps en andere foto-apps.
+ In 'bescherme/vastgepinde modus' worden potentieel gevaarlijke app-opdrachten als bewerken/kopieren/verwijderen/delen/instellingen/ 'afbeelding wijzigen' uitgeschakeld, zodat je veilig je telefoon uit handen kunt geven
+ Kan grote beeldcollecties (20000 + beelden in 1000 + omslagen) hanteren.
+ Maakt gebruik van Androids afbeeldinginhoud-provider. Geen eerste afbeelding scan nodig.
+ Uitgebreide mediascanner voor Exif, IPTC, XMP
+
+
+
+Vereiste Android machtigingen:
+
+
+INTERNET: om kaartgegevens te downloaden van Open Streetmap Server
+ ACCESS_NETWORK_STATE en ACCESS_WIFI_STATE: controleren of wifi/internet on line is voor start download geodata
+ WRITE_EXTERNAL_STORAGE voor cache voor gedownloade kaartgegevens in lokale bestandssysteem en voor foto behandeling
+ READ_LOGS voor lezen en opslaan mogelijke crash-logs in een tekstbestand.
+
+
+
+"]]>
+
diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml
index 2f2a9263..885f3033 100644
--- a/app/src/main/res/values-nl/strings.xml
+++ b/app/src/main/res/values-nl/strings.xml
@@ -2,7 +2,7 @@
- Over \"A Photo Manager%1$s\"
- Selecteer gebied op de kaart
- Achtergrond
- Bladwijzer %1$s verwijderd.
- Kan bladwizer %1$s niet verwijderen.
- Deze bladwijzer verwijderen?
- Gegenereerd op %3$s met \'%1$s\' versie %2$s. Meer informatie op https://github.com/k3b/AndroFotoFinder/wiki/intentap#sql
- Bladwijzer laden uit …
- Bladwijzer opslaan als …
- Aanpassen
- Pauzeren
- %1$d van %2$d bestanden gekopieerd
- Verwijderen
- "Weet u zeker dat u deze bestanden definitief wilt verwijderen?
+ Over \"A Photo Manager%1$s\"
+ Selecteer gebied op de kaart
+ Achtergrond
+ Album
+ Virtueel Album %1$s verwijderd.
+ Kan Virtueel Album %1$s niet verwijderen.
+ Dit Virtueel Albumverwijderen?
+ Gegenereerd op %3$s met \'%1$s\' versie %2$s. Meer informatie op https://github.com/k3b/AndroFotoFinder/wiki/intentapi#sql
+ Virtueel Album opslaan als …
+ Wijzigen
+ Pauze
+ %1$d van %2$d bestanden gekopieerd
+ Verwijderen
+ "Weet je zeker dat je deze bestanden definitief wilt verwijderen?
%1$s
Dit kan niet ongedaan gemaakt worden."
- Foto(\'s) verwijderen?
- %1$d van %2$d bestanden verwijderd
- Kopieer naar
- Verplaats naar
- Details
- Kies een fotobewerker
- Geen app voor fotobewerking gevonden
- Bewerken
- \'%1$s\' is beveiligd tegen schrijven.\n\n \'%2$s\' is niet mogelijk.
- \'%1$s\' is geen geldige datum.
- \'%1$s\' is geen geldige coördinaat.
- Filter
- Selecteer %1$s
- Laden van de map %1$s mislukt
- Map filter
- Foto\'s
- Op de kaart weergeven
- Weergeven in externe geolocatie-browser
- Geolocatie instellen
- Geolocatie aanpassen voor geselecteerde foto\'s
- Geen geolocatie-kiezer gevonden
- Nieuwe geolocatie kiezen voor foto
- SQL fout \'%1$s\'\n\n%2$s
- Ongeldige SQL. Standaardwaarde wordt herladen
- Systeemfout. App wordt afgesloten
- Het bestand \'%1$s\' bestaat al.\nWeet u zeker dat u het wilt overschrijven?
- Kan \'%1$s\' niet hernoemen.
- Geen foto\'s gevonden voor %1$s.
- Foto in media database (%1$s) nog niet gevonden. %2$d nieuwe bestanden worden gescand. De ontbrekende foto zal binnenkort beschikbaar zijn.
- "Laden (%1$d) …"
- %1$d foto\'s geüpdatet.
- Datum
- Breedtegraad
- Lengtegraad
- Map
- Zonder geolocatie
- nieuwe_map
- Map aanmaken
- Kan %1$s niet maken
- %1$s aangemaakt
- Meer…
- Verplaatsen
- %1$d van %2$d bestanden verplaatst
- Kaarttegels © OpenStreetMap
- Overschrijven?
- Hernoemen
- %1$d van %2$d bestanden hernoemd
- Waar te beginnen met scannen?
- Kan geen foto\'s verwerken zolang de Android Media Scanner bezig is. Probeer het later nog een keer.
- Media-scanner
- %1$d items in de media-database geüpdatet
- %1$d geselecteerd
- Kies een map met foto\'s
- Alleen geselecteerde
- Selectie: alle zichtbare toevoegen
- Selectie: alle zichtbare verwijderen
- Locatie van bladwijzers
- Foutrapportages
- … met uitgevoerde SQL.
- … met item-informatie van grid/lijsten
- LogCat geheugengebruik
- LocCat jpg/xmp metadata lezen/schrijven
- … of 3rd party libraries.
- LogCat overig
- … met overige logberichten.
- LogCat legen
- LogCat opslaan
- Locatie van logbestand
- Menubalk automatisch verbergen na (miliseconden)
- Hogere kwaliteit miniaturen (langzamer, meer geheugengebruik)
- Verbeter kwaliteit miniaturen
- Interval slideshow (miliseconden)
- Taal
- Systeemstandaard
- Maximum aantal markers op de kaart
- Aantal onthouden geolocaties
- Bestand voor geschiedenis geolocaties instellen
- Alle items deselecteren
- … na kopiëren, verplaatsen, hernoemen, enz.
- Instellingen
- Geen app gevonden voor delen/verzenden
- Teveel items geselecteerd om tegelijk te kunnen verzenden
- Delen/Versturen
- In nieuwe gallerij
- Slideshow
- Datum
- Map
- Naam
- Lengte bestandslocatie
- Niet gesorteerd
- Locatie
- Sorteren
- %1$d/%2$d bestanden geüpdatet
- Zoom to fit
- Show thumbnail for big images
- Laat de miniatuur zien als de afbeelding breder of hoger is dan deze waarde. Dit is sneller, maar leidt tot lagere kwaliteit weergaven.
- Locatie voor voorbeeldweergaven
- Gebruik Mapsforge offline kaart
- ... die handmatig via een pc is gedownload
- Mapsforge offline map
- Toon foto(\'s)
- Repair duplicates
- Kies Geo van de foto
- Kies Geo van de kaart
- Afbeeldingen verbergen
- Dit maakt alle media bestanden (foto\'s, video, audio) onder
+ Foto(\'s) verwijderen?
+ %1$d van %2$d bestanden verwijderd
+ Kopieer naar
+ Verplaats naar
+ Details
+ Kies een fotobewerker
+ Geen app voor fotobewerking gevonden
+ Bewerken
+ \'%1$s\' is beveiligd tegen schrijven.\n\n \'%2$s\' is niet mogelijk.
+ \'%1$s\' is geen geldige datum.
+ \'%1$s\' is geen geldige coördinaat.
+ Filter
+ Selecteer %1$s
+ Laden van de map %1$s mislukt
+ Map filter
+ Foto\'s
+ Op de kaart weergeven
+ Weergeven in externe geolocatie-browser
+ Geolocatie instellen
+ Geolocatie aanpassen voor geselecteerde foto\'s
+ Geen geolocatie-kiezer gevonden
+ Nieuwe geolocatie kiezen voor foto
+ SQL fout \'%1$s\'\n\n%2$s
+ Ongeldige SQL. Standaardwaarde wordt herladen
+ Systeemfout. App wordt afgesloten
+ Het bestand \'%1$s\' bestaat al.\nWeet u zeker dat u het wilt overschrijven?
+ Kan \'%1$s\' niet hernoemen.
+ Geen foto\'s gevonden voor %1$s.
+ Foto in media database (%1$s) nog niet gevonden. %2$d nieuwe bestanden worden gescand. De ontbrekende foto zal binnenkort beschikbaar zijn.
+ "Laden (%1$d) …"
+ %1$d foto\'s geüpdatet.
+ Datum
+ Breedtegraad
+ Lengtegraad
+ Map
+ Zonder geolocatie
+ nieuwe_map
+ Map aanmaken
+ Kan %1$s niet maken
+ %1$s aangemaakt
+ Meer…
+ Verplaatsen
+ %1$d van %2$d bestanden verplaatst
+ Kaarttegels © OpenStreetMap
+ Overschrijven?
+ Hernoemen
+ %1$d van %2$d bestanden hernoemd
+ Waar te beginnen met scannen?
+ Kan geen foto\'s verwerken zolang de Android Media Scanner bezig is. Probeer het later nog een keer.
+ Media-scanner
+ %1$d items in de media-database bijgewerkt
+ %1$d geselecteerd
+ Kies een map met foto\'s
+ Alleen geselecteerde
+ Selectie: alle zichtbare toevoegen
+ Selectie: alle zichtbare verwijderen
+ Diagnostische gegevens
+ … met uitgevoerde SQL.
+ … met item-informatie van grid/lijsten
+ LogCat geheugengebruik
+ LogCat JPG/XMP-metadata lezen/schrijven
+ … of 3rd party libraries.
+ LogCat overig
+ … met overige logberichten.
+ LogCat legen
+ LogCat opslaan
+ Locatie van logbestand
+ Menubalk verbergen na (milliseconden)
+ Voorbeeld foto in betere kwaliteit (traag, meer geheugen nodig)
+ Verbeter kwaliteit voorbeelden
+ Interval diashow in milliseconden
+ Taal
+ Systeemstandaard
+ Max. geselecteerde markeringen op kaart
+ Aantal onthouden geolocaties
+ Bestand voor geschiedenis geolocaties instellen
+ Alle items deselecteren
+ … na kopiëren, verplaatsen, hernoemen, enz.
+ Instellingen
+ Geen provider voor delen/verzenden gevonden
+ Te veel items om in één keer te delen geselecteerd
+ Delen/verzenden
+ In nieuwe galerij weergeven
+ Diavoorstelling
+ Datum
+ Map
+ Naam
+ Lengte bestandslocatie
+ Niet gesorteerd
+ Locatie
+ Sorteren
+ %1$d/%2$d bestanden bijgewerkt
+ Zoom om te passen
+ Voorbeeld voor grote afbeeldingen weergeven
+ Voorbeeld weergeven in de detailweergave als breedte of hoogte groter dan deze waarde (pixels) is. Geheugen efficiënt, snel, maar lage kwaliteit.
+ Map voor voorbeeldweergaven
+ Gebruik Mapsforge offline kaart
+ ... die je zelf downloadt via PC
+ Mapsforge offline map
+ Toon foto(\'s)
+ Reparatie duplicaten
+ Kies Geo van de foto
+ Geo uit de kaart kiezen
+ Afbeeldingen verbergen
+ Dit maakt alle media bestanden (foto\'s, video, audio) onder
%1$s
onzichtbaar voor de media-database, de galerij apps en de media-scanner. De bestanden worden weer zichtbaar door de mediascanner in het galerij-menu te gebruiken.
- Part of Folder or Filename. %=Wildcard
- Zoek
- Part of Tags, Title, Description or Path
- Public Image
- Privé foto\'s
- Zonder tags
- +Tags
- -Tags
- Tag
- Tag filter
- Type here to filter ...
- No matching tags found
- Set Tags
- Create new Tag
- new_tag
- Delete children
- Update tags van de betreffende foto\'s
- Long-Tap on tagname opens menu
- Activities,People,Places,Themes,Projects
- Bewaar veranderingen in
- jpg and xmp (Create if not found)
- jpg (en xmp als die er is)
- alleen jpg bestand
- alleen xmp bestand
- Long Xmp Sidecar File Name?
- Long: file.jpg.xmp; Short: file.xmp
-
- Load Context ...
-
- Bewerk Exif
- Naam
- Beschrijving
- Beoordeling
-
- Beoordeling
- Laatst bewerkt
-
+ Een deel van de map of bestandsnaam. % = joker
+ Zoek
+ In labels, titel, beschrijving of pad
+ Publiek beeld
+ Privé foto\'s
+ Zonder labels
+ +Labels
+ -Labels
+ Label
+ Label Filter
+ Type hier om te filteren...
+ Geen passende labels gevonden
+ Labels toewijzen
+ Nieuw label maken
+ standaardlabel
+ Sublabels verwijderen
+ Werk labels bij van de betreffende foto\'s
+ Lange-klik op label opent menu
+ Activiteiten, Mensen, Plaatsen, Thema\'s, Projecten
+ Bewaar veranderingen in
+ JPG en XMP (maken als niet gevonden)
+ JPG (en XMP als die bestaat)
+ alleen JPG-bestand
+ alleen XMP-bestand
+ Lange XMP-bestandsnaam (met metdata) ?
+ Lang: file.JPG.XMP - Kort: file.XMP
+
+ Context toevoegen...
+
+ Bewerk Exif
+ Titel
+ Beschrijving
+ Beoordeling
+
+ Beoordeling
+ Laatst bewerkt
+
+ Autoprocessing foto inregelen
+ Bestandsnaam patroon
+ Exif
+
+ "%1$s %2$d Fotos\n\t%3$s (%4$s),... \nNaar %5$s\n\t%6$s"
+
+ Grootte
+ Breedte
+
+ Zichtbaarheid
+
+ App beschermd/vastgemaakt
+ App niet beschermd/losgemaakt
+
+ Wijzig de naam van particuliere *.JPG in *.JPG-P
+ Wissen
+ Open in bestandsbeheer
+
+ Zoekbalk
+ Datumkiezer: gebruik [ jjjj ] jaren
+ Dus gebruik 2010, 2011,... 2019 vanaf 2010 *
+ Datumfilter
+
+ Bewerken van Virtuele Album
+
+ Map voor bladwijzers
diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml
index 338c5b44..da64098c 100644
--- a/app/src/main/res/values/donottranslate.xml
+++ b/app/src/main/res/values/donottranslate.xml
@@ -48,7 +48,7 @@ this program. If not, see
id ,
it ,
ja ,
- nl, pl,
+ nl , pl,
ro
, ru,
tr ,
diff --git a/fastlane/metadata/android/en-US/changelogs/41.txt b/fastlane/metadata/android/en-US/changelogs/41.txt
index f4d9fe79..ea80ff52 100644
--- a/fastlane/metadata/android/en-US/changelogs/41.txt
+++ b/fastlane/metadata/android/en-US/changelogs/41.txt
@@ -2,3 +2,4 @@ Changes from 0.7.2 to 0.7.3
* #132 improved Autoprocessing-Editor: Long press on Exif-Picker butten "..." : get lat/lon/description/tags from selected photos
* #133: Additional filtercriteria date-last-modified from ... to
+* #21: Translation updates ja, nl
diff --git a/fastlane/metadata/android/nl-NL/full_description.txt b/fastlane/metadata/android/nl-NL/full_description.txt
new file mode 100644
index 00000000..75dd4647
--- /dev/null
+++ b/fastlane/metadata/android/nl-NL/full_description.txt
@@ -0,0 +1,21 @@
+Beheer van lokale foto's: vinden/kopieren/Exif-bewerken en weergave in galerij of op kaart. Beschikt over:
+
+* Snelzoeken foto's door labels(keywords), (sub-) map, geo-, titel, datum...
+* Resultaat weergeven in de galerij of landkaarten van OpenStreetMap.
+* Detail weergave functies zoomen, jatten voor volgende/vorige beeld.
+* Ingebouwd bestandsbheer voor foto's: zoeken, sorteren, weergeven, kopiëren, verwijderen, delen,....
+* Exif-metadata bewerken: datum, titel, beschrijving, labels(keywords), geo, rating,...
+* Optionele map-regel gebaseerde autoprocessing: foto's worden automatisch gewijzigd en krijgen geo, labels, titel,... als je kopieert/verplaatst
+* Markeer beelden als 'Particulier' om ze te verbergen voor andere Galerij-Apps en andere foto-apps.
+* In "bescherme/vastgepinde modus" worden potentieel gevaarlijke app-opdrachten als bewerken/kopieren/verwijderen/delen/instellingen/ "afbeelding wijzigen" uitgeschakeld, zodat je veilig je telefoon uit handen kunt geven
+* Kan grote beeldcollecties (20000 + beelden in 1000 + omslagen) hanteren.
+* Maakt gebruik van Androids afbeeldinginhoud-provider. Geen eerste afbeelding scan nodig.
+* Uitgebreide mediascanner voor Exif, IPTC, XMP
+
+Vereiste Android machtigingen:
+
+* INTERNET: om kaartgegevens te downloaden van Open Streetmap Server
+* ACCESS_NETWORK_STATE en ACCESS_WIFI_STATE: controleren of wifi/internet on line is voor start download geodata
+* WRITE_EXTERNAL_STORAGE voor cache voor gedownloade kaartgegevens in lokale bestandssysteem en voor foto behandeling
+* READ_LOGS voor lezen en opslaan mogelijke crash-logs in een tekstbestand.
+.
diff --git a/fastlane/metadata/android/nl-NL/short_description.txt b/fastlane/metadata/android/nl-NL/short_description.txt
new file mode 100644
index 00000000..58bf537c
--- /dev/null
+++ b/fastlane/metadata/android/nl-NL/short_description.txt
@@ -0,0 +1 @@
+Lokale foto's beheren: vinden/kopieren/Exif bewerken en weergeven in galerij of op kaart.
\ No newline at end of file
diff --git a/fastlane/metadata/android/nl-NL/title.txt b/fastlane/metadata/android/nl-NL/title.txt
new file mode 100644
index 00000000..c024594a
--- /dev/null
+++ b/fastlane/metadata/android/nl-NL/title.txt
@@ -0,0 +1 @@
+A Photo Manager (Een foto beheerder)
\ No newline at end of file
From 5a77dbc21d12a2c2564b9f3b017caf89fb246d86 Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Sun, 23 Dec 2018 08:14:04 +0100
Subject: [PATCH 15/35] Upgrade to
com.github.k3b.ToGoZip:libK3bZip:v2.0.18.181224
---
app/build.gradle | 4 +--
fotolib2/build.gradle | 4 +--
.../main/java/de/k3b/zip/LibZipGlobal.java | 35 -------------------
3 files changed, 4 insertions(+), 39 deletions(-)
delete mode 100644 fotolib2/src/main/java/de/k3b/zip/LibZipGlobal.java
diff --git a/app/build.gradle b/app/build.gradle
index 0e55302f..f3df5606 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -88,7 +88,7 @@ android {
// task from https://stackoverflow.com/questions/45848521/how-to-sync-android-project-by-gradle-task/45856729#45856729
import java.util.regex.Pattern
-task('increaseVersionCode') << {
+task('increaseVersionCode').doLast({
def buildFile = file("build.gradle")
def pattern = Pattern.compile("versionCode\\s+(\\d+)")
def manifestText = buildFile.getText()
@@ -97,7 +97,7 @@ task('increaseVersionCode') << {
def versionCode = Integer.parseInt(matcher.group(1))
def manifestContent = matcher.replaceAll("versionCode " + ++versionCode)
buildFile.write(manifestContent)
-}
+})
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
diff --git a/fotolib2/build.gradle b/fotolib2/build.gradle
index f5051ab3..f7b11ec8 100644
--- a/fotolib2/build.gradle
+++ b/fotolib2/build.gradle
@@ -26,8 +26,8 @@ dependencies {
// https://jitpack.io/com/github/k3b/ToGoZip/L2.0.15/build.log
// https://jitpack.io/com/github/k3b/ToGoZip/libK3bZip/L2.0.15/
- implementation('com.github.k3b.ToGoZip:libK3bZip:L2.0.15') { transitive = false; }
-
+ // implementation('com.github.k3b.ToGoZip:libK3bZip:L2.0.15') { transitive = false; }
+ implementation('com.github.k3b.ToGoZip:libK3bZip:v2.0.18.181224') { transitive = false; }
}
// workaround because android-studio does not make the test resources available
diff --git a/fotolib2/src/main/java/de/k3b/zip/LibZipGlobal.java b/fotolib2/src/main/java/de/k3b/zip/LibZipGlobal.java
deleted file mode 100644
index ca16687e..00000000
--- a/fotolib2/src/main/java/de/k3b/zip/LibZipGlobal.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2018-2019 by k3b.
- *
- * This file is part of #toGoZip (https://github.com/k3b/ToGoZip/).
- *
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program. If not, see
- */
-
-package de.k3b.zip;
-
-/**
- * Public Global stuff for the zip specific parts of the lib.
- *
- * Created by k3b on 2018-12-14.
- */
-public class LibZipGlobal {
- /** LOG_CONTEXT is used as logging source for filtering logging messages that belong to this */
- public static final String LOG_TAG = "k3b.zip";
-
- /**
- * Global.xxxxx. Non final values may be changed from outside (SettingsActivity or commandline parameter)
- */
- public static boolean debugEnabled = false;
-}
From 839b42c58504a89a8cae8c293b854aa562c7e9f0 Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Tue, 15 Jan 2019 22:16:01 +0100
Subject: [PATCH 16/35] #108: Zip-file export/backup: save as .zip.apm.config
in folder
---
.gitignore | 1 +
app/src/main/AndroidManifest.xml | 32 +-
.../androFotoFinder/AndroFotoFinderApp.java | 2 +
.../androFotoFinder/BackupActivity.java | 281 ++++++++++++++++--
.../androFotoFinder/SettingsActivity.java | 2 +
.../k3b/android/widget/HistoryEditText.java | 13 +-
app/src/main/res/layout/activity_backup.xml | 26 +-
fotolib2/src/main/java/de/k3b/LibGlobal.java | 5 +
.../java/de/k3b/zip/ZipConfigRepository.java | 51 ++++
9 files changed, 362 insertions(+), 51 deletions(-)
diff --git a/.gitignore b/.gitignore
index dfa2074d..c3639db8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,3 +32,4 @@ build
/fotolib2/src/test/resources/de/k3b/media/old
/app/build-with-sign.gradle
/todo
+/clipboard.txt
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index b99fa630..c37c121a 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -79,8 +79,7 @@
android:largeHeap="true"
android:theme="@style/AppTheme"
>
-
@@ -138,8 +137,7 @@
-
@@ -200,8 +198,7 @@
-
-
@@ -238,7 +234,8 @@
-
+
@@ -254,8 +251,7 @@
-
@@ -270,16 +266,14 @@
-
+
-
-
@@ -455,11 +449,9 @@
-
-
0) {
- if ((mustLoadIDs) && (ids == null)) {
- ids = new Long[itemCount];
- Map idMap = FotoSql.execGetPathIdMap(this, fileNames);
+ if (itemCount > 0) {
+ if ((mustLoadIDs) && (ids == null)) {
+ ids = new Long[itemCount];
+ Map idMap = FotoSql.execGetPathIdMap(this, fileNames);
- for (int i = 0; i < itemCount; i++) {
- ids[i] = idMap.get(fileNames[i]);
+ for (int i = 0; i < itemCount; i++) {
+ ids[i] = idMap.get(fileNames[i]);
+ }
}
- }
+ }
+ result = new SelectedFiles(fileNames,
+ ids, null);
}
- result = new SelectedFiles(fileNames,
- ids, null);
}
if (Global.debugEnabled && (intent != null)) {
@@ -298,6 +500,12 @@ public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
switch (id) {
+ case R.id.cmd_ok:
+ onOk();
+ return true;
+ case R.id.cmd_clear:
+ clearFilter();
+ return true;
case R.id.cmd_cancel:
setResult(Activity.RESULT_CANCELED, null);
finish();
@@ -320,5 +528,30 @@ protected void onResume() {
super.onResume();
}
+ private void clearFilter() {
+ mFilter = new ZipConfigDto(null);
+ loadGuiFromData();
+ }
+
+ /** save exif changes back to image and database */
+ private boolean onOk() {
+ boolean ok = false;
+ Activity ctx = this;
+ saveGuiToData();
+ gui.mHistory.saveHistory();
+ ZipConfigRepository repo = new ZipConfigRepository(mFilter);
+ final File zipConfigFile = repo.getZipConfigFile();
+ if (zipConfigFile != null) {
+ ok = repo.save();
+ if (Global.debugEnabled) {
+ Log.d(Global.LOG_CONTEXT, mDebugPrefix + " Saved as " + zipConfigFile);
+ }
+ Toast.makeText(BackupActivity.this, zipConfigFile.toString(), Toast.LENGTH_LONG).show();
+
+ finish();
+ }
+ return ok;
+ }
+
}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java
index 2ebc125e..cb49f2dd 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java
@@ -247,6 +247,7 @@ public static void prefs2Global(Context context) {
Global.pickHistoryMax = getPref(prefs, "pickHistoryMax" , Global.pickHistoryMax);
Global.reportDir = getPref(prefs, "reportDir", Global.reportDir);
+ LibGlobal.zipFileDir = Global.reportDir;
Global.logCatDir = getPref(prefs, "logCatDir", Global.logCatDir);
@@ -318,6 +319,7 @@ private static void fixDefaults(Context context, File previousCacheRoot, File pr
ThumbNailUtils.init(context, previousCacheRoot);
}
TagRepository.setInstance(Global.reportDir);
+ LibGlobal.zipFileDir = Global.reportDir;
// true if first run or change
if ((sOldEnableNonStandardIptcMediaScanner == null) || (sOldEnableNonStandardIptcMediaScanner.booleanValue() != Global.Media.enableIptcMediaScanner)) {
diff --git a/app/src/main/java/de/k3b/android/widget/HistoryEditText.java b/app/src/main/java/de/k3b/android/widget/HistoryEditText.java
index 289ad0f9..294e3bee 100644
--- a/app/src/main/java/de/k3b/android/widget/HistoryEditText.java
+++ b/app/src/main/java/de/k3b/android/widget/HistoryEditText.java
@@ -52,7 +52,7 @@ public class HistoryEditText {
private final Context mContext;
private final String mDelimiter;
private final int mMaxHisotrySize;
- private final EditorHandler[] mEditorHandlers;
+ protected final EditorHandler[] mEditorHandlers;
/** ContextActionBar for one EditText */
protected class EditorHandler implements View.OnLongClickListener, View.OnClickListener {
@@ -99,9 +99,7 @@ protected void showHistory() {
public boolean onMenuItemClick(MenuItem item) {
// String text = item.getTitle();
String text = getHistoryItems().get(item.getItemId() - 10);
- mEditor.setText(text);
- mEditor.setSelection(0, mEditor.length());
- return true;
+ return onHistoryPick(EditorHandler.this, mEditor, text);
}
});
popup.show();
@@ -221,4 +219,11 @@ public String toString() {
}
return result.toString();
}
+
+ protected boolean onHistoryPick(EditorHandler editorHandler, EditText editText, String text) {
+ editText.setText(text);
+ editText.setSelection(0, editText.length());
+ return true;
+ }
+
}
diff --git a/app/src/main/res/layout/activity_backup.xml b/app/src/main/res/layout/activity_backup.xml
index 2edab2b5..8cc7b288 100644
--- a/app/src/main/res/layout/activity_backup.xml
+++ b/app/src/main/res/layout/activity_backup.xml
@@ -1,7 +1,7 @@
Date: Tue, 22 Jan 2019 22:01:15 +0100
Subject: [PATCH 17/35] Bugfix infer DateTimeTaken from TAG_DATETIME if not
available in TAG_DATETIME_ORIGINAL
---
fotolib2/src/main/java/de/k3b/media/ExifInterfaceEx.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fotolib2/src/main/java/de/k3b/media/ExifInterfaceEx.java b/fotolib2/src/main/java/de/k3b/media/ExifInterfaceEx.java
index 03f5f8e1..d95de902 100644
--- a/fotolib2/src/main/java/de/k3b/media/ExifInterfaceEx.java
+++ b/fotolib2/src/main/java/de/k3b/media/ExifInterfaceEx.java
@@ -158,7 +158,7 @@ public Date getDateTimeTaken(){
Date result = null;
if (isEmpty(result, ++i, debugContext, "Exif.DATETIME_ORIGINAL")) result = getAttributeDate(ExifInterfaceEx.TAG_DATETIME_ORIGINAL);
- if (isEmpty(result, ++i, debugContext, "Exif.DATETIME")) getAttributeDate(ExifInterfaceEx.TAG_DATETIME);
+ if (isEmpty(result, ++i, debugContext, "Exif.DATETIME")) result = getAttributeDate(ExifInterfaceEx.TAG_DATETIME);
if ((isEmpty(result, ++i, debugContext, "xmp.DateTimeTaken")) && (xmpExtern != null)) result = xmpExtern.getDateTimeTaken();
isEmpty(result, ++i, null, null);
return result;
From f9fc29bcbcb50631f92cc15a4d31324c67a205a7 Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Wed, 23 Jan 2019 01:13:12 +0100
Subject: [PATCH 18/35] #108: Zip-file export/backup: added filter support to
gui
---
.../androFotoFinder/BackupActivity.java | 87 +++++++++++++++++--
.../androFotoFinder/ExifEditActivity.java | 4 +-
app/src/main/res/layout/activity_backup.xml | 1 +
.../java/de/k3b/database/QueryParameter.java | 4 +
.../de/k3b/io/PhotoAutoprocessingDto.java | 13 +--
.../main/java/de/k3b/media/MediaAsString.java | 8 ++
6 files changed, 103 insertions(+), 14 deletions(-)
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/BackupActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/BackupActivity.java
index 00edac78..bf163859 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/BackupActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/BackupActivity.java
@@ -40,6 +40,7 @@
import java.io.File;
import java.io.InputStream;
+import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
@@ -48,6 +49,7 @@
import de.k3b.android.androFotoFinder.directory.DirectoryPickerFragment;
import de.k3b.android.androFotoFinder.queries.AndroidAlbumUtils;
import de.k3b.android.androFotoFinder.queries.FotoSql;
+import de.k3b.android.androFotoFinder.tagDB.TagSql;
import de.k3b.android.util.AndroidFileCommands;
import de.k3b.android.util.IntentUtil;
import de.k3b.android.util.OsUtils;
@@ -55,11 +57,14 @@
import de.k3b.android.widget.ActivityWithAutoCloseDialogs;
import de.k3b.android.widget.HistoryEditText;
import de.k3b.database.QueryParameter;
+import de.k3b.io.GalleryFilterParameter;
import de.k3b.io.IDirectory;
import de.k3b.io.IGalleryFilter;
import de.k3b.io.StringUtils;
import de.k3b.io.collections.SelectedFiles;
import de.k3b.io.DateUtil;
+import de.k3b.media.IMetaApi;
+import de.k3b.media.MediaAsString;
import de.k3b.media.MediaUtil;
import de.k3b.zip.IZipConfig;
import de.k3b.zip.ZipConfigDto;
@@ -71,6 +76,7 @@
public class BackupActivity extends ActivityWithAutoCloseDialogs implements Common {
public static final int REQUEST_BACKUP_ID = 99289;
+ public static final int REQUEST_ID_PICK_EXIF = 99293;
private static final String STATE_ZIP_CONFIG = "zip_config";
private static String mDebugPrefix = "BackupActivity: ";
@@ -105,9 +111,12 @@ public static void showActivity(String debugContext, Activity context,
}
if (mergedQuery != null) {
- config.setFilter(mergedQuery.toReParseableString());
+ config.setFilter(mergedQuery.toReParseableString(null));
}
+ if (config != null) {
+ intent.putExtra(STATE_ZIP_CONFIG, (Serializable) config);
+ }
if (Global.debugEnabled) {
Log.d(Global.LOG_CONTEXT, mDebugPrefix + context.getClass().getSimpleName()
+ " > BackupActivity.showActivity " + intent.toUri(Intent.URI_INTENT_SCHEME));
@@ -162,6 +171,7 @@ private static ZipConfigRepository loadZipConfig(Uri uri, Activity context) {
}
private class Gui implements IZipConfig {
+ private static final String FILTER_DELIMITER = "\n\n\n\n@--!@--!@--!\n\n\n\n";
private final EditText editDateModifiedFrom;
private final EditText editZipRelPath;
private final EditText editZipName;
@@ -230,10 +240,17 @@ private boolean fromGui(IZipConfig dest) {
@Override
public String getZipDir() {return editZipDir.getText().toString();}
@Override
- public String getFilter() {return editFilter.getText().toString();}
+ public String getFilter() {
+ // display-text = filter-display-Text + FILTER_DELIMITER + sql
+ // return sql-part only
+ final String fullText = editFilter.getText().toString();
+ int delim = fullText.indexOf(FILTER_DELIMITER);
+ if (delim >= 0) return fullText.substring(delim + FILTER_DELIMITER.length());
+ return fullText;
+ }
@Override
- public void setDateModifiedFrom(Date value) {editDateModifiedFrom.setText(DateUtil.toIsoDateString(value));}
+ public void setDateModifiedFrom(Date value) {editDateModifiedFrom.setText(DateUtil.toIsoDateTimeString(value));}
@Override
public void setZipRelPath(String value) {editZipRelPath.setText(value);}
@Override
@@ -241,7 +258,20 @@ private boolean fromGui(IZipConfig dest) {
@Override
public void setZipDir(String value) {editZipDir.setText(value);}
@Override
- public void setFilter(String value) {editFilter.setText(value);}
+ public void setFilter(String value) {
+ editFilter.setText(getFilterDisplayText(value));
+ }
+
+ private String getFilterDisplayText(String value) {
+ QueryParameter q = (value == null) ? null : QueryParameter.parse(value);
+ if (q != null) {
+ IGalleryFilter filter = TagSql.parseQueryEx(q, true);
+
+ // display-text = filter-display-Text + FILTER_DELIMITER + sql
+ return filter + FILTER_DELIMITER + value;
+ }
+ return "";
+ }
}
private ZipConfigDto mFilter = new ZipConfigDto(null);
@@ -274,8 +304,7 @@ protected void onCreate(Bundle savedInstanceState) {
if (savedInstanceState != null) {
mFilter.loadFrom((IZipConfig) savedInstanceState.getSerializable(STATE_ZIP_CONFIG));
} else {
- // intent.
-
+ mFilter.loadFrom((IZipConfig) intent.getSerializableExtra(STATE_ZIP_CONFIG));
}
loadGuiFromData();
}
@@ -321,6 +350,52 @@ public void onClick(View v) {
}
});
+ cmd = (Button) findViewById(R.id.cmd_filter);
+ cmd.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ onClickPickExif();
+ }
+ });
+ }
+
+ /**
+ * Call back from sub-activities.
+ * Process Change StartTime (longpress start), Select StopTime before stop
+ * (longpress stop) or filter change for detailReport
+ */
+ @Override
+ protected void onActivityResult(final int requestCode,
+ final int resultCode, final Intent intent) {
+ super.onActivityResult(requestCode, resultCode, intent);
+
+ switch (requestCode) {
+ case REQUEST_ID_PICK_EXIF:
+ if (resultCode != 0) {
+ QueryParameter q = AndroidAlbumUtils.getQuery(this, "",
+ null, intent, null,
+ null, null);
+ onExifChanged((q != null) ? q.toReParseableString(null) : null);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ private void onClickPickExif() {
+ saveGuiToData();
+ QueryParameter filter = QueryParameter.parse(mFilter.getFilter());
+ GalleryFilterActivity.showActivity("[20]", BackupActivity.this,
+ null, filter, null, REQUEST_ID_PICK_EXIF);
+ }
+
+ /**
+ * exif editor result
+ */
+ private void onExifChanged(String modifiedQuery) {
+ mFilter.setFilter((modifiedQuery != null) ? modifiedQuery : "");
+ loadGuiFromData();
}
private final DateTimeApi mDateTimeApi = new DateTimeApi();
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/ExifEditActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/ExifEditActivity.java
index 9c4eb353..67dd5742 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/ExifEditActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/ExifEditActivity.java
@@ -145,9 +145,7 @@ public static void showActivity(String debugContext, Activity context, IMetaApi
intent.setAction(Intent.ACTION_EDIT);
if (exifDataToEdit != null) {
- final String exifAsString = (exifDataToEdit instanceof MediaAsString)
- ? exifDataToEdit.toString()
- : new MediaAsString().setData(exifDataToEdit).toString();
+ final String exifAsString = MediaAsString.toString(exifDataToEdit);
intent.putExtra(EXTRA_EXIF_DATA, exifAsString);
} else if (!saveChangesToUri) {
// special edit exif via intent without initial value
diff --git a/app/src/main/res/layout/activity_backup.xml b/app/src/main/res/layout/activity_backup.xml
index 8cc7b288..05a5710f 100644
--- a/app/src/main/res/layout/activity_backup.xml
+++ b/app/src/main/res/layout/activity_backup.xml
@@ -290,6 +290,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/edit_date_modified_from"
+ android:enabled="false"
android:layout_alignBottom="@+id/cmd_filter"
android:layout_toEndOf="@+id/lbl_zip_dir"
android:layout_toLeftOf="@+id/cmd_zip_dir_history"
diff --git a/fotolib2/src/main/java/de/k3b/database/QueryParameter.java b/fotolib2/src/main/java/de/k3b/database/QueryParameter.java
index 5963f9d3..aaf47d58 100644
--- a/fotolib2/src/main/java/de/k3b/database/QueryParameter.java
+++ b/fotolib2/src/main/java/de/k3b/database/QueryParameter.java
@@ -308,6 +308,10 @@ public static QueryParameter load(InputStream input) throws IOException {
}
public String toReParseableString() {
+ return toReParseableString(sFileComment);
+ }
+
+ public String toReParseableString(String sFileComment) {
StringBuilder result = new StringBuilder();
if (sFileComment != null) result.append("# ").append(sFileComment).append("\n");
Helper.append(result, "\nFROM ", mFrom, "", "\n\t", "");
diff --git a/fotolib2/src/main/java/de/k3b/io/PhotoAutoprocessingDto.java b/fotolib2/src/main/java/de/k3b/io/PhotoAutoprocessingDto.java
index 1f1663e5..ce11fe97 100644
--- a/fotolib2/src/main/java/de/k3b/io/PhotoAutoprocessingDto.java
+++ b/fotolib2/src/main/java/de/k3b/io/PhotoAutoprocessingDto.java
@@ -218,15 +218,18 @@ public IMetaApi getMediaDefaults() {
/** exif data that should be applied to every jpg file */
public PhotoAutoprocessingDto setMediaDefaults(IMetaApi mediaDefaults) {
- String mediaDefaultString = null;
+ String mediaDefaultString = toString(mediaDefaults);
+ setProperty(KEY_EXIF, mediaDefaultString);
+ return this;
+ }
+
+ public static String toString(IMetaApi mediaDefaults) {
if (mediaDefaults != null) {
- mediaDefaultString = (mediaDefaults instanceof MediaAsString)
+ return (mediaDefaults instanceof MediaAsString)
? mediaDefaults.toString()
: new MediaAsString().setData(mediaDefaults).toString();
}
-
- setProperty(KEY_EXIF, mediaDefaultString);
- return this;
+ return null;
}
public boolean isEmpty() {
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaAsString.java b/fotolib2/src/main/java/de/k3b/media/MediaAsString.java
index 5dc9ee48..c101ca4d 100644
--- a/fotolib2/src/main/java/de/k3b/media/MediaAsString.java
+++ b/fotolib2/src/main/java/de/k3b/media/MediaAsString.java
@@ -74,4 +74,12 @@ public MediaAsString setExtra(String title) {
return this;
}
+ public static String toString(IMetaApi mediaDefaults) {
+ if (mediaDefaults != null) {
+ return (mediaDefaults instanceof MediaAsString)
+ ? mediaDefaults.toString()
+ : new MediaAsString().setData(mediaDefaults).toString();
+ }
+ return null;
+ }
}
From ab98f0c1add46ec1d337c12f0a4f4131d9c1f6eb Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Wed, 23 Jan 2019 19:56:15 +0100
Subject: [PATCH 19/35] * #108: Zip-file export/backup fui: load from
config-file. Settings "LogCat zip-file [ ]"
---
app/build.gradle | 5 +++
.../androFotoFinder/BackupActivity.java | 42 ++++++++++++-------
.../androFotoFinder/SettingsActivity.java | 6 ++-
app/src/main/res/values/donottranslate.xml | 10 +++--
app/src/main/res/xml/preferences.xml | 3 ++
5 files changed, 46 insertions(+), 20 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index f3df5606..bb73ed66 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -146,6 +146,11 @@ dependencies {
implementation 'org.slf4j:slf4j-api:1.7.7@jar'
implementation 'eu.lp0.slf4j:slf4j-android:1.7.7-1@jar'
+ // https://jitpack.io/com/github/k3b/ToGoZip/L2.0.15/build.log
+ // https://jitpack.io/com/github/k3b/ToGoZip/libK3bZip/L2.0.15/
+ // implementation('com.github.k3b.ToGoZip:libK3bZip:L2.0.15') { transitive = false; }
+ implementation('com.github.k3b.ToGoZip:libK3bZip:v2.0.18.181224') { transitive = false; }
+
testImplementation 'junit:junit:4.11'
testImplementation 'org.slf4j:slf4j-simple:1.7.7'
}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/BackupActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/BackupActivity.java
index bf163859..3ae06b8d 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/BackupActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/BackupActivity.java
@@ -39,6 +39,7 @@
import android.widget.Toast;
import java.io.File;
+import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.util.Calendar;
@@ -57,21 +58,24 @@
import de.k3b.android.widget.ActivityWithAutoCloseDialogs;
import de.k3b.android.widget.HistoryEditText;
import de.k3b.database.QueryParameter;
-import de.k3b.io.GalleryFilterParameter;
+import de.k3b.io.FileUtils;
import de.k3b.io.IDirectory;
import de.k3b.io.IGalleryFilter;
import de.k3b.io.StringUtils;
import de.k3b.io.collections.SelectedFiles;
import de.k3b.io.DateUtil;
-import de.k3b.media.IMetaApi;
-import de.k3b.media.MediaAsString;
import de.k3b.media.MediaUtil;
import de.k3b.zip.IZipConfig;
+import de.k3b.zip.LibZipGlobal;
import de.k3b.zip.ZipConfigDto;
import de.k3b.zip.ZipConfigRepository;
/**
* #108: Zip-file support: backup-or-copy filtered-or-selected photos to Zip-file
+ *
+ * API
+ * * uri = intent.getData() load file via file-uri
+ * * else intent.Extra[STATE_ZIP_CONFIG]
*/
public class BackupActivity extends ActivityWithAutoCloseDialogs implements Common {
@@ -117,8 +121,8 @@ public static void showActivity(String debugContext, Activity context,
if (config != null) {
intent.putExtra(STATE_ZIP_CONFIG, (Serializable) config);
}
- if (Global.debugEnabled) {
- Log.d(Global.LOG_CONTEXT, mDebugPrefix + context.getClass().getSimpleName()
+ if (LibZipGlobal.debugEnabled) {
+ Log.d(LibZipGlobal.LOG_TAG, mDebugPrefix + context.getClass().getSimpleName()
+ " > BackupActivity.showActivity " + intent.toUri(Intent.URI_INTENT_SCHEME));
}
@@ -156,15 +160,16 @@ private static QueryParameter getQuery(String debugContext, Activity context,
private static ZipConfigRepository loadZipConfig(Uri uri, Activity context) {
if ((uri != null) && ZipConfigRepository.isZipConfig(uri.toString())) {
+ InputStream inputsteam = null;
try {
- InputStream inputsteam = context.getContentResolver().openInputStream(uri);
+ inputsteam = context.getContentResolver().openInputStream(uri);
return new ZipConfigRepository(null).load(inputsteam, uri);
} catch (Exception ex) {
// file not found or no permission
- if (Global.debugEnabled) {
- Log.d(Global.LOG_CONTEXT, mDebugPrefix + context.getClass().getSimpleName()
+ Log.w(LibZipGlobal.LOG_TAG, mDebugPrefix + context.getClass().getSimpleName()
+ "-loadZipConfig(" + uri + ") failed " + ex.getClass().getSimpleName(), ex);
- }
+ } finally {
+ FileUtils.close(inputsteam, uri);
}
}
return null;
@@ -225,7 +230,7 @@ private boolean fromGui(IZipConfig dest) {
ZipConfigDto.copy(dest, this);
return true;
} catch (RuntimeException ex) {
- Log.e(Global.LOG_CONTEXT, mDebugPrefix + ex.getMessage(), ex);
+ Log.e(LibZipGlobal.LOG_TAG, mDebugPrefix + ex.getMessage(), ex);
Toast.makeText(BackupActivity.this, ex.getMessage(), Toast.LENGTH_LONG).show();
return false;
}
@@ -299,12 +304,19 @@ protected void onCreate(Bundle savedInstanceState) {
defineGui();
Intent intent = getIntent();
+
mSelectedFiles = getSelectedFiles("onCreate ", intent, false);
if (savedInstanceState != null) {
mFilter.loadFrom((IZipConfig) savedInstanceState.getSerializable(STATE_ZIP_CONFIG));
} else {
- mFilter.loadFrom((IZipConfig) intent.getSerializableExtra(STATE_ZIP_CONFIG));
+ Uri uri = intent.getData();
+ ZipConfigRepository config = loadZipConfig(uri, this);
+ if (config != null) {
+ mFilter.loadFrom(config);
+ } else {
+ mFilter.loadFrom((IZipConfig) intent.getSerializableExtra(STATE_ZIP_CONFIG));
+ }
}
loadGuiFromData();
}
@@ -549,8 +561,8 @@ private SelectedFiles getSelectedFiles(String dbgContext, Intent intent, boolean
}
}
- if (Global.debugEnabled && (intent != null)) {
- Log.d(Global.LOG_CONTEXT, mDebugPrefix + dbgContext + intent.toUri(Intent.URI_INTENT_SCHEME));
+ if (LibZipGlobal.debugEnabled && (intent != null)) {
+ Log.d(LibZipGlobal.LOG_TAG, mDebugPrefix + dbgContext + intent.toUri(Intent.URI_INTENT_SCHEME));
}
return result;
@@ -618,8 +630,8 @@ private boolean onOk() {
final File zipConfigFile = repo.getZipConfigFile();
if (zipConfigFile != null) {
ok = repo.save();
- if (Global.debugEnabled) {
- Log.d(Global.LOG_CONTEXT, mDebugPrefix + " Saved as " + zipConfigFile);
+ if (LibZipGlobal.debugEnabled) {
+ Log.d(LibZipGlobal.LOG_TAG, mDebugPrefix + " Saved as " + zipConfigFile);
}
Toast.makeText(BackupActivity.this, zipConfigFile.toString(), Toast.LENGTH_LONG).show();
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java
index cb49f2dd..63dc63da 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java
@@ -47,6 +47,7 @@
import de.k3b.android.widget.ActivityWithCallContext;
import de.k3b.android.widget.LocalizedActivity;
import de.k3b.tagDB.TagRepository;
+import de.k3b.zip.LibZipGlobal;
import io.github.lonamiwebs.stringlate.utilities.Api;
import uk.co.senab.photoview.PhotoViewAttacher;
import uk.co.senab.photoview.log.LogManager;
@@ -146,6 +147,7 @@ public static void global2Prefs(Context context) {
prefs.putBoolean("debugEnabledViewItem", Global.debugEnabledViewItem);
prefs.putBoolean("debugEnabledSql", Global.debugEnabledSql);
prefs.putBoolean("debugEnabledMap", Global.debugEnabledMap);
+ prefs.putBoolean("debugEnabledZip", LibZipGlobal.debugEnabled);
prefs.putBoolean("debugEnabledMemory", Global.debugEnabledMemory);
@@ -203,9 +205,11 @@ public static void prefs2Global(Context context) {
Global.debugEnabledMap = getPref(prefs, "debugEnabledMap", Global.debugEnabledMap);
+ LibZipGlobal.debugEnabled = getPref(prefs, "debugEnabledZip", LibZipGlobal.debugEnabled);
+
Global.debugEnabledMemory = getPref(prefs, "debugEnabledMemory", Global.debugEnabledMemory);
- LibGlobal.datePickerUseDecade = getPref(prefs, "datePickerUseDecade", LibGlobal.datePickerUseDecade);
+ LibGlobal.datePickerUseDecade = getPref(prefs, "datePickerUseDecade", LibGlobal.datePickerUseDecade);
Global.locked = getPref(prefs, "locked", Global.locked);
Global.passwordHash = getPref(prefs, "passwordHash", Global.passwordHash);
diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml
index da64098c..88afaa10 100644
--- a/app/src/main/res/values/donottranslate.xml
+++ b/app/src/main/res/values/donottranslate.xml
@@ -28,10 +28,12 @@ this program. If not, see
LogCat SQL
LogCat JPG
LogCat geo map
-
+ LogCat zip-file
+
+
RESET
LogCat gridview/listview
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index 0fe13098..2bd50c0f 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -147,6 +147,9 @@ this program. If not, see
+
Date: Sun, 27 Jan 2019 11:05:10 +0100
Subject: [PATCH 20/35] #108: Zip-file export/backup : moved code to seperate
package and split gui&non-gui into
de.k3b.android.androFotoFinder.backup.BackupActivity & Backup2ZipService
---
app/src/main/AndroidManifest.xml | 2 +-
.../backup/Backup2ZipService.java | 71 +++++++++++++++++++
.../{ => backup}/BackupActivity.java | 50 +++++--------
.../gallery/cursor/GalleryCursorFragment.java | 2 +-
app/src/main/res/layout/activity_backup.xml | 2 +-
5 files changed, 90 insertions(+), 37 deletions(-)
create mode 100644 app/src/main/java/de/k3b/android/androFotoFinder/backup/Backup2ZipService.java
rename app/src/main/java/de/k3b/android/androFotoFinder/{ => backup}/BackupActivity.java (93%)
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index c37c121a..7f17fd57 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -251,7 +251,7 @@
-
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/backup/Backup2ZipService.java b/app/src/main/java/de/k3b/android/androFotoFinder/backup/Backup2ZipService.java
new file mode 100644
index 00000000..aa800ed3
--- /dev/null
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/backup/Backup2ZipService.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2019 by k3b.
+ *
+ * This file is part of AndroFotoFinder / #APhotoManager.
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see
+ */
+
+package de.k3b.android.androFotoFinder.backup;
+
+import android.content.Context;
+import android.net.Uri;
+import android.util.Log;
+
+import java.io.File;
+import java.io.InputStream;
+
+import de.k3b.io.FileUtils;
+import de.k3b.zip.IZipConfig;
+import de.k3b.zip.LibZipGlobal;
+import de.k3b.zip.ZipConfigRepository;
+
+/**
+ * #108: Zip-file support: backup-or-copy filtered-or-selected photos to Zip-file.
+ * Gui independant service to load/save/execute the backup and it-s parameters
+ */
+public class Backup2ZipService {
+ private static String mDebugPrefix = "Backup2ZipService: ";
+
+ public static IZipConfig loadZipConfig(Uri uri, Context context) {
+ if ((uri != null) && ZipConfigRepository.isZipConfig(uri.toString())) {
+ InputStream inputsteam = null;
+ try {
+ inputsteam = context.getContentResolver().openInputStream(uri);
+ return new ZipConfigRepository(null).load(inputsteam, uri);
+ } catch (Exception ex) {
+ // file not found or no permission
+ Log.w(LibZipGlobal.LOG_TAG, mDebugPrefix + context.getClass().getSimpleName()
+ + "-loadZipConfig(" + uri + ") failed " + ex.getClass().getSimpleName(), ex);
+ } finally {
+ FileUtils.close(inputsteam, uri);
+ }
+ }
+ return null;
+ }
+
+ public static IZipConfig execute(IZipConfig mFilter) {
+ ZipConfigRepository repo = new ZipConfigRepository(mFilter);
+ final File zipConfigFile = repo.getZipConfigFile();
+ if (zipConfigFile != null) {
+ if (repo.save()) {
+ if (LibZipGlobal.debugEnabled) {
+ Log.d(LibZipGlobal.LOG_TAG, mDebugPrefix + " Saved as " + repo);
+ }
+ return repo;
+ }
+ }
+ return null;
+ }
+}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/BackupActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java
similarity index 93%
rename from app/src/main/java/de/k3b/android/androFotoFinder/BackupActivity.java
rename to app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java
index 3ae06b8d..e3960286 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/BackupActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java
@@ -17,7 +17,7 @@
* this program. If not, see
*/
-package de.k3b.android.androFotoFinder;
+package de.k3b.android.androFotoFinder.backup;
import android.app.Activity;
import android.app.DatePickerDialog;
@@ -39,14 +39,18 @@
import android.widget.Toast;
import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import java.util.TimeZone;
+import de.k3b.android.androFotoFinder.AffUtils;
+import de.k3b.android.androFotoFinder.Common;
+import de.k3b.android.androFotoFinder.GalleryFilterActivity;
+import de.k3b.android.androFotoFinder.Global;
+import de.k3b.android.androFotoFinder.R;
+import de.k3b.android.androFotoFinder.SettingsActivity;
import de.k3b.android.androFotoFinder.directory.DirectoryPickerFragment;
import de.k3b.android.androFotoFinder.queries.AndroidAlbumUtils;
import de.k3b.android.androFotoFinder.queries.FotoSql;
@@ -58,7 +62,6 @@
import de.k3b.android.widget.ActivityWithAutoCloseDialogs;
import de.k3b.android.widget.HistoryEditText;
import de.k3b.database.QueryParameter;
-import de.k3b.io.FileUtils;
import de.k3b.io.IDirectory;
import de.k3b.io.IGalleryFilter;
import de.k3b.io.StringUtils;
@@ -68,10 +71,10 @@
import de.k3b.zip.IZipConfig;
import de.k3b.zip.LibZipGlobal;
import de.k3b.zip.ZipConfigDto;
-import de.k3b.zip.ZipConfigRepository;
/**
- * #108: Zip-file support: backup-or-copy filtered-or-selected photos to Zip-file
+ * #108: Zip-file support: backup-or-copy filtered-or-selected photos to Zip-file.
+ * Gui to edit the backup parameters
*
* API
* * uri = intent.getData() load file via file-uri
@@ -105,7 +108,7 @@ public static void showActivity(String debugContext, Activity context,
intent.setAction(Intent.ACTION_EDIT);
- IZipConfig config = loadZipConfig(uri, context);
+ IZipConfig config = Backup2ZipService.loadZipConfig(uri, context);
QueryParameter mergedQuery = null;
// intent.putExtra()
if (null == config) {
@@ -158,23 +161,6 @@ private static QueryParameter getQuery(String debugContext, Activity context,
return mergedQuery;
}
- private static ZipConfigRepository loadZipConfig(Uri uri, Activity context) {
- if ((uri != null) && ZipConfigRepository.isZipConfig(uri.toString())) {
- InputStream inputsteam = null;
- try {
- inputsteam = context.getContentResolver().openInputStream(uri);
- return new ZipConfigRepository(null).load(inputsteam, uri);
- } catch (Exception ex) {
- // file not found or no permission
- Log.w(LibZipGlobal.LOG_TAG, mDebugPrefix + context.getClass().getSimpleName()
- + "-loadZipConfig(" + uri + ") failed " + ex.getClass().getSimpleName(), ex);
- } finally {
- FileUtils.close(inputsteam, uri);
- }
- }
- return null;
- }
-
private class Gui implements IZipConfig {
private static final String FILTER_DELIMITER = "\n\n\n\n@--!@--!@--!\n\n\n\n";
private final EditText editDateModifiedFrom;
@@ -311,7 +297,7 @@ protected void onCreate(Bundle savedInstanceState) {
mFilter.loadFrom((IZipConfig) savedInstanceState.getSerializable(STATE_ZIP_CONFIG));
} else {
Uri uri = intent.getData();
- ZipConfigRepository config = loadZipConfig(uri, this);
+ IZipConfig config = Backup2ZipService.loadZipConfig(uri, this);
if (config != null) {
mFilter.loadFrom(config);
} else {
@@ -626,18 +612,14 @@ private boolean onOk() {
Activity ctx = this;
saveGuiToData();
gui.mHistory.saveHistory();
- ZipConfigRepository repo = new ZipConfigRepository(mFilter);
- final File zipConfigFile = repo.getZipConfigFile();
- if (zipConfigFile != null) {
- ok = repo.save();
- if (LibZipGlobal.debugEnabled) {
- Log.d(LibZipGlobal.LOG_TAG, mDebugPrefix + " Saved as " + zipConfigFile);
- }
- Toast.makeText(BackupActivity.this, zipConfigFile.toString(), Toast.LENGTH_LONG).show();
+ IZipConfig newConfig = Backup2ZipService.execute(mFilter);
+ if (newConfig != null) {
+ Toast.makeText(BackupActivity.this, newConfig.toString(), Toast.LENGTH_LONG).show();
finish();
+ return true;
}
- return ok;
+ return false;
}
}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java b/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java
index 53c641d9..274d3c7d 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java
@@ -55,7 +55,7 @@
import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.AffUtils;
-import de.k3b.android.androFotoFinder.BackupActivity;
+import de.k3b.android.androFotoFinder.backup.BackupActivity;
import de.k3b.android.androFotoFinder.Common;
import de.k3b.android.androFotoFinder.ExifEditActivity;
import de.k3b.android.androFotoFinder.FotoGalleryActivity;
diff --git a/app/src/main/res/layout/activity_backup.xml b/app/src/main/res/layout/activity_backup.xml
index 05a5710f..cb247545 100644
--- a/app/src/main/res/layout/activity_backup.xml
+++ b/app/src/main/res/layout/activity_backup.xml
@@ -39,7 +39,7 @@
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
- tools:context="de.k3b.android.androFotoFinder.BackupActivity">
+ tools:context="de.k3b.android.androFotoFinder.backup.BackupActivity">
From 3815dbf50cb54bed89031fb87963b9a6d1bd8b29 Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Mon, 11 Feb 2019 10:00:35 +0100
Subject: [PATCH 21/35] #108: Zip-file export/backup unfinished feature
temporary suspended
---
.../backup/Backup2ZipService.java | 79 ++++++++++++++++++-
.../backup/BackupActivity.java | 2 +-
.../androFotoFinder/queries/FotoSql.java | 12 ++-
.../menu_gallery_multiselect_mode_all.xml | 2 +-
.../menu/menu_gallery_non_selected_only.xml | 2 +-
.../src/main/java/de/k3b/io/IItemSaver.java | 25 ++++++
.../de/k3b/media/Media2ExistingFileSaver.java | 34 ++++++++
.../main/java/de/k3b/media/MediaCsvSaver.java | 19 +++--
.../de/k3b/media/MediaCsvStringSaver.java | 18 +++++
9 files changed, 181 insertions(+), 12 deletions(-)
create mode 100644 fotolib2/src/main/java/de/k3b/io/IItemSaver.java
create mode 100644 fotolib2/src/main/java/de/k3b/media/Media2ExistingFileSaver.java
create mode 100644 fotolib2/src/main/java/de/k3b/media/MediaCsvStringSaver.java
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/backup/Backup2ZipService.java b/app/src/main/java/de/k3b/android/androFotoFinder/backup/Backup2ZipService.java
index aa800ed3..f3d39fbd 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/backup/Backup2ZipService.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/backup/Backup2ZipService.java
@@ -19,14 +19,25 @@
package de.k3b.android.androFotoFinder.backup;
+import android.content.ContentResolver;
import android.content.Context;
+import android.database.Cursor;
import android.net.Uri;
import android.util.Log;
import java.io.File;
import java.io.InputStream;
+import java.util.Date;
+import de.k3b.android.androFotoFinder.media.MediaCursor;
+import de.k3b.android.androFotoFinder.queries.FotoSql;
+import de.k3b.android.androFotoFinder.tagDB.TagSql;
+import de.k3b.database.QueryParameter;
import de.k3b.io.FileUtils;
+import de.k3b.io.IItemSaver;
+import de.k3b.media.IMetaApi;
+import de.k3b.media.Media2ExistingFileSaver;
+import de.k3b.media.MediaCsvStringSaver;
import de.k3b.zip.IZipConfig;
import de.k3b.zip.LibZipGlobal;
import de.k3b.zip.ZipConfigRepository;
@@ -55,10 +66,20 @@ public static IZipConfig loadZipConfig(Uri uri, Context context) {
return null;
}
- public static IZipConfig execute(IZipConfig mFilter) {
- ZipConfigRepository repo = new ZipConfigRepository(mFilter);
+ public static IZipConfig execute(IZipConfig zipConfig, ContentResolver contentResolver) {
+ ZipConfigRepository repo = new ZipConfigRepository(zipConfig);
final File zipConfigFile = repo.getZipConfigFile();
if (zipConfigFile != null) {
+ QueryParameter filter = getEffectiveQueryParameter(zipConfig);
+
+ final MediaCsvStringSaver csv = new MediaCsvStringSaver();
+
+ /// !!! todo go on here
+ final IItemSaver file2Zip = null;
+ final Media2ExistingFileSaver media2file = new Media2ExistingFileSaver(file2Zip);
+
+ execQuery(filter, contentResolver, csv, media2file);
+
if (repo.save()) {
if (LibZipGlobal.debugEnabled) {
Log.d(LibZipGlobal.LOG_TAG, mDebugPrefix + " Saved as " + repo);
@@ -68,4 +89,58 @@ public static IZipConfig execute(IZipConfig mFilter) {
}
return null;
}
+
+ /**
+ * @return get query without filte-DateModified-min/max and with added zipConfig.getDateModifiedFrom
+ */
+ private static QueryParameter getEffectiveQueryParameter(IZipConfig zipConfig) {
+ QueryParameter filter = QueryParameter.parse(zipConfig.getFilter());
+ FotoSql.parseDateModifiedMax(filter, true);
+ FotoSql.parseDateModifiedMin(filter, true);
+ final Date dateModifiedFrom = zipConfig.getDateModifiedFrom();
+ if (dateModifiedFrom != null) {
+ FotoSql.addWhereDateModifiedMinMax(filter, dateModifiedFrom.getTime(), 0);
+ }
+
+ filter.clearColumns().addColumn(TagSql.SQL_COL_PK
+ ,TagSql.SQL_COL_PATH
+ ,TagSql.SQL_COL_DATE_TAKEN
+ ,TagSql.SQL_COL_EXT_TITLE
+ ,TagSql.SQL_COL_EXT_DESCRIPTION
+ ,TagSql.SQL_COL_EXT_TAGS
+ ,TagSql.SQL_COL_LAT
+ ,TagSql.SQL_COL_LON
+ ,TagSql.SQL_COL_EXT_RATING
+ ,TagSql.SQL_COL_EXT_MEDIA_TYPE);
+
+ return filter;
+ }
+
+ private static void execQuery(QueryParameter query, ContentResolver contentResolver,
+ IItemSaver... consumers) {
+ Cursor cursor = null;
+ try {
+ cursor = contentResolver.query(Uri.parse(query.toFrom()), query.toColumns(),
+ query.toAndroidWhere(), query.toAndroidParameters(), query.toOrderBy());
+
+ int itemCount = cursor.getCount();
+ final int expectedCount = itemCount + itemCount;
+
+ MediaCursor mediaItem = new MediaCursor(cursor);
+ while (cursor.moveToNext()) {
+ for (IItemSaver consumer : consumers){
+ if (consumer != null) consumer.save(mediaItem);
+ }
+ }
+ } catch (Exception ex){
+ Log.e(LibZipGlobal.LOG_TAG, mDebugPrefix + query, ex);
+ throw new RuntimeException(mDebugPrefix + query + "\n" + ex.getMessage(), ex);
+ } finally {
+ if (cursor != null) {
+ cursor.close();
+ }
+ }
+
+
+ }
}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java
index e3960286..0eb90239 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java
@@ -612,7 +612,7 @@ private boolean onOk() {
Activity ctx = this;
saveGuiToData();
gui.mHistory.saveHistory();
- IZipConfig newConfig = Backup2ZipService.execute(mFilter);
+ IZipConfig newConfig = Backup2ZipService.execute(mFilter, ctx.getContentResolver());
if (newConfig != null) {
Toast.makeText(BackupActivity.this, newConfig.toString(), Toast.LENGTH_LONG).show();
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java
index c13e5d9c..223a8fbf 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java
@@ -390,14 +390,22 @@ public static IGalleryFilter parseQuery(QueryParameter query, boolean removeFrom
filter.setPath(getFilePath(query, removeFromSourceQuery));
// SQL_COL_LAST_MODIFIED in seconds since 1970; translate from MilliSecs
- filter.setDateModified(getParamWithFix(query, FILTER_EXPR_DATE_MODIFIED_MIN, removeFromSourceQuery, LAST_MODIFIED_FACTOR),
- getParamWithFix(query, FILTER_EXPR_DATE_MODIFIED_MAX, removeFromSourceQuery, LAST_MODIFIED_FACTOR));
+ filter.setDateModified(parseDateModifiedMin(query, removeFromSourceQuery),
+ parseDateModifiedMax(query, removeFromSourceQuery));
return filter;
}
return null;
}
+ public static long parseDateModifiedMax(QueryParameter query, boolean removeFromSourceQuery) {
+ return getParamWithFix(query, FILTER_EXPR_DATE_MODIFIED_MAX, removeFromSourceQuery, LAST_MODIFIED_FACTOR);
+ }
+
+ public static long parseDateModifiedMin(QueryParameter query, boolean removeFromSourceQuery) {
+ return getParamWithFix(query, FILTER_EXPR_DATE_MODIFIED_MIN, removeFromSourceQuery, LAST_MODIFIED_FACTOR);
+ }
+
/** extracts geo infos from srcQuery to destFilter */
public static GeoRectangle parseQueryGeo(QueryParameter srcQuery, GeoRectangle destFilter, boolean removeFromSourceQuery) {
if (null != getParams(srcQuery, FILTER_EXPR_NO_GPS, removeFromSourceQuery)) {
diff --git a/app/src/main/res/menu/menu_gallery_multiselect_mode_all.xml b/app/src/main/res/menu/menu_gallery_multiselect_mode_all.xml
index 33c7c81f..0995599f 100644
--- a/app/src/main/res/menu/menu_gallery_multiselect_mode_all.xml
+++ b/app/src/main/res/menu/menu_gallery_multiselect_mode_all.xml
@@ -48,7 +48,7 @@
diff --git a/app/src/main/res/menu/menu_gallery_non_selected_only.xml b/app/src/main/res/menu/menu_gallery_non_selected_only.xml
index 4e6c7f2e..cb419ccd 100644
--- a/app/src/main/res/menu/menu_gallery_non_selected_only.xml
+++ b/app/src/main/res/menu/menu_gallery_non_selected_only.xml
@@ -54,7 +54,7 @@
diff --git a/fotolib2/src/main/java/de/k3b/io/IItemSaver.java b/fotolib2/src/main/java/de/k3b/io/IItemSaver.java
new file mode 100644
index 00000000..dd309ae7
--- /dev/null
+++ b/fotolib2/src/main/java/de/k3b/io/IItemSaver.java
@@ -0,0 +1,25 @@
+package de.k3b.io;
+
+/*
+ * Copyright (c) 2019 by k3b.
+ *
+ * This file is part of AndroFotoFinder.
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see
+ */
+
+/* abstract api to process an item */
+public interface IItemSaver {
+ boolean save(T item);
+}
diff --git a/fotolib2/src/main/java/de/k3b/media/Media2ExistingFileSaver.java b/fotolib2/src/main/java/de/k3b/media/Media2ExistingFileSaver.java
new file mode 100644
index 00000000..07cb6e3c
--- /dev/null
+++ b/fotolib2/src/main/java/de/k3b/media/Media2ExistingFileSaver.java
@@ -0,0 +1,34 @@
+package de.k3b.media;
+
+import java.io.File;
+
+import de.k3b.io.FileProcessor;
+import de.k3b.io.IItemSaver;
+
+public class Media2ExistingFileSaver implements IItemSaver {
+ private final IItemSaver fileSaver;
+ public Media2ExistingFileSaver(IItemSaver fileSaver) {
+ this.fileSaver = fileSaver;
+ }
+
+ @Override
+ public boolean save(IMetaApi item) {
+ if (item != null) {
+ String path = item.getPath();
+ if (path != null) {
+ return saveFiles(new File(path),
+ FileProcessor.getExistingSidecarOrNull(path, true),
+ FileProcessor.getExistingSidecarOrNull(path, false)) > 0;
+ }
+ }
+ return false;
+ }
+
+ private int saveFiles(File... files) {
+ int processed = 0;
+ for (File f: files) {
+ if ((f != null) && (f.exists()) && f.canRead() && this.fileSaver.save(f)) processed++;
+ }
+ return processed;
+ }
+}
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaCsvSaver.java b/fotolib2/src/main/java/de/k3b/media/MediaCsvSaver.java
index da9a2f62..6f32ad1f 100644
--- a/fotolib2/src/main/java/de/k3b/media/MediaCsvSaver.java
+++ b/fotolib2/src/main/java/de/k3b/media/MediaCsvSaver.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2016 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder.
*
@@ -23,30 +23,39 @@
import java.util.Arrays;
import de.k3b.csv2db.csv.CsvItem;
+import de.k3b.io.IItemSaver;
/**
* Created by k3b on 13.10.2016.
*/
-public class MediaCsvSaver {
- private final PrintWriter printer;
+public class MediaCsvSaver implements IItemSaver {
+ private PrintWriter printer;
private final MediaCsvItem csvLine;
public MediaCsvSaver(PrintWriter printer) {
- this.printer = printer;
+ setPrinter(printer);
csvLine = new MediaCsvItem();
defineHeader(MediaCsvItem.MEDIA_CSV_STANDARD_HEADER);
}
- public void save(IMetaApi item) {
+ protected MediaCsvSaver setPrinter(PrintWriter printer) {
+ this.printer = printer;
+ return this;
+ }
+
+ @Override
+ public boolean save(IMetaApi item) {
if (item != null) {
csvLine.clear();
MediaUtil.copy(csvLine, item, true, true);
if (!csvLine.isEmpty()) {
this.printer.write(csvLine.toString());
this.printer.write(CsvItem.DEFAULT_CHAR_LINE_DELIMITER);
+ return true;
}
}
+ return false;
}
private void defineHeader(String header) {
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaCsvStringSaver.java b/fotolib2/src/main/java/de/k3b/media/MediaCsvStringSaver.java
new file mode 100644
index 00000000..da9b33c1
--- /dev/null
+++ b/fotolib2/src/main/java/de/k3b/media/MediaCsvStringSaver.java
@@ -0,0 +1,18 @@
+package de.k3b.media;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+public class MediaCsvStringSaver extends MediaCsvSaver{
+ private StringWriter result = new StringWriter();
+ private PrintWriter writer = new PrintWriter(result);
+ public MediaCsvStringSaver() {
+ super(null);
+ this.setPrinter(writer);
+ }
+
+ @Override
+ public String toString() {
+ return result.toString();
+ }
+}
From b9c4a2e37e466a7b88b12d28b860aba50be52976 Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Mon, 11 Feb 2019 10:23:24 +0100
Subject: [PATCH 22/35] upgrade mpasforge offline map support from 0.6
(11/2015) to 0.10 (8/2018)
---
app/build.gradle | 8 ++++----
.../de/k3b/android/osmdroid/forge/MapsForgeSupport.java | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index bb73ed66..ff541552 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -135,13 +135,13 @@ dependencies {
// this is osmdroid
// implementation 'org.osmdroid:osmdroid-android:5.4:release@aar'
// implementation ('org.osmdroid:osmdroid-mapsforge:5.4:release@aar')
- implementation 'org.osmdroid:osmdroid-android:6.0.1'
- implementation ('org.osmdroid:osmdroid-mapsforge:6.0.1')
+ implementation 'org.osmdroid:osmdroid-android:6.0.3'
+ implementation ('org.osmdroid:osmdroid-mapsforge:6.0.3')
//Mapsforge rendering and database support, which is LGPL
- implementation 'org.mapsforge:mapsforge-map-android:0.6.1'
- implementation 'org.mapsforge:mapsforge-map:0.6.1'
+ implementation 'org.mapsforge:mapsforge-map-android:0.10.0'
+ implementation 'org.mapsforge:mapsforge-map:0.10.0'
implementation 'org.slf4j:slf4j-api:1.7.7@jar'
implementation 'eu.lp0.slf4j:slf4j-android:1.7.7-1@jar'
diff --git a/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java b/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java
index b7120a22..cdecaf13 100644
--- a/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java
+++ b/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java
@@ -41,7 +41,7 @@ public static void createInstance(Application application) {
AndroidGraphicFactory.createInstance(application);
// see https://github.com/mapsforge/mapsforge/issues/868
- ReadBuffer.setMaximumBufferSize(6500000);
+ // ReadBuffer.setMaximumBufferSize(6500000);
}
public static void load(Activity activity, MapView mMap, File mapsForgeDir) {
From c955d7998582088225312438e7fd1214838fb931 Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Sat, 23 Feb 2019 09:47:44 +0100
Subject: [PATCH 23/35] workaround for broken unittest introduced when shifting
from grade-4.1 to 4.6
---
fotolib2/src/main/java/de/k3b/io/VISIBILITY.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/fotolib2/src/main/java/de/k3b/io/VISIBILITY.java b/fotolib2/src/main/java/de/k3b/io/VISIBILITY.java
index f62529bc..3ae7b24b 100644
--- a/fotolib2/src/main/java/de/k3b/io/VISIBILITY.java
+++ b/fotolib2/src/main/java/de/k3b/io/VISIBILITY.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -39,7 +39,10 @@ public enum VISIBILITY {
// #100: if photo has this tag it has visibility PRIVATE
public static final String TAG_PRIVATE = "PRIVATE";
- private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
+
+
+ // causes "SLF4J: Class path contains multiple SLF4J bindings." in unittests :-(
+ // private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
public static final VISIBILITY MAX = PRIVATE_PUBLIC;
public final int value;
@@ -80,6 +83,9 @@ public static VISIBILITY fromString(String value) {
}
}
+
+ // workar9oud to avoid "SLF4J: Class path contains multiple SLF4J bindings." in unittests :-(
+ Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
logger.warn(VISIBILITY.class.getSimpleName() + ".fromString " + value + ": unknown value");
}
return null;
From f0f2139d807c46d715969e7058417ea2243bdb5e Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Sat, 23 Feb 2019 10:15:48 +0100
Subject: [PATCH 24/35] fixed travis errors and lint warnings
---
app/build.gradle | 20 +-
.../assets/renderthemes/rendertheme-v4.xml | 1124 +++++++++--------
.../k3b/android/androFotoFinder/Common.java | 16 +-
.../androFotoFinder/ExifEditActivity.java | 6 +-
.../GalleryFilterActivity.java | 2 +-
.../PhotoAutoprocessingEditActivity.java | 8 +-
.../VirtualAlbumController.java | 21 +-
.../backup/BackupActivity.java | 3 +-
.../directory/DirectoryPickerFragment.java | 8 +-
.../gallery/cursor/GalleryCursorAdapter.java | 4 +-
.../gallery/cursor/GalleryCursorFragment.java | 3 +-
.../ImageDetailActivityViewPager.java | 29 +-
.../ImagePagerAdapterFromCursor.java | 6 +-
.../imagedetail/PhotoViewEx.java | 21 +-
.../media/MediaDBActivity.java | 6 +-
.../tagDB/TagListArrayAdapter.java | 8 +-
.../androFotoFinder/tagDB/TagWorflow.java | 6 +-
.../tagDB/TagsPickerFragment.java | 4 +-
.../android/osmdroid/MarkerBubblePopup.java | 22 +-
.../de/k3b/android/osmdroid/OsmdroidUtil.java | 4 +-
.../osmdroid/forge/MapsForgeSupport.java | 6 +-
.../k3b/android/util/AndroidFileCommands.java | 4 +-
.../de/k3b/android/util/FileManagerUtil.java | 4 +-
.../android/util/MediaScannerAsyncTask.java | 22 +-
.../widget/AsyncTaskWithProgressDialog.java | 4 +-
.../k3b/android/widget/BaseQueryActivity.java | 5 +-
.../lonamiwebs/stringlate/utilities/Api.java | 20 +-
app/src/main/res/values-de/strings.xml | 1 -
app/src/main/res/values-in/strings.xml | 1 -
app/src/main/res/values-pl/strings.xml | 1 -
app/src/main/res/values-pt-rBR/strings.xml | 1 -
app/src/main/res/values-ro/strings.xml | 1 -
app/src/main/res/values-tr/strings.xml | 1 -
app/src/main/res/values-zh-rTW/strings.xml | 1 -
app/src/main/res/values-zz/strings.xml | 1 -
.../tagDB/TagSqlQueryParserTests.java | 30 +-
.../metadata/android/en-US/changelogs/41.txt | 2 +
fotolib2/build.gradle | 4 +-
.../java/de/k3b/database/QueryParameter.java | 4 +-
.../de/k3b/database/SqlTemplateEngine.java | 4 +-
.../java/de/k3b/io/DirectoryFormatter.java | 4 +-
.../src/main/java/de/k3b/io/GeoRectangle.java | 4 +-
.../src/main/java/de/k3b/io/IDirectory.java | 12 +-
.../src/main/java/de/k3b/io/OSDirectory.java | 4 +-
.../src/main/java/de/k3b/io/StringUtils.java | 21 +-
.../main/java/de/k3b/media/ExifInterface.java | 6 +-
.../java/de/k3b/media/ImageMetaReader.java | 4 +-
.../java/de/k3b/media/JpgMetaWorkflow.java | 8 +-
.../src/main/java/de/k3b/media/MediaUtil.java | 39 +-
.../de/k3b/media/MediaXmpFieldDefinition.java | 6 +-
.../main/java/de/k3b/media/XmpNamespace.java | 4 +-
.../main/java/de/k3b/media/XmpSegment.java | 8 +-
.../main/java/de/k3b/tagDB/TagRepository.java | 6 +-
.../test/java/de/k3b/csv2db/csv/TestCsv.java | 28 +-
.../io/FileCommandAutoIntegrationTests.java | 4 +-
.../ExifInterfaceExIntegrationTests.java | 35 +-
.../ImageMetaReaderIntegrationTests.java | 29 +-
.../java/de/k3b/media/MediaMappingTests.java | 12 +-
.../MediaXmpSegmentIntegrationTests.java | 34 +-
.../java/de/k3b/tagDB/TagProcessorTests.java | 24 +-
.../java/de/k3b/tagDB/TagRepositoryTests.java | 36 +-
.../TranslationStatisticsTests.java | 4 +-
62 files changed, 974 insertions(+), 796 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index ff541552..4f0e39c9 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -79,7 +79,8 @@ android {
// http://stackoverflow.com/questions/31350350/generating-signed-apk-error7-missingtranslation-in-build-generated-res-gen
// MissingTranslation : not all crowdwin translations are complete so ignore them
// ValidFragment : local (dialog-)fragment class for customized direcotry picker is fragile but on rotation code makes shure that dialog is closed.
- disable 'MissingTranslation','ValidFragment', 'ContentDescription', 'AndroidLintPluralsCandidate', 'AndroidLintRtlHardcoded'
+ // disable 'MissingTranslation','ValidFragment', 'ContentDescription', 'AndroidLintPluralsCandidate', 'AndroidLintRtlHardcoded'
+ disable 'MissingTranslation','ValidFragment', 'ContentDescription', 'ExpiredTargetSdkVersion'
abortOnError false
}
@@ -100,6 +101,11 @@ task('increaseVersionCode').doLast({
})
dependencies {
+
+ testImplementation 'junit:junit:4.11'
+ testImplementation 'org.slf4j:slf4j-api:1.7.7@jar'
+ testImplementation 'org.slf4j:slf4j-simple:1.7.7'
+
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':fotolib2')
@@ -123,7 +129,7 @@ dependencies {
// exif support
// https://github.com/drewnoakes/metadata-extractor/wiki/GettingStarted licence: http://www.apache.org/licenses/LICENSE-2.0
// 2.10.1 includes more recent xmpcore that generates java-8 bytecode not supported by android yet
- implementation ('com.drewnoakes:metadata-extractor:2.10.1') { transitive = false; } // 2.8.1
+ implementation ('com.drewnoakes:metadata-extractor:2.10.1') { transitive = false } // 2.8.1
// implementation 'com.adobe.xmp:xmpcore:6.1.10' // update for drewnoakes:metadata-extractor requires java-8 compiler does not run on my android-4.4.
implementation 'com.adobe.xmp:xmpcore:5.1.2' // current version for drewnoakes:metadata-extractor
@@ -133,24 +139,22 @@ dependencies {
// implementation 'org.apache.commons:commons-configuration2:2.1.1'
// this is osmdroid
- // implementation 'org.osmdroid:osmdroid-android:5.4:release@aar'
- // implementation ('org.osmdroid:osmdroid-mapsforge:5.4:release@aar')
+ // https://github.com/osmdroid/osmdroid/ 6.0.3 from 11/2018
implementation 'org.osmdroid:osmdroid-android:6.0.3'
implementation ('org.osmdroid:osmdroid-mapsforge:6.0.3')
//Mapsforge rendering and database support, which is LGPL
+ // https://github.com/mapsforge/mapsforge/ 0.10.0 from 8/2018
implementation 'org.mapsforge:mapsforge-map-android:0.10.0'
implementation 'org.mapsforge:mapsforge-map:0.10.0'
implementation 'org.slf4j:slf4j-api:1.7.7@jar'
implementation 'eu.lp0.slf4j:slf4j-android:1.7.7-1@jar'
+
// https://jitpack.io/com/github/k3b/ToGoZip/L2.0.15/build.log
// https://jitpack.io/com/github/k3b/ToGoZip/libK3bZip/L2.0.15/
// implementation('com.github.k3b.ToGoZip:libK3bZip:L2.0.15') { transitive = false; }
- implementation('com.github.k3b.ToGoZip:libK3bZip:v2.0.18.181224') { transitive = false; }
-
- testImplementation 'junit:junit:4.11'
- testImplementation 'org.slf4j:slf4j-simple:1.7.7'
+ implementation('com.github.k3b.ToGoZip:libK3bZip:v2.0.18.181224') { transitive = false }
}
diff --git a/app/src/main/assets/renderthemes/rendertheme-v4.xml b/app/src/main/assets/renderthemes/rendertheme-v4.xml
index 2e14e828..bae96c50 100644
--- a/app/src/main/assets/renderthemes/rendertheme-v4.xml
+++ b/app/src/main/assets/renderthemes/rendertheme-v4.xml
@@ -1,282 +1,309 @@
+ xsi:schemaLocation="http://mapsforge.org/renderTheme https://raw.githubusercontent.com/mapsforge/mapsforge/dev/resources/renderTheme-v4.xsd
+http://mapsforge.org/renderTheme " version="4" map-background="#F8F8F8" map-background-outside="#DDDDDD">
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
@@ -285,44 +312,47 @@
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -331,86 +361,88 @@
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
@@ -420,53 +452,55 @@
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
@@ -474,121 +508,127 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
@@ -597,49 +637,54 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -648,79 +693,88 @@
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -728,31 +782,35 @@
-
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
@@ -760,34 +818,36 @@
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -854,51 +914,56 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
+
-
+
-
+
-
+
@@ -907,89 +972,96 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
+
-
-
+
+
-
+
@@ -997,74 +1069,86 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -1072,39 +1156,42 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -1112,161 +1199,165 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -1274,128 +1365,140 @@
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -1405,55 +1508,55 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -1479,29 +1582,32 @@
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/Common.java b/app/src/main/java/de/k3b/android/androFotoFinder/Common.java
index 5165bc58..6c91d374 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/Common.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/Common.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder.
*
@@ -31,23 +31,23 @@ public interface Common {
* Format:GalleryFilterParameter.toString/parse as a "," seperated list of values.
* See https://github.com/k3b/AndroFotoFinder/wiki/intentapi#filter
*/
- public static final String EXTRA_FILTER = "de.k3b.extra.FILTER";
+ String EXTRA_FILTER = "de.k3b.extra.FILTER";
/** detail,gallery: sql where ... order by ... group by ... */
- public static final String EXTRA_QUERY = "de.k3b.extra.SQL";
+ String EXTRA_QUERY = "de.k3b.extra.SQL";
/** detail: offset in in the resultset to be shown */
- public static final String EXTRA_POSITION = "de.k3b.extra.OFFSET";
+ String EXTRA_POSITION = "de.k3b.extra.OFFSET";
/** gallery,geoEdit,picker: app title for picker */
- public static final String EXTRA_TITLE = Intent.EXTRA_TITLE;
+ String EXTRA_TITLE = Intent.EXTRA_TITLE;
/** detail: getData/EXTRA_STREAM - file/content */
- public static final String EXTRA_STREAM = Intent.EXTRA_STREAM;
+ String EXTRA_STREAM = Intent.EXTRA_STREAM;
/** detail: Activity.onActivityResult() - resultCode: no photo-files were modified */
- public static final int RESULT_NOCHANGE = Activity.RESULT_CANCELED;
+ int RESULT_NOCHANGE = Activity.RESULT_CANCELED;
/** detail,geoEdit: Activity.onActivityResult() - resultCode: one or more photo-files were modified. caller must invalidate cached files/directories. */
- public static final int RESULT_CHANGE = Activity.RESULT_OK;
+ int RESULT_CHANGE = Activity.RESULT_OK;
}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/ExifEditActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/ExifEditActivity.java
index 67dd5742..c4af016a 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/ExifEditActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/ExifEditActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -564,7 +564,7 @@ public boolean onOk(List addNames, List removeNames) {
public boolean onTagPopUpClick(int menuItemItemId, Tag selectedTag) {
return TagsPickerFragment.handleMenuShow(menuItemItemId, selectedTag, ExifEditActivity.this, null);
}
- };
+ }
private static class HashTagEditWatcher implements TextWatcher {
private boolean enabled = true;
@@ -771,7 +771,7 @@ public IMetaApi setVisibility(VISIBILITY priv) {
public String toString() {
return MediaUtil.toString(this);
}
- };
+ }
private void onCheckPrivateChanged(CheckBox chk) {
if (!checkActive && (chk != null)) {
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/GalleryFilterActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/GalleryFilterActivity.java
index ab2385c0..218b7a60 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/GalleryFilterActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/GalleryFilterActivity.java
@@ -634,7 +634,7 @@ public int getSortID() {
*/
@Override
public boolean isSortAscending() {
- return (mFilter != null) ? mFilter.isSortAscending() : false;
+ return (mFilter != null) && mFilter.isSortAscending();
}
@Override
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/PhotoAutoprocessingEditActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/PhotoAutoprocessingEditActivity.java
index b2564bea..11e8723a 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/PhotoAutoprocessingEditActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/PhotoAutoprocessingEditActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -177,13 +177,13 @@ protected void onCreate(Bundle savedInstanceState) {
MediaAsString exampleExif = MediaUtil.inferAutoprocessingExifDefaults(new MediaAsString(), mSelectedFiles.getFiles());
mCurrentAutoprocessingData.setMediaDefaults(exampleExif);
}
- this.exampleSrcfile = mProcessor.getFile(mSelectedFiles.getFile(0));
+ this.exampleSrcfile = RuleFileNameProcessor.getFile(mSelectedFiles.getFile(0));
final Date[] datesPhotoTaken = mSelectedFiles.getDatesPhotoTaken();
this.exampleDate = ((datesPhotoTaken != null) && (datesPhotoTaken.length > 0))
? datesPhotoTaken[0]
- : getExampleDate(mProcessor.getFile(this.exampleSrcfile));
+ : getExampleDate(RuleFileNameProcessor.getFile(this.exampleSrcfile));
defineGui();
@@ -385,7 +385,7 @@ public boolean onLongClick(View v) {
}
});
- ((ImageButton) findViewById(R.id.cmd_file_name_pattern_history)).setOnClickListener(new View.OnClickListener() {
+ findViewById(R.id.cmd_file_name_pattern_history).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onOpenRenamerPopupMenu(v);
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/VirtualAlbumController.java b/app/src/main/java/de/k3b/android/androFotoFinder/VirtualAlbumController.java
index 342a5404..6e0ff59a 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/VirtualAlbumController.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/VirtualAlbumController.java
@@ -1,3 +1,21 @@
+/*
+ * Copyright (c) 2018-2019 by k3b.
+ *
+ * This file is part of AndroFotoFinder / #APhotoManager.
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see
+ */
package de.k3b.android.androFotoFinder;
import android.app.Activity;
@@ -76,8 +94,7 @@ protected void onDialogResult(String result, Object... parameters) {
}
private boolean mustAskOverwrite(File valbum) {
- if (valbum.exists()) return true;
- return false;
+ return valbum.exists();
}
// workflow onSaveAsVirutalAlbumQuestion-onSaveAsVirutalAlbumAnswer-onSaveAsVirutalAlbumAllowOverwriteAnswer
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java
index 0eb90239..fb316975 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java
@@ -485,7 +485,8 @@ protected void onDirectoryPick(IDirectory selection) {
dismiss();
}
- };
+ }
+
private boolean pickDir(boolean outDir, String lastCopyToPath, int titleId) {
if (AndroidFileCommands.canProcessFile(this, false)) {
DestZipDirPicker dlg = DestZipDirPicker.newInstance(outDir/*, fotos*/);
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/directory/DirectoryPickerFragment.java b/app/src/main/java/de/k3b/android/androFotoFinder/directory/DirectoryPickerFragment.java
index 3f14361b..39acb292 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/directory/DirectoryPickerFragment.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/directory/DirectoryPickerFragment.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2018 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -273,8 +273,8 @@ public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition
@Override
public boolean onItemLongClick(AdapterView> parent, View view, int flatPosition, long id) {
long packedPos = mTreeView.getExpandableListPosition(flatPosition);
- int group = mTreeView.getPackedPositionGroup(packedPos);
- int child = mTreeView.getPackedPositionChild(packedPos);
+ int group = ExpandableListView.getPackedPositionGroup(packedPos);
+ int child = ExpandableListView.getPackedPositionChild(packedPos);
IDirectory directory = (child != -1) ? mNavigation.getChild(group, child) : mNavigation.getGroup(group);
onShowPopUp(view, directory);
return false;
@@ -763,7 +763,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
Dialog result = super.onCreateDialog(savedInstanceState);
return result;
- };
+ }
public void onResume() {
super.onResume();
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorAdapter.java b/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorAdapter.java
index d6cfef76..6f76e99f 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorAdapter.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2018 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -200,7 +200,7 @@ static class GridCellViewHolder {
this.description = (TextView) parent.findViewById(R.id.text);
this.image = (ImageView) parent.findViewById(R.id.image);
this.icon = (ImageView) parent.findViewById(R.id.icon);
- };
+ }
@Override
public String toString() {
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java b/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java
index 274d3c7d..ecb5f999 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java
@@ -1052,7 +1052,8 @@ protected void onDirectoryPick(IDirectory selection) {
sFileCommands.onMoveOrCopyDirectoryPick(getMove(), getSrcFotos(), selection);
dismiss();
}
- };
+ }
+
private boolean cmdMoveOrCopyWithDestDirPicker(final boolean move, String lastCopyToPath, final SelectedFiles fotos) {
if (AndroidFileCommands.canProcessFile(this.getActivity(), false)) {
mDestDirPicker = MoveOrCopyDestDirPicker.newInstance(move, fotos);
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailActivityViewPager.java b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailActivityViewPager.java
index 892fd3ac..159f19d2 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailActivityViewPager.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailActivityViewPager.java
@@ -1,6 +1,6 @@
/*******************************************************************************
* Copyright 2011, 2012 Chris Banes.
- * Copyright (c) 2015-2018 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -76,6 +76,7 @@
import de.k3b.android.widget.Dialogs;
import de.k3b.android.widget.LocalizedActivity;
import de.k3b.database.QueryParameter;
+import de.k3b.io.FileProcessor;
import de.k3b.io.collections.SelectedFiles;
import de.k3b.geo.api.GeoPointDto;
import de.k3b.geo.io.GeoUri;
@@ -161,6 +162,9 @@ public class ImageDetailActivityViewPager extends LocalizedActivity implements C
private boolean mMustReplaceMenue = false;
private boolean locked = false; // if != Global.locked : must update menu
+ // if not null this one image that cannot be translated to a file uri will be shown
+ private Uri imageUri = null;
+
/** executes sql to load image detail data in a background task that may survive
* conriguration change (i.e. device rotation) */
class LocalCursorLoader implements LoaderManager.LoaderCallbacks {
@@ -320,7 +324,7 @@ protected void onDirectoryPick(IDirectory selection) {
sFileCommands.onMoveOrCopyDirectoryPick(getMove(), getSrcFotos(), selection);
dismiss();
}
- };
+ }
private class TagUpdateTask extends TagTask> {
@@ -433,7 +437,7 @@ public void onClick(View v) {
if (savedInstanceState != null) {
mInitialScrollPosition = savedInstanceState.getInt(INSTANCE_STATE_LAST_SCROLL_POSITION, this.mInitialScrollPosition);
- mModifyCount = savedInstanceState.getInt(INSTANCE_STATE_ContextMenuId, this.mModifyCount);
+ mModifyCount = savedInstanceState.getInt(INSTANCE_STATE_ContextMenuId, mModifyCount);
} else {
mModifyCount = 0;
}
@@ -596,9 +600,14 @@ private void getParameter(Intent intent) {
if (mGalleryContentQuery == null) {
this.mInitialScrollPosition = NO_INITIAL_SCROLL_POSITION;
- String path = IntentUtil.getFilePath(this, IntentUtil.getUri(intent));
- if (path != null) {
- setFilter(getParameterFromPath(path));
+ final Uri conentUri = IntentUtil.getUri(intent);
+ if (conentUri != null) {
+ String path = IntentUtil.getFilePath(this, conentUri);
+ if (path != null) {
+ setFilter(getParameterFromPath(path));
+ } else {
+ this.imageUri = conentUri;
+ }
}
}
@@ -1109,13 +1118,13 @@ private void onRenameSubDirAnswer(SelectedFiles currentFoto, final long fotoId,
File src = new File(fotoSourcePath);
File dest = new File(src.getParentFile(), newFileName);
- File srcXmpShort = mFileCommands.getSidecar(src, false);
+ File srcXmpShort = FileProcessor.getSidecar(src, false);
boolean hasSideCarShort = ((srcXmpShort != null) && (mFileCommands.osFileExists(srcXmpShort)));
- File srcXmpLong = mFileCommands.getSidecar(src, true);
+ File srcXmpLong = FileProcessor.getSidecar(src, true);
boolean hasSideCarLong = ((srcXmpLong != null) && (mFileCommands.osFileExists(srcXmpLong)));
- File destXmpShort = mFileCommands.getSidecar(dest, false);
- File destXmpLong = mFileCommands.getSidecar(dest, true);
+ File destXmpShort = FileProcessor.getSidecar(dest, false);
+ File destXmpLong = FileProcessor.getSidecar(dest, true);
if (src.equals(dest)) return; // new name == old name ==> nothing to do
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterFromCursor.java b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterFromCursor.java
index 57a8aea0..1e3873a7 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterFromCursor.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterFromCursor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2018 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -264,7 +264,7 @@ protected View createViewWithContent(int position, ViewGroup container, String f
final boolean useLayout=true;
- LayoutInflater inflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
+ LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
PhotoViewEx photoView;
View root;
@@ -318,7 +318,7 @@ protected View createViewWithContent(int position, ViewGroup container, String f
setImageFromThumbnail(photoView, imageFile);
}
}
- final int rotationInDegrees = JpgMetaWorkflow.getRotationFromExifOrientation(fullPhotoPath);
+ final int rotationInDegrees = JpgMetaWorkflow.getRotationFromExifOrientation(fullPhotoPath, null);
if (Global.debugEnabledViewItem) {
Log.i(Global.LOG_CONTEXT, mDebugPrefix + debugContext + position +", rotation=" +
rotationInDegrees + ", "
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/PhotoViewEx.java b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/PhotoViewEx.java
index 6f0455cb..f6366e52 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/PhotoViewEx.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/PhotoViewEx.java
@@ -1,9 +1,26 @@
+/*
+ * Copyright (c) 2016-2019 by k3b.
+ *
+ * This file is part of AndroFotoFinder / #APhotoManager.
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see
+ */
package de.k3b.android.androFotoFinder.imagedetail;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
-import android.util.Log;
import android.widget.ImageView;
import java.io.File;
@@ -101,7 +118,7 @@ public void onScale(float scaleFactor, float focusX, float focusY) {
MAX_IMAGE_DIMENSION = (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) ? 4096 : HugeImageLoader.getMaxTextureSize();
}
imageView.setImageBitmap(HugeImageLoader.loadImage(mImageReloadFile.getAbsoluteFile(), MAX_IMAGE_DIMENSION, MAX_IMAGE_DIMENSION));
- this.setRotationTo(JpgMetaWorkflow.getRotationFromExifOrientation(mImageReloadFile.getAbsolutePath()));
+ this.setRotationTo(JpgMetaWorkflow.getRotationFromExifOrientation(mImageReloadFile.getAbsolutePath(), null));
} catch (OutOfMemoryError e) {
LogManager.getLogger().e(
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/media/MediaDBActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/media/MediaDBActivity.java
index 077879ec..f0664058 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/media/MediaDBActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/media/MediaDBActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 by k3b.
+ * Copyright (c) 2016-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -79,7 +79,7 @@ public class MediaDBActivity extends Activity {
mFolder.setText(uri.toString());
mStatus.setText("");
- ((Button) findViewById(R.id.cmd_cancel)).setOnClickListener(new View.OnClickListener() {
+ findViewById(R.id.cmd_cancel).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mTask != null) mTask.cancel(false);
@@ -87,7 +87,7 @@ public void onClick(View v) {
}
});
- ((Button) findViewById(R.id.cmd_ok)).setOnClickListener(new View.OnClickListener() {
+ findViewById(R.id.cmd_ok).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startScanner(uri);
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagListArrayAdapter.java b/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagListArrayAdapter.java
index 40726e55..47eae25f 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagListArrayAdapter.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagListArrayAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -110,7 +110,7 @@ private void handleToggle(boolean onOffValue, List onNames, ImageView ic
if (name != null) {
if (onOffValue && !onNames.contains(name))
onNames.add(name);
- if (!onOffValue && onNames.contains(name))
+ if (!onOffValue)
onNames.remove(name);
icon.setImageDrawable(ResourceUtils.getDrawable(getContext(),(onOffValue) ? id_drawable_on : id_drawable_off));
}
@@ -268,9 +268,7 @@ protected boolean match(String lowerCaseSearchString, Tag value) {
final String valueText = name.toLowerCase();
// First match against the whole, non-splitted value
- if (valueText.contains(lowerCaseSearchString)) {
- return true;
- }
+ return valueText.contains(lowerCaseSearchString);
}
return false;
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagWorflow.java b/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagWorflow.java
index 5c5f2ed4..71df7217 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagWorflow.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagWorflow.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -104,14 +104,14 @@ protected int updateTags(TagSql.TagWorflowItem tagWorflowItemFromDB, List currentItemTags = tagWorflowItemFromDB.tags;
try {
MetaWriterExifXml exif = MetaWriterExifXml.create (tagWorflowItemFromDB.path, null, false, "updateTags:");
- List tagsDbPlusFile = this.getUpdated(currentItemTags, exif.getTags(), null);
+ List tagsDbPlusFile = getUpdated(currentItemTags, exif.getTags(), null);
if (tagsDbPlusFile != null) {
mustSave = true;
dbgSaveReason += "jpg/xmp has more tags than sql.";
currentItemTags = tagsDbPlusFile;
}
- List modifiedTags = this.getUpdated(currentItemTags, addedTags, removedTags);
+ List modifiedTags = getUpdated(currentItemTags, addedTags, removedTags);
if (modifiedTags != null) {
// tags have changed.
currentItemTags = modifiedTags;
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagsPickerFragment.java b/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagsPickerFragment.java
index 84061932..460f7d4c 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagsPickerFragment.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagsPickerFragment.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-18 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -88,7 +88,7 @@ boolean onOk(List addNames,
List removeNames);
boolean onTagPopUpClick(int menuItemItemId, Tag selectedTag);
- };
+ }
private ITagsPicker mFragmentOnwner = null;
private boolean mIsFilterMode = true;
diff --git a/app/src/main/java/de/k3b/android/osmdroid/MarkerBubblePopup.java b/app/src/main/java/de/k3b/android/osmdroid/MarkerBubblePopup.java
index e76c4f16..81fd203e 100644
--- a/app/src/main/java/de/k3b/android/osmdroid/MarkerBubblePopup.java
+++ b/app/src/main/java/de/k3b/android/osmdroid/MarkerBubblePopup.java
@@ -1,3 +1,21 @@
+/*
+ * Copyright (c) 2016-2019 by k3b.
+ *
+ * This file is part of AndroFotoFinder / #APhotoManager.
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see
+ */
package de.k3b.android.osmdroid;
import android.app.Activity;
@@ -63,7 +81,7 @@ protected void bindString(final String debugContext, View view, int resourceId,
if (childView != null) {
childView.setVisibility(View.VISIBLE);
if (childView instanceof Button) {
- ((Button) childView).setOnClickListener(new View.OnClickListener() {
+ childView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
MarkerBubblePopup.this.onBubbleButtonClick(debugContext, v, strValue);
@@ -73,7 +91,7 @@ public void onClick(View v) {
Spanned html = Html.fromHtml(strValue);
((TextView) childView).setText(html);
} else if (childView instanceof ImageButton) {
- ((ImageButton) childView).setOnClickListener(new View.OnClickListener() {
+ childView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
MarkerBubblePopup.this.onBubbleButtonClick(debugContext, v, strValue);
diff --git a/app/src/main/java/de/k3b/android/osmdroid/OsmdroidUtil.java b/app/src/main/java/de/k3b/android/osmdroid/OsmdroidUtil.java
index cde37568..69beafe0 100644
--- a/app/src/main/java/de/k3b/android/osmdroid/OsmdroidUtil.java
+++ b/app/src/main/java/de/k3b/android/osmdroid/OsmdroidUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2016 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of LocationMapViewer.
*
@@ -62,7 +62,7 @@ public static int zoomTo(MapView mapView, int zoom, IGeoPoint min, IGeoPoint max
// int pixels = Math.min(mapView.getWidth(), mapView.getHeight());
double pixels = Math.sqrt((mapView.getWidth() * mapView.getWidth()) + (mapView.getHeight() * mapView.getHeight()));
final double requiredMinimalGroundResolutionInMetersPerPixel
- = ((double) new GeoPoint(min.getLatitude(), min.getLongitude()).distanceToAsDouble(max)) / pixels;
+ = new GeoPoint(min.getLatitude(), min.getLongitude()).distanceToAsDouble(max) / pixels;
calculatedZoom = calculateZoom(center.getLatitude(), requiredMinimalGroundResolutionInMetersPerPixel, getMaximumZoomLevel(tileProvider), tileProvider.getMinimumZoomLevel());
}
}
diff --git a/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java b/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java
index cdecaf13..afd742fb 100644
--- a/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java
+++ b/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2017 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -82,9 +82,7 @@ private static File[] scan(File mapDir) {
File[] files = (mapDir == null) ? null : mapDir.listFiles(new FileFilter() {
@Override
public boolean accept(File pathname) {
- if (pathname.getName().toLowerCase().endsWith(".map"))
- return true;
- return false;
+ return pathname.getName().toLowerCase().endsWith(".map");
}
});
return files;
diff --git a/app/src/main/java/de/k3b/android/util/AndroidFileCommands.java b/app/src/main/java/de/k3b/android/util/AndroidFileCommands.java
index 76f8977a..5b9a7305 100644
--- a/app/src/main/java/de/k3b/android/util/AndroidFileCommands.java
+++ b/app/src/main/java/de/k3b/android/util/AndroidFileCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2018 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -107,7 +107,7 @@ protected void onPreProcess(String what, int opCode, SelectedFiles selectedFiles
}
// a nomedia file is affected => must update gui
- this.mHasNoMedia = mScanner.isNoMedia(22, oldPathNames) || MediaScanner.isNoMedia(22, newPathNames);
+ this.mHasNoMedia = MediaScanner.isNoMedia(22, oldPathNames) || MediaScanner.isNoMedia(22, newPathNames);
super.onPreProcess(what, opCode, selectedFiles, oldPathNames, newPathNames);
}
diff --git a/app/src/main/java/de/k3b/android/util/FileManagerUtil.java b/app/src/main/java/de/k3b/android/util/FileManagerUtil.java
index f5e68481..0410ad68 100644
--- a/app/src/main/java/de/k3b/android/util/FileManagerUtil.java
+++ b/app/src/main/java/de/k3b/android/util/FileManagerUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -82,7 +82,7 @@ public static boolean hasShowInFilemanager(Activity context, String path) {
}
private static boolean isInstalled(Context context, Intent intent) {
- final List list = ((PackageManager)context.getPackageManager()).queryIntentActivities(intent, 0);
+ final List list = context.getPackageManager().queryIntentActivities(intent, 0);
return ((list != null) && (list.size() > 0));
}
diff --git a/app/src/main/java/de/k3b/android/util/MediaScannerAsyncTask.java b/app/src/main/java/de/k3b/android/util/MediaScannerAsyncTask.java
index c9ef422d..00b45454 100644
--- a/app/src/main/java/de/k3b/android/util/MediaScannerAsyncTask.java
+++ b/app/src/main/java/de/k3b/android/util/MediaScannerAsyncTask.java
@@ -1,3 +1,21 @@
+/*
+ * Copyright (c) 2016-2019 by k3b.
+ *
+ * This file is part of AndroFotoFinder / #APhotoManager.
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see
+ */
package de.k3b.android.util;
import android.content.Context;
@@ -42,7 +60,7 @@ protected void onPostExecute(Integer modifyCount) {
}
if (modifyCount > 0) {
- mScanner.notifyChanges(mContext, mWhy);
+ MediaScanner.notifyChanges(mContext, mWhy);
}
}
@@ -56,7 +74,7 @@ public static void updateMediaDBInBackground(MediaScanner scanner, Context conte
// Continute in background task
int modifyCount = scanner.updateMediaDatabase_Android42(context.getApplicationContext(), oldPathNames, newPathNames);
if (modifyCount > 0) {
- scanner.notifyChanges(context, why + " within current non-gui-task");
+ MediaScanner.notifyChanges(context, why + " within current non-gui-task");
}
}
}
diff --git a/app/src/main/java/de/k3b/android/widget/AsyncTaskWithProgressDialog.java b/app/src/main/java/de/k3b/android/widget/AsyncTaskWithProgressDialog.java
index a281fecf..c0bf5f9f 100644
--- a/app/src/main/java/de/k3b/android/widget/AsyncTaskWithProgressDialog.java
+++ b/app/src/main/java/de/k3b/android/widget/AsyncTaskWithProgressDialog.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -65,7 +65,7 @@ protected void onCancelled(Integer result) {
destroy();
}
- public void close() throws IOException {
+ public void close() {
destroy();
}
public void destroy() {
diff --git a/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java b/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java
index 2e54f7c3..2d7a52cc 100644
--- a/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java
+++ b/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2018 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -571,14 +571,13 @@ private void openPicker(final int filterMode, int _dirQueryID) {
final IDirectory currentDirectoryRoot = getiDirectoryRoot(dirQueryID);
if (currentDirectoryRoot == null) {
// not loaded yet. load directoryRoot in background
- ;
final QueryParameter mergedBaseQuery = FotoSql.getQuery(dirQueryID);
mergedBaseQuery.getWhereFrom(mGalleryQueryParameter.mGalleryContentBaseQuery, false);
if (mergedBaseQuery != null) {
this.mMustShowNavigator = true;
mergedBaseQuery.setID(dirQueryID);
- DirectoryLoaderTask loader = new DirectoryLoaderTask(context, loadDate ? LibGlobal.datePickerUseDecade : false,
+ DirectoryLoaderTask loader = new DirectoryLoaderTask(context, loadDate && LibGlobal.datePickerUseDecade,
mDebugPrefix + " from openPicker(dirQueryID=" +
FotoSql.getName(getApplicationContext(), dirQueryID) + ")") {
@Override
diff --git a/app/src/main/java/io/github/lonamiwebs/stringlate/utilities/Api.java b/app/src/main/java/io/github/lonamiwebs/stringlate/utilities/Api.java
index 301efea5..50cb7470 100644
--- a/app/src/main/java/io/github/lonamiwebs/stringlate/utilities/Api.java
+++ b/app/src/main/java/io/github/lonamiwebs/stringlate/utilities/Api.java
@@ -1,3 +1,21 @@
+/*
+ * Copyright (c) 2015-2019 by k3b.
+ *
+ * This file is part of AndroFotoFinder / #APhotoManager.
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see
+ */
package io.github.lonamiwebs.stringlate.utilities;
import android.app.Activity;
@@ -121,7 +139,7 @@ public static void install(final Activity context, int requestCode) throws Activ
* @return true, is installed
*/
private static boolean isInstalled(Context context, Intent intent) {
- final List list = ((PackageManager)context.getPackageManager()).queryIntentActivities(intent, 0);
+ final List list = context.getPackageManager().queryIntentActivities(intent, 0);
return ((list != null) && (list.size() > 0));
}
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index e0e2f8d4..c15474d0 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -29,7 +29,6 @@
Kann Album %1$s nicht löschen.
Album löschen?
Erstellt am %3$s mit \'%1$s\' Version %2$s. weitere Informationen finden Sie unter https://github.com/k3b/APhotoManager/wiki/intentapi#sql
- Lade Album aus…
Album speichern unter...
Ändern
Anhalten
diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml
index 680188f3..d49c43c1 100644
--- a/app/src/main/res/values-in/strings.xml
+++ b/app/src/main/res/values-in/strings.xml
@@ -28,7 +28,6 @@
Tidak dapat menghapus markah buku %1$s.
Hapus markah buku ini?
Ini dihasilkan %3$s dengan %1$s\' versi %2$s\'. Untuk detailnya, kunjungi https://github.com/k3b/APhotoManager/wiki/intentapi#sql
- Muat markah buku dari…
Simpan markah buku sebagai …
Ubah
Jeda
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index 342a20a0..dd4ce497 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -28,7 +28,6 @@
Nie można usunąć zakladkii %1$s.
Usunąć te zakładkę?
Wygenerowano na %3$s z \'%1$s\' Wersja %2$s. Zobacz https://github.com/k3b/APhotoManager/wiki/intentapi#sql
- Wczytaj zakładki z …
Zapisz zakładkę jako …
Zmień
Pauzuj
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index 4dcbccf9..30b2cebb 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -28,7 +28,6 @@
O marcador não pode ser deletado %1$s.
Deletar o marcador?
Gerado em %3$s com \'%1$s\' Versão %2$s. Veja https://github.com/k3b/APhotoManager/wiki/intentapi#sql para mais detalhes
- Carregar …
Salvar como …
Mudar
Pausar
diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml
index b86ab8fd..ba4fd653 100644
--- a/app/src/main/res/values-ro/strings.xml
+++ b/app/src/main/res/values-ro/strings.xml
@@ -29,7 +29,6 @@
Sterg acest marcaj?
Obtinut %3$s cu \'%1$s\' Versiunea%2$s. Pentru detalii vezi
https://github.com/k3b/APhotoManager/wiki/intentapi#sql
- Incarca marcaj de la …
Salveaza Marcajul ca …
Schimba
Pauza
diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml
index 6dd17901..c76c6b40 100644
--- a/app/src/main/res/values-tr/strings.xml
+++ b/app/src/main/res/values-tr/strings.xml
@@ -28,7 +28,6 @@
%1$s yer imi silinemedi.
Bu yer imi silinsin mi?
%3$s üzerinde \'%1$s\' %2$s versiyonu ile üretildi. Detaylar için https://github.com/k3b/APhotoManager/wiki/intentapi#sql adresine bakın.
- Yer imini al …
Yer imi olarak kaydet…
Değiştir
Duraklat
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index 6a11b7ac..788bc56b 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -30,7 +30,6 @@
使用\'%1$s\'(%2$s版)基於%3$s 生成。詳情參見https://github.com/k3b/APhotoManager/wiki/intentapi#sql
- 加載書簽…
書簽另存為...
變更
暫停
diff --git a/app/src/main/res/values-zz/strings.xml b/app/src/main/res/values-zz/strings.xml
index 2e7af8bb..97a0e93d 100644
--- a/app/src/main/res/values-zz/strings.xml
+++ b/app/src/main/res/values-zz/strings.xml
@@ -26,7 +26,6 @@
bookmark_delete_error_format Cannot delete bookmark %1$s.
bookmark_delete_question Delete this bookmark?
bookmark_file_comment_format Generated on %3$s with \'%1$s\' Version %2$s. See https://github.com/k3b/APhotoManager/wiki/intentapi#sql for details
- bookmark_load_from_menu_title Load bookmark from …
bookmark_save_as_menu_title Save bookmark as …
btn_change Change
btn_pause Pause
diff --git a/app/src/test/java/de/k3b/android/androFotoFinder/tagDB/TagSqlQueryParserTests.java b/app/src/test/java/de/k3b/android/androFotoFinder/tagDB/TagSqlQueryParserTests.java
index 9d831a34..704de4c5 100644
--- a/app/src/test/java/de/k3b/android/androFotoFinder/tagDB/TagSqlQueryParserTests.java
+++ b/app/src/test/java/de/k3b/android/androFotoFinder/tagDB/TagSqlQueryParserTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -35,40 +35,40 @@
*/
public class TagSqlQueryParserTests {
@Test
- public void shouldParseFull() throws Exception {
+ public void shouldParseFull() {
String FILTER_STRING = "1.23,2.34;3.45,4.56;2001-02-03,2005-12-31;/some/path/;q,^;%filter%;tag1,tag2,tag3;utag1,utag2,utag3;notags;3;4;2004-02-03,2009-12-31";
assertFilterQueryFilter(FILTER_STRING);
}
@Test
- public void shouldEmpty() throws Exception {
+ public void shouldEmpty() {
String FILTER_STRING = "";
assertFilterQueryFilter(FILTER_STRING);
}
@Test
- public void shouldParseNoGeo() throws Exception {
+ public void shouldParseNoGeo() {
String FILTER_STRING = "noGeoInfo";
assertFilterQueryFilter(FILTER_STRING);
}
@Test
- public void shouldParsePrivate() throws Exception {
+ public void shouldParsePrivate() {
assertFilterQueryFilter(VISIBILITY.PRIVATE);
}
@Test
- public void shouldParsePrivatePublic() throws Exception {
+ public void shouldParsePrivatePublic() {
assertFilterQueryFilter(VISIBILITY.PRIVATE_PUBLIC);
}
@Test
- public void shouldParsePublic() throws Exception {
+ public void shouldParsePublic() {
assertFilterQueryFilter(VISIBILITY.PUBLIC);
}
@Test
- public void shouldFilterFind() throws Exception {
+ public void shouldFilterFind() {
assertFilterFind("hello world", "shouldFilterFind");
}
@@ -156,43 +156,43 @@ private GalleryFilterParameter getParsedGalleryFilterParameter(QueryParameter re
//################ tag filter support
@Test
- public void shouldTagsNoneOnly() throws Exception {
+ public void shouldTagsNoneOnly() {
String FILTER_STRING = ";;;;;;;;notags";
assertFilterQueryFilter(FILTER_STRING,"shouldTagsNoneOnly");
}
@Test
- public void shouldTagsIncludeExcludeWithWildcards() throws Exception {
+ public void shouldTagsIncludeExcludeWithWildcards() {
String FILTER_STRING = ";;;;;;%tag%;%utag%";
assertFilterQueryFilter(FILTER_STRING,"shouldTagsIncludeExcludeWithWildcards");
}
@Test
- public void shouldTagsIncludeOrNone() throws Exception {
+ public void shouldTagsIncludeOrNone() {
String FILTER_STRING = ";;;;;;tag1,tag2,tag3;;notags";
assertFilterQueryFilter(FILTER_STRING,"shouldTagsIncludeOrNone");
}
@Test
- public void shouldTagsIncludeWithoutNone() throws Exception {
+ public void shouldTagsIncludeWithoutNone() {
String FILTER_STRING = ";;;;;;tag1,tag2,tag3";
assertFilterQueryFilter(FILTER_STRING,"shouldTagsIncludeWithoutNone");
}
@Test
- public void shouldTagsExcludeOrNone() throws Exception {
+ public void shouldTagsExcludeOrNone() {
String FILTER_STRING = ";;;;;;;tagexcl1,tagexcl2,tagexcl3;notags";
assertFilterQueryFilter(FILTER_STRING,"shouldTagsExcludeOrNone");
}
@Test
- public void shouldTagsExcludeWithoutNone() throws Exception {
+ public void shouldTagsExcludeWithoutNone() {
String FILTER_STRING = ";;;;;;;tagexcl1,tagexcl2,tagexcl3";
assertFilterQueryFilter(FILTER_STRING,"shouldTagsExcludeWithoutNone");
}
@Test
- public void shouldTagsIncludeExcludeOrNone() throws Exception {
+ public void shouldTagsIncludeExcludeOrNone() {
String FILTER_STRING = ";;;;;;tag1,tag2,tag3;tagexcl1,tagexcl2,tagexcl3;notags";
assertFilterQueryFilter(FILTER_STRING,"shouldTagsIncludeExcludeOrNone");
}
diff --git a/fastlane/metadata/android/en-US/changelogs/41.txt b/fastlane/metadata/android/en-US/changelogs/41.txt
index ea80ff52..9fd4c994 100644
--- a/fastlane/metadata/android/en-US/changelogs/41.txt
+++ b/fastlane/metadata/android/en-US/changelogs/41.txt
@@ -3,3 +3,5 @@ Changes from 0.7.2 to 0.7.3
* #132 improved Autoprocessing-Editor: Long press on Exif-Picker butten "..." : get lat/lon/description/tags from selected photos
* #133: Additional filtercriteria date-last-modified from ... to
* #21: Translation updates ja, nl
+* upgrade mpasforge offline map support from 0.6 (11/2015) to 0.10 (8/2018)
+* Bugfix infer DateTimeTaken from exif-TAG_DATETIME if not available in exif-TAG_DATETIME_ORIGINAL
diff --git a/fotolib2/build.gradle b/fotolib2/build.gradle
index f7b11ec8..aedfc4de 100644
--- a/fotolib2/build.gradle
+++ b/fotolib2/build.gradle
@@ -22,12 +22,12 @@ dependencies {
// https://github.com/drewnoakes/metadata-extractor/wiki/GettingStarted licence: http://www.apache.org/licenses/LICENSE-2.0
// 2.10.1 includes more recent xmpcore that generates java-8 bytecode not supported by android yet
- compile ('com.drewnoakes:metadata-extractor:2.10.1') { transitive = false; } // 2.8.1
+ compile ('com.drewnoakes:metadata-extractor:2.10.1') { transitive = false } // 2.8.1
// https://jitpack.io/com/github/k3b/ToGoZip/L2.0.15/build.log
// https://jitpack.io/com/github/k3b/ToGoZip/libK3bZip/L2.0.15/
// implementation('com.github.k3b.ToGoZip:libK3bZip:L2.0.15') { transitive = false; }
- implementation('com.github.k3b.ToGoZip:libK3bZip:v2.0.18.181224') { transitive = false; }
+ implementation('com.github.k3b.ToGoZip:libK3bZip:v2.0.18.181224') { transitive = false }
}
// workaround because android-studio does not make the test resources available
diff --git a/fotolib2/src/main/java/de/k3b/database/QueryParameter.java b/fotolib2/src/main/java/de/k3b/database/QueryParameter.java
index aaf47d58..c8eb2e5c 100644
--- a/fotolib2/src/main/java/de/k3b/database/QueryParameter.java
+++ b/fotolib2/src/main/java/de/k3b/database/QueryParameter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2017 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -287,7 +287,7 @@ public String toOrderBy() {
/************************** end properties *********************/
- public void save(OutputStream _out) throws IOException {
+ public void save(OutputStream _out) {
PrintWriter writer = null;
try {
writer = new PrintWriter(_out);
diff --git a/fotolib2/src/main/java/de/k3b/database/SqlTemplateEngine.java b/fotolib2/src/main/java/de/k3b/database/SqlTemplateEngine.java
index b0b9c51c..e1f3510f 100644
--- a/fotolib2/src/main/java/de/k3b/database/SqlTemplateEngine.java
+++ b/fotolib2/src/main/java/de/k3b/database/SqlTemplateEngine.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -79,7 +79,7 @@ private static void addExpression(StringBuilder result, String input, int start,
result
.append("ifnull(")
- .append(input.substring(start,endExpression));
+ .append(input, start, endExpression);
addConst(result, input, endExpression, end);
result
.append(",'')");
diff --git a/fotolib2/src/main/java/de/k3b/io/DirectoryFormatter.java b/fotolib2/src/main/java/de/k3b/io/DirectoryFormatter.java
index bd26cfd3..b51a438f 100644
--- a/fotolib2/src/main/java/de/k3b/io/DirectoryFormatter.java
+++ b/fotolib2/src/main/java/de/k3b/io/DirectoryFormatter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2018 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder.
*
@@ -105,7 +105,7 @@ public static String getLatLonPath(double latitude, double longitude) {
int lonPos = lon.indexOf(".") + 1;
for (int i = 1; i <= 2; i++) {
- result.append(lat.substring(0, latPos + i)).append(",").append(lon.substring(0, lonPos + i)).append("/");
+ result.append(lat, 0, latPos + i).append(",").append(lon, 0, lonPos + i).append("/");
}
return result.toString();
diff --git a/fotolib2/src/main/java/de/k3b/io/GeoRectangle.java b/fotolib2/src/main/java/de/k3b/io/GeoRectangle.java
index 5bc6b062..ca1049b8 100644
--- a/fotolib2/src/main/java/de/k3b/io/GeoRectangle.java
+++ b/fotolib2/src/main/java/de/k3b/io/GeoRectangle.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2018 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder.
*
@@ -212,7 +212,7 @@ public GeoRectangle setNonGeoOnly(boolean nonGeoOnly) {
}
public void setHasGeo() {
- if (isNonGeoOnly() || isEmpty((IGeoRectangle) this)) {
+ if (isNonGeoOnly() || isEmpty(this)) {
setNonGeoOnly(false);
setLogitude(-180.0, +180);
setLatitude(-90.0, +90.0);
diff --git a/fotolib2/src/main/java/de/k3b/io/IDirectory.java b/fotolib2/src/main/java/de/k3b/io/IDirectory.java
index 63c497a6..fb76be1c 100644
--- a/fotolib2/src/main/java/de/k3b/io/IDirectory.java
+++ b/fotolib2/src/main/java/de/k3b/io/IDirectory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2018 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder.
*
@@ -28,12 +28,12 @@
* Created by k3b on 04.08.2015.
*/
public interface IDirectory {
- public static final int DIR_FLAG_NONE = 0;
- public static final int DIR_FLAG_NOMEDIA = 1; // below linux hidden dir ".*" or below DIR_FLAG_NOMEDIA_ROOT
- public static final int DIR_FLAG_NOMEDIA_ROOT = 2; // containing ".nomedia"
+ int DIR_FLAG_NONE = 0;
+ int DIR_FLAG_NOMEDIA = 1; // below linux hidden dir ".*" or below DIR_FLAG_NOMEDIA_ROOT
+ int DIR_FLAG_NOMEDIA_ROOT = 2; // containing ".nomedia"
- public static final int DIR_FLAG_APM_DIR = 8; // containing ".apm"
- public static final int DIR_FLAG_VIRTUAL_DIR = 9; // containing "*.album"
+ int DIR_FLAG_APM_DIR = 8; // containing ".apm"
+ int DIR_FLAG_VIRTUAL_DIR = 9; // containing "*.album"
String APM_DIR_PREFIX = "§ ";
String getRelPath();
diff --git a/fotolib2/src/main/java/de/k3b/io/OSDirectory.java b/fotolib2/src/main/java/de/k3b/io/OSDirectory.java
index 9b001f3c..c0a74794 100644
--- a/fotolib2/src/main/java/de/k3b/io/OSDirectory.java
+++ b/fotolib2/src/main/java/de/k3b/io/OSDirectory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2018 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager
*
@@ -171,7 +171,7 @@ protected static IDirectory find(OSDirectory root, File file) {
OSDirectory result = (OSDirectory) findChildByRelPath(children, name);
if (result == null) {
- result = root.createOsDirectory(file, (OSDirectory) parentDir, null);
+ result = root.createOsDirectory(file, parentDir, null);
children.add(result);
}
return result;
diff --git a/fotolib2/src/main/java/de/k3b/io/StringUtils.java b/fotolib2/src/main/java/de/k3b/io/StringUtils.java
index b9af6dbd..f012b114 100644
--- a/fotolib2/src/main/java/de/k3b/io/StringUtils.java
+++ b/fotolib2/src/main/java/de/k3b/io/StringUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 by k3b.
+ * Copyright (c) 2018-2019 by k3b.
*
* This file is part of #APhotoManager (https://github.com/k3b/APhotoManager/)
* and #toGoZip (https://github.com/k3b/ToGoZip/).
@@ -32,7 +32,7 @@ public static int compare(String lhs, String rhs) {
/** null save function: return if both are null or both non-null are the same */
public static boolean equals(Object lhs, Object rhs) {
- if (lhs != null) return (rhs != null) ? lhs.equals(rhs) : false;
+ if (lhs != null) return (rhs != null) && lhs.equals(rhs);
return (rhs == null);
}
@@ -79,9 +79,6 @@ public static String trim(CharSequence str) {
return str.toString().trim();
}
- public static int length(CharSequence str) {
- return (str != null) ? str.length() : 0;
- }
public static int charCount(CharSequence str, char c) {
int result = 0;
@@ -97,6 +94,20 @@ public static int charCount(CharSequence str, char c) {
return result;
}
+ /// @Deprecated use Verson with CharSequence parameter instead of string
+ @Deprecated
+ public static int length(String str) {
+ return (str != null) ? str.length() : 0;
+ }
+ /// @Deprecated use Verson with CharSequence parameter instead of string
+ @Deprecated
+ public static boolean isNullOrEmpty(String str) {
+ return (0 == length(str));
+ }
+
+ public static int length(CharSequence str) {
+ return (str != null) ? str.length() : 0;
+ }
public static boolean isNullOrEmpty(CharSequence str) {
return (0 == length(str));
}
diff --git a/fotolib2/src/main/java/de/k3b/media/ExifInterface.java b/fotolib2/src/main/java/de/k3b/media/ExifInterface.java
index 651bfd3b..795ff684 100644
--- a/fotolib2/src/main/java/de/k3b/media/ExifInterface.java
+++ b/fotolib2/src/main/java/de/k3b/media/ExifInterface.java
@@ -1,7 +1,7 @@
// ExifInterface source code from android-6 - special version without jni
/*
* Copyright (C) 2007 The Android Open Source Project under the Apache License, Version 2.0
- * Copyright (C) 2016-2018 by k3b under the GPL-v3+.
+ * Copyright (C) 2016-2019 by k3b under the GPL-v3+.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -1419,7 +1419,7 @@ public void removeAttribute(String tag) {
* type and the content of the input stream. In each case, it reads the first three bytes to
* determine whether the image data format is JPEG or not.
*/
- private void loadAttributes(InputStream in) throws IOException {
+ private void loadAttributes(InputStream in) {
try {
// Initialize mAttributes.
for (int i = 0; i < EXIF_TAGS.length; ++i) {
@@ -2081,7 +2081,7 @@ private void readImageFileDirectory(ByteOrderAwarenessDataInputStream dataInputS
long nextEntryOffset = dataInputStream.peek() + 4; // next four bytes is for data
// offset or value.
// Look up a corresponding tag from tag number
- final ExifTag tag = (ExifTag) sNumner2ExifTag[hint].get(tagNumber);
+ final ExifTag tag = sNumner2ExifTag[hint].get(tagNumber);
if (DEBUG_INTERNAL) {
logDebug(getContextDebugMessage(hint, tagNumber, dataFormat, numberOfComponents, tag));
}
diff --git a/fotolib2/src/main/java/de/k3b/media/ImageMetaReader.java b/fotolib2/src/main/java/de/k3b/media/ImageMetaReader.java
index 1527a5fe..d8260869 100644
--- a/fotolib2/src/main/java/de/k3b/media/ImageMetaReader.java
+++ b/fotolib2/src/main/java/de/k3b/media/ImageMetaReader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -415,7 +415,7 @@ public int getOrientationInDegrees() {
@Override
- public void close() throws IOException {
+ public void close() {
}
diff --git a/fotolib2/src/main/java/de/k3b/media/JpgMetaWorkflow.java b/fotolib2/src/main/java/de/k3b/media/JpgMetaWorkflow.java
index 5a0d185b..303ea33f 100644
--- a/fotolib2/src/main/java/de/k3b/media/JpgMetaWorkflow.java
+++ b/fotolib2/src/main/java/de/k3b/media/JpgMetaWorkflow.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2018 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -24,6 +24,7 @@
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.util.EnumSet;
import java.util.List;
@@ -214,11 +215,12 @@ private StringBuilder createDebugStringBuilder(File filePath) {
* Get necessary rotation for image file from exif.
*
* @param fullPathToImageFile The filename.
+ * @param inputStream
* @return right-rotate (in degrees) image according to exifdata.
*/
- public static int getRotationFromExifOrientation(String fullPathToImageFile) {
+ public static int getRotationFromExifOrientation(String fullPathToImageFile, InputStream inputStream) {
try {
- ExifInterfaceEx exif = new ExifInterfaceEx(fullPathToImageFile, null, null, "getRotationFromExifOrientation");
+ ExifInterfaceEx exif = new ExifInterfaceEx(fullPathToImageFile, inputStream, null, "getRotationFromExifOrientation");
if (exif.isValidJpgExifFormat()) {
return MediaUtil.exifOrientationCode2RotationDegrees(exif.getAttributeInt(ExifInterfaceEx.TAG_ORIENTATION, 0), 0);
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaUtil.java b/fotolib2/src/main/java/de/k3b/media/MediaUtil.java
index 9c46d986..64fde23d 100644
--- a/fotolib2/src/main/java/de/k3b/media/MediaUtil.java
+++ b/fotolib2/src/main/java/de/k3b/media/MediaUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 by k3b.
+ * Copyright (c) 2016-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -64,7 +64,7 @@ public class MediaUtil {
/**
* used to identify a member of IMetaApi
*/
- public static enum FieldID {
+ public enum FieldID {
path,
dateTimeTaken,
title,
@@ -74,7 +74,7 @@ public static enum FieldID {
tags,
clasz,
visibility,
- };
+ }
// Translate exif-orientation code (0..8) to EXIF_ORIENTATION_CODE_2_ROTATION_DEGREES (clockwise)
@@ -214,12 +214,12 @@ private static int copyImpl(IMetaApi destination, IMetaApi source,
int changes = 0;
if (source != null) {
- boolean simulateDoNotCopy = (destination == null) ? true : _simulateDoNotCopy;
+ boolean simulateDoNotCopy = (destination == null) || _simulateDoNotCopy;
final EnumSet allowSetNulls = toEnumSet(_allowSetNulls);
String sValue;
sValue = source.getPath();
- if (allowed(sValue, (destination == null) ? null : destination.getPath()
+ if (allowedObject(sValue, (destination == null) ? null : destination.getPath()
, fields2copy, simulateDoNotCopy, overwriteExisting, allowSetNull, allowSetNulls
, FieldID.path, collectedChanges)) {
destination.setPath(sValue);
@@ -227,7 +227,7 @@ private static int copyImpl(IMetaApi destination, IMetaApi source,
}
Date dValue = source.getDateTimeTaken();
- if (allowed(dValue, (destination == null) ? null : destination.getDateTimeTaken()
+ if (allowedObject(dValue, (destination == null) ? null : destination.getDateTimeTaken()
, fields2copy, simulateDoNotCopy, overwriteExisting, allowSetNull, allowSetNulls
, FieldID.dateTimeTaken, collectedChanges)) {
destination.setDateTimeTaken(dValue);
@@ -247,7 +247,7 @@ private static int copyImpl(IMetaApi destination, IMetaApi source,
}
sValue = source.getTitle();
- if (allowed(sValue, (destination == null) ? null : destination.getTitle()
+ if (allowedObject(sValue, (destination == null) ? null : destination.getTitle()
, fields2copy, simulateDoNotCopy, overwriteExisting, allowSetNull, allowSetNulls
, FieldID.title, collectedChanges)) {
destination.setTitle(sValue);
@@ -255,7 +255,7 @@ private static int copyImpl(IMetaApi destination, IMetaApi source,
}
sValue = source.getDescription();
- if (allowed(sValue, (destination == null) ? null : destination.getDescription()
+ if (allowedObject(sValue, (destination == null) ? null : destination.getDescription()
, fields2copy, simulateDoNotCopy, overwriteExisting, allowSetNull, allowSetNulls
, FieldID.description, collectedChanges)) {
destination.setDescription(sValue);
@@ -269,7 +269,7 @@ private static int copyImpl(IMetaApi destination, IMetaApi source,
final VISIBILITY oldVisibility = (destination == null) ? null : destination.getVisibility();
if (VISIBILITY.isChangingValue(vValue) &&
- allowed(vValue, oldVisibility
+ allowedObject(vValue, oldVisibility
, fields2copy, simulateDoNotCopy, overwriteExisting, allowSetNull, allowSetNulls
, FieldID.visibility, collectedChanges)) {
destination.setVisibility(vValue);
@@ -278,7 +278,7 @@ private static int copyImpl(IMetaApi destination, IMetaApi source,
if (tValueModifiedNewTags != null) tValueNewTags = tValueModifiedNewTags;
}
- if (allowed(tValueNewTags, (destination == null) ? null : destination.getTags()
+ if (allowedObject(tValueNewTags, (destination == null) ? null : destination.getTags()
, fields2copy, simulateDoNotCopy, overwriteExisting, allowSetNull, allowSetNulls
, FieldID.tags, collectedChanges)) {
destination.setTags(tValueNewTags);
@@ -286,7 +286,7 @@ private static int copyImpl(IMetaApi destination, IMetaApi source,
}
Integer iValue = source.getRating();
- if (allowed(iValue, (destination == null) ? null : destination.getRating()
+ if (allowedObject(iValue, (destination == null) ? null : destination.getRating()
, fields2copy, simulateDoNotCopy, overwriteExisting, allowSetNull, allowSetNulls
, FieldID.rating, collectedChanges)) {
destination.setRating(iValue);
@@ -314,14 +314,14 @@ public static void setLatitudeLongitude(IMetaApi destination, Double _latitude,
private static boolean allowed(Double newValue, Double oldValue, EnumSet fields2copy, boolean simulateDoNotCopy, boolean overwriteExisting, boolean allowSetNull,
final EnumSet allowSetNulls, FieldID item, List collectedChanges) {
if (GeoUtil.equals(newValue, oldValue)) return false; // both are the same, no need to write again
- return allowed((Object) newValue, (Object) oldValue, fields2copy, simulateDoNotCopy, overwriteExisting, allowSetNull,
+ return allowedObject(newValue, oldValue, fields2copy, simulateDoNotCopy, overwriteExisting, allowSetNull,
allowSetNulls, item, collectedChanges);
}
- private static boolean allowed(Object newValue, Object oldValue,
- EnumSet fields2copy,
- boolean simulateDoNotCopy, boolean overwriteExisting, boolean allowSetNull,
- final EnumSet allowSetNulls, FieldID item, List collectedChanges) {
+ private static boolean allowedObject(Object newValue, Object oldValue,
+ EnumSet fields2copy,
+ boolean simulateDoNotCopy, boolean overwriteExisting, boolean allowSetNull,
+ final EnumSet allowSetNulls, FieldID item, List collectedChanges) {
// in simulate mode return false as success; in non-simulate return true
boolean success = !simulateDoNotCopy;
@@ -381,12 +381,9 @@ public static boolean isImage(String path, int imageTypeFlags) {
return true;
}
- if ((IMG_TYPE_PRIVATE == (imageTypeFlags & IMG_TYPE_PRIVATE)) &&
- (lcPath.endsWith(EXT_JPG_PRIVATE))) {
- return true;
- }
+ return (IMG_TYPE_PRIVATE == (imageTypeFlags & IMG_TYPE_PRIVATE)) &&
+ (lcPath.endsWith(EXT_JPG_PRIVATE));
- return false;
}
/** returns the full path that item should get or null if path is already ok */
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaXmpFieldDefinition.java b/fotolib2/src/main/java/de/k3b/media/MediaXmpFieldDefinition.java
index 5c77ed7f..f8de941c 100644
--- a/fotolib2/src/main/java/de/k3b/media/MediaXmpFieldDefinition.java
+++ b/fotolib2/src/main/java/de/k3b/media/MediaXmpFieldDefinition.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2017 by k3b.
+ * Copyright (c) 2016-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -62,11 +62,11 @@ public enum MediaXmpFieldDefinition {
private final XmpNamespace xmpNamespace;
private final int arrayOption;
- private MediaXmpFieldDefinition(XmpNamespace xmpNamespace) {
+ MediaXmpFieldDefinition(XmpNamespace xmpNamespace) {
this(xmpNamespace, PropertyOptions.NO_OPTIONS);
}
- private MediaXmpFieldDefinition(XmpNamespace xmpNamespace, int arrayOption) {
+ MediaXmpFieldDefinition(XmpNamespace xmpNamespace, int arrayOption) {
this.xmpNamespace = xmpNamespace;
this.arrayOption = arrayOption;
}
diff --git a/fotolib2/src/main/java/de/k3b/media/XmpNamespace.java b/fotolib2/src/main/java/de/k3b/media/XmpNamespace.java
index f7c397de..45eaa313 100644
--- a/fotolib2/src/main/java/de/k3b/media/XmpNamespace.java
+++ b/fotolib2/src/main/java/de/k3b/media/XmpNamespace.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2017 by k3b.
+ * Copyright (c) 2016-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -49,7 +49,7 @@ public enum XmpNamespace {
private final String prefix;
private final String uri;
- private XmpNamespace(String prefix, String uri) {
+ XmpNamespace(String prefix, String uri) {
this.prefix = prefix;
this.uri = uri;
diff --git a/fotolib2/src/main/java/de/k3b/media/XmpSegment.java b/fotolib2/src/main/java/de/k3b/media/XmpSegment.java
index 92819236..f44837e1 100644
--- a/fotolib2/src/main/java/de/k3b/media/XmpSegment.java
+++ b/fotolib2/src/main/java/de/k3b/media/XmpSegment.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 by k3b.
+ * Copyright (c) 2016-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -208,7 +208,7 @@ protected XMPMeta getXmpMeta() {
public XmpSegment setXmpMeta(XMPMeta xmpMeta, String dbg_context) {
if (dbg_context != null) {
- this.dbg_context = dbg_context + DBG_PREFIX;
+ XmpSegment.dbg_context = dbg_context + DBG_PREFIX;
}
this.xmpMeta = xmpMeta;
@@ -236,7 +236,7 @@ public XmpSegment load(File file, String dbg_context) throws FileNotFoundExcepti
// workaround: my android-4.2 tahblet cannot re-read it-s xmp without trailing "\n"
if ((file != null) && file.exists()) {
try {
- setXmpMeta(XMPMetaFactory.parse(FileUtils.streamFromStringContent(FileUtils.readFile(file) + "\n")), this.dbg_context);
+ setXmpMeta(XMPMetaFactory.parse(FileUtils.streamFromStringContent(FileUtils.readFile(file) + "\n")), XmpSegment.dbg_context);
} catch (IOException e1) {
onError("->XmpSegment.load-via-string " + file, e);
} catch (XMPException e1) {
@@ -265,7 +265,7 @@ public XmpSegment save(File file, boolean humanReadable, String dbg_context) thr
public XmpSegment save(OutputStream os, boolean humanReadable, String dbg_context) {
if (dbg_context != null) {
- this.dbg_context = dbg_context + DBG_PREFIX;
+ XmpSegment.dbg_context = dbg_context + DBG_PREFIX;
}
// humanReadable = false;
diff --git a/fotolib2/src/main/java/de/k3b/tagDB/TagRepository.java b/fotolib2/src/main/java/de/k3b/tagDB/TagRepository.java
index 66f36e13..fda9a6db 100644
--- a/fotolib2/src/main/java/de/k3b/tagDB/TagRepository.java
+++ b/fotolib2/src/main/java/de/k3b/tagDB/TagRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2017 by k3b.
+ * Copyright (c) 2016-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -299,7 +299,7 @@ public void load(List result, Reader reader) throws IOException {
*/
if (valid) {
- result.add((Tag) item);
+ result.add(item);
indents.add(getIndent(rawLine));
}
@@ -362,7 +362,7 @@ protected Tag loadItem(String line) {
* The method can be overwritten to create custom Item types.
*/
protected Tag create() {
- return (Tag) new Tag();
+ return new Tag();
}
/** Save source-points to writer */
diff --git a/fotolib2/src/test/java/de/k3b/csv2db/csv/TestCsv.java b/fotolib2/src/test/java/de/k3b/csv2db/csv/TestCsv.java
index 4fd80e08..30322c9c 100644
--- a/fotolib2/src/test/java/de/k3b/csv2db/csv/TestCsv.java
+++ b/fotolib2/src/test/java/de/k3b/csv2db/csv/TestCsv.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 by k3b.
+ * Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder.
*
@@ -30,7 +30,7 @@
public class TestCsv {
@Test
- public void emptyReaderShouldReturnNoData() throws Throwable {
+ public void emptyReaderShouldReturnNoData() {
Reader inputStream = TestUtil.createReader("");
CsvReader parser = new CsvReader(inputStream);
@@ -39,7 +39,7 @@ public void emptyReaderShouldReturnNoData() throws Throwable {
}
@Test
- public void shouldReturn2TabColums() throws Throwable {
+ public void shouldReturn2TabColums() {
Reader inputStream = TestUtil.createReader("a\tb");
CsvReader parser = new CsvReader(inputStream);
@@ -48,7 +48,7 @@ public void shouldReturn2TabColums() throws Throwable {
}
@Test
- public void shouldReturn2SemicolonColums() throws Throwable {
+ public void shouldReturn2SemicolonColums() {
Reader inputStream = TestUtil.createReader("a;\"b;something\nmulti;line\"");
CsvReader parser = new CsvReader(inputStream);
@@ -57,7 +57,7 @@ public void shouldReturn2SemicolonColums() throws Throwable {
}
@Test
- public void shouldReturnNullOn2ndLine() throws Throwable {
+ public void shouldReturnNullOn2ndLine() {
Reader inputStream = TestUtil.createReader("a;b");
CsvReader parser = new CsvReader(inputStream);
@@ -67,7 +67,7 @@ public void shouldReturnNullOn2ndLine() throws Throwable {
}
@Test
- public void shouldNotReturnNullOn2ndLine() throws Throwable {
+ public void shouldNotReturnNullOn2ndLine() {
Reader inputStream = TestUtil.createReader("a;b\nc");
CsvReader parser = new CsvReader(inputStream);
@@ -77,23 +77,23 @@ public void shouldNotReturnNullOn2ndLine() throws Throwable {
}
@Test
- public void shouldCountLines() throws Throwable {
+ public void shouldCountLines() {
Reader inputStream = TestUtil.createReader("a\n\"b;something\nmulti;line\"\n");
CsvReader parser = new CsvReader(inputStream);
- while (null!=parser.readLine()) {};
-
- assertEquals(3, parser.getLineNumner());
+ while (null!=parser.readLine()) {}
+
+ assertEquals(3, parser.getLineNumner());
}
@Test
- public void shouldCountRecordNumber() throws Throwable {
+ public void shouldCountRecordNumber() {
Reader inputStream = TestUtil.createReader("a\n\"b;something\nmulti;line\"\n");
CsvReader parser = new CsvReader(inputStream);
- while (null!=parser.readLine()) {};
-
- assertEquals(2, parser.getRecordNumber());
+ while (null!=parser.readLine()) {}
+
+ assertEquals(2, parser.getRecordNumber());
}
diff --git a/fotolib2/src/test/java/de/k3b/io/FileCommandAutoIntegrationTests.java b/fotolib2/src/test/java/de/k3b/io/FileCommandAutoIntegrationTests.java
index dd8c2635..4e369f45 100644
--- a/fotolib2/src/test/java/de/k3b/io/FileCommandAutoIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/io/FileCommandAutoIntegrationTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -74,7 +74,7 @@ public static void setUpClass() throws IOException {
LOGGER.info(" outdir:" + OUTDIR.getAbsolutePath());
}
@Before
- public void setUp() throws IOException {
+ public void setUp() {
LibGlobal.appName = "JUnit";
LibGlobal.appVersion = TEST_CLASS_NAME;
diff --git a/fotolib2/src/test/java/de/k3b/media/ExifInterfaceExIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/ExifInterfaceExIntegrationTests.java
index 47b5ccc3..34cbc5f5 100644
--- a/fotolib2/src/test/java/de/k3b/media/ExifInterfaceExIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/ExifInterfaceExIntegrationTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager
*
@@ -57,57 +57,48 @@ public void setup() throws IOException {
}
@Test
- public void shouldDump() throws IOException
- {
+ public void shouldDump() {
// System.out.printf(sut.toString());
logger.info("shouldDump " + sut.toString());
}
@Test
- public void shouldGetDescription() throws IOException
- {
+ public void shouldGetDescription() {
Assert.assertEquals("ImageDescription", sut.getDescription());
}
@Test
- public void shouldGetTitle() throws IOException
- {
+ public void shouldGetTitle() {
Assert.assertEquals("XPTitle", sut.getTitle());
}
@Test
- public void shouldGetDateTimeTaken() throws IOException
- {
+ public void shouldGetDateTimeTaken() {
Assert.assertEquals("1962-11-07T09:38:46", DateUtil.toIsoDateTimeString(sut.getDateTimeTaken()));
}
@Test
- public void shouldGetLatitude() throws IOException
- {
+ public void shouldGetLatitude() {
Assert.assertEquals(27.8186, sut.getLatitude(), 0.01);
}
@Test
- public void shouldGetLongitude() throws IOException
- {
+ public void shouldGetLongitude() {
Assert.assertEquals(-15.764, sut.getLongitude(), 0.01);
}
@Test
- public void shouldGetTags() throws IOException
- {
+ public void shouldGetTags() {
Assert.assertEquals("Marker1, Marker2", ListUtils.toString(", ", sut.getTags()));
}
@Test
- public void shouldGetRating() throws IOException
- {
+ public void shouldGetRating() {
Assert.assertEquals(3, sut.getRating().intValue());
}
@Test
- public void shouldModifyInMemory() throws IOException
- {
+ public void shouldModifyInMemory() {
MediaDTO expected = TestUtil.createTestMediaDTO(2);
expected.setVisibility(VISIBILITY.PUBLIC);
MediaUtil.copy(sut, expected, true, true);
@@ -121,8 +112,7 @@ public void shouldModifyInMemory() throws IOException
@Test
- public void shouldPreservePrivate() throws IOException
- {
+ public void shouldPreservePrivate() {
MediaDTO expected = TestUtil.createTestMediaDTO(2);
expected.setVisibility(VISIBILITY.PRIVATE);
MediaUtil.copy(sut, expected, true, true);
@@ -135,8 +125,7 @@ public void shouldPreservePrivate() throws IOException
}
@Test
- public void shouldClearInMemory() throws IOException
- {
+ public void shouldClearInMemory() {
MediaDTO expected = new MediaDTO();
expected.setVisibility(VISIBILITY.PUBLIC);
MediaUtil.copy(sut, expected, true, true);
diff --git a/fotolib2/src/test/java/de/k3b/media/ImageMetaReaderIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/ImageMetaReaderIntegrationTests.java
index 07288f57..bbe2bc46 100644
--- a/fotolib2/src/test/java/de/k3b/media/ImageMetaReaderIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/ImageMetaReaderIntegrationTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager
*
@@ -59,50 +59,42 @@ public void setup() throws IOException {
}
@Test
- public void shouldDump() throws IOException
- {
+ public void shouldDump() {
// System.out.printf(sut.toString());
logger.info(sut.toString());
}
@Test
- public void shouldGetDescription() throws IOException
- {
+ public void shouldGetDescription() {
Assert.assertEquals("ImageDescription", sut.getDescription());
}
@Test
- public void shouldGetTitle() throws IOException
- {
+ public void shouldGetTitle() {
Assert.assertEquals("XPTitle", sut.getTitle());
}
@Test
- public void shouldGetDateTimeTaken() throws IOException
- {
+ public void shouldGetDateTimeTaken() {
Assert.assertEquals("1962-11-07T09:38:46", DateUtil.toIsoDateTimeString(sut.getDateTimeTaken()));
}
@Test
- public void shouldGetLatitude() throws IOException
- {
+ public void shouldGetLatitude() {
Assert.assertEquals(27.8186, sut.getLatitude(), 0.01);
}
@Test
- public void shouldGetLongitude() throws IOException
- {
+ public void shouldGetLongitude() {
Assert.assertEquals(-15.764, sut.getLongitude(), 0.01);
}
@Test
- public void shouldGetTags() throws IOException
- {
+ public void shouldGetTags() {
Assert.assertEquals("Marker1, Marker2", ListUtils.toString(", ", sut.getTags()));
}
@Test
- public void shouldGetRating() throws IOException
- {
+ public void shouldGetRating() {
Assert.assertEquals(3, sut.getRating().intValue());
}
@@ -118,8 +110,7 @@ public void shouldGetExifList()
// low levelt implementaion detail test
@Test
- public void shouldIptcList() throws IOException
- {
+ public void shouldIptcList() {
List expected = ListUtils.toStringList("Marker1","Marker2");
sut.init();
List result = sut.getStringList("JUnit", sut.mIptcDir, IptcDirectory.TAG_KEYWORDS);
diff --git a/fotolib2/src/test/java/de/k3b/media/MediaMappingTests.java b/fotolib2/src/test/java/de/k3b/media/MediaMappingTests.java
index 19c1a0c2..ad1a767d 100644
--- a/fotolib2/src/test/java/de/k3b/media/MediaMappingTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/MediaMappingTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -51,7 +51,7 @@ public static void initDirectories() {
}
@Before
- public void setup() throws IOException {
+ public void setup() {
debugResult.setLength(0);
}
@@ -130,21 +130,21 @@ private static boolean isEmptyDbgImpl(StringBuilder debugResult, Object result,
}
@Test
- public void dump1ImageMetaReaderDummy() throws IOException {
+ public void dump1ImageMetaReaderDummy() {
IMetaApi sut = new ImageMetaReaderDummy();
dump(sut);
}
@Test
- public void dump2ExifInterfaceExDummy() throws IOException {
+ public void dump2ExifInterfaceExDummy() {
IMetaApi sut = new ExifInterfaceExDummy();
dump(sut);
}
@Test
- public void dump3MediaXmpSegmentDummy() throws IOException {
+ public void dump3MediaXmpSegmentDummy() {
IMetaApi sut = new MediaXmpSegmentDummy();
dump(sut);
@@ -152,7 +152,7 @@ public void dump3MediaXmpSegmentDummy() throws IOException {
@Test
- public void dump4MediaCsvItemDummy() throws IOException {
+ public void dump4MediaCsvItemDummy() {
IMetaApi sut = new MediaCsvItemDummy();
dump(sut);
}
diff --git a/fotolib2/src/test/java/de/k3b/media/MediaXmpSegmentIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/MediaXmpSegmentIntegrationTests.java
index 013802d8..f85177d1 100644
--- a/fotolib2/src/test/java/de/k3b/media/MediaXmpSegmentIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/MediaXmpSegmentIntegrationTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager
*
@@ -57,57 +57,48 @@ public void setup() throws IOException {
}
@Test
- public void shouldDump() throws IOException
- {
+ public void shouldDump() {
// System.out.printf(sut.toString());
logger.info("shouldDump " + sut.toString());
}
@Test
- public void shouldGetDescription() throws IOException
- {
+ public void shouldGetDescription() {
Assert.assertEquals("XPSubject", sut.getDescription());
}
@Test
- public void shouldGetTitle() throws IOException
- {
+ public void shouldGetTitle() {
Assert.assertEquals("Headline", sut.getTitle());
}
@Test
- public void shouldGetDateTimeTaken() throws IOException
- {
+ public void shouldGetDateTimeTaken() {
Assert.assertEquals("1962-11-07T09:38:46", DateUtil.toIsoDateTimeString(sut.getDateTimeTaken()));
}
@Test
- public void shouldGetLatitude() throws IOException
- {
+ public void shouldGetLatitude() {
Assert.assertEquals(27.8186, sut.getLatitude(), 0.01);
}
@Test
- public void shouldGetLongitude() throws IOException
- {
+ public void shouldGetLongitude() {
Assert.assertEquals(-15.764, sut.getLongitude(), 0.01);
}
@Test
- public void shouldGetTags() throws IOException
- {
+ public void shouldGetTags() {
Assert.assertEquals("Marker1, Marker2", ListUtils.toString(", ", sut.getTags()));
}
@Test
- public void shouldGetRating() throws IOException
- {
+ public void shouldGetRating() {
Assert.assertEquals(3, sut.getRating().intValue());
}
@Test
- public void shouldModifyInMemory() throws IOException
- {
+ public void shouldModifyInMemory() {
MediaDTO expected = TestUtil.createTestMediaDTO(2);
MediaUtil.copy(sut, expected, true, true);
MediaDTO actual = new MediaDTO();
@@ -119,8 +110,7 @@ public void shouldModifyInMemory() throws IOException
@Test
- public void shouldClearInMemory() throws IOException
- {
+ public void shouldClearInMemory() {
MediaDTO expected = new MediaDTO();
MediaUtil.copy(sut, expected, true, true);
MediaDTO actual = new MediaDTO();
@@ -131,7 +121,7 @@ public void shouldClearInMemory() throws IOException
logger.info("shouldClearInMemory " + sut.toString());
}
- private static IMetaApi getMeta(String fileName) throws IOException {
+ private static IMetaApi getMeta(String fileName) {
InputStream inputStream = TestUtil.getResourceInputStream(fileName);
MediaXmpSegment xmpContent = new MediaXmpSegment();
xmpContent.load(inputStream, "JUnit");
diff --git a/fotolib2/src/test/java/de/k3b/tagDB/TagProcessorTests.java b/fotolib2/src/test/java/de/k3b/tagDB/TagProcessorTests.java
index be4cd4a8..ecb8105d 100644
--- a/fotolib2/src/test/java/de/k3b/tagDB/TagProcessorTests.java
+++ b/fotolib2/src/test/java/de/k3b/tagDB/TagProcessorTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 by k3b.
+ * Copyright (c) 2017-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -43,39 +43,39 @@ public void setup() {
}
@Test
- public void shouldCalculateAffected() throws Exception {
+ public void shouldCalculateAffected() {
Assert.assertEquals("getAffected "+ ListUtils.toString(sut.getAffected()), 3, sut.getAffected().size());
}
@Test
- public void shouldCalculateAll() throws Exception {
+ public void shouldCalculateAll() {
Assert.assertEquals("getAllSet "+ ListUtils.toString(sut.getAllSet()), 1, sut.getAllSet().size());
}
@Test
- public void shouldGetUpdatedNone() throws Exception {
- List updated = sut.getUpdated(Arrays.asList("all", "single1"), Arrays.asList("single1"), Arrays.asList("nonExistent"));
+ public void shouldGetUpdatedNone() {
+ List updated = TagProcessor.getUpdated(Arrays.asList("all", "single1"), Arrays.asList("single1"), Arrays.asList("nonExistent"));
Assert.assertEquals(null, updated);
}
@Test
- public void shouldGetUpdatedAdded() throws Exception {
- List updated = sut.getUpdated(Arrays.asList("all", "single1"), Arrays.asList("single2"), Arrays.asList("nonExistent"));
+ public void shouldGetUpdatedAdded() {
+ List updated = TagProcessor.getUpdated(Arrays.asList("all", "single1"), Arrays.asList("single2"), Arrays.asList("nonExistent"));
Assert.assertEquals(ListUtils.toString(updated), 3, updated.size());
}
@Test
- public void shouldGetUpdatedRemoved() throws Exception {
- List updated = sut.getUpdated(Arrays.asList("all", "single1"), Arrays.asList("all"), Arrays.asList("single1"));
+ public void shouldGetUpdatedRemoved() {
+ List updated = TagProcessor.getUpdated(Arrays.asList("all", "single1"), Arrays.asList("all"), Arrays.asList("single1"));
Assert.assertEquals(ListUtils.toString(updated), 1, updated.size());
}
@Test
- public void shouldCalculateDiff() throws Exception {
+ public void shouldCalculateDiff() {
List addedTags = new ArrayList();
List removedTags = new ArrayList();
- int changes = sut.getDiff(Arrays.asList("a", "b"), Arrays.asList("a","c"), addedTags, removedTags);
+ int changes = TagProcessor.getDiff(Arrays.asList("a", "b"), Arrays.asList("a","c"), addedTags, removedTags);
Assert.assertEquals("removed", ListUtils.toString(Arrays.asList("b")), ListUtils.toString(removedTags) );
Assert.assertEquals("added", ListUtils.toString(Arrays.asList("c")), ListUtils.toString(addedTags));
@@ -83,7 +83,7 @@ public void shouldCalculateDiff() throws Exception {
}
@Test
- public void shouldFormatTagsForBat() throws Exception {
+ public void shouldFormatTagsForBat() {
Assert.assertEquals("empty", null, TagConverter.asBatString());
Assert.assertEquals("empty", "'a' 'b'".replaceAll("'","\""), TagConverter.asBatString("a","b"));
}
diff --git a/fotolib2/src/test/java/de/k3b/tagDB/TagRepositoryTests.java b/fotolib2/src/test/java/de/k3b/tagDB/TagRepositoryTests.java
index 605dff8b..066bb13b 100644
--- a/fotolib2/src/test/java/de/k3b/tagDB/TagRepositoryTests.java
+++ b/fotolib2/src/test/java/de/k3b/tagDB/TagRepositoryTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2017 by k3b.
+ * Copyright (c) 2016-2019 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -77,14 +77,14 @@ private TagRepository createUnsavedRepo(String name, String paths) {
/* load() reload() createId() delete(T item) save() */
@Test
- public void shouldLoadNonExistentIsEmpty() throws Exception {
+ public void shouldLoadNonExistentIsEmpty() {
List items = createUnsavedRepo("shouldLoadNonExistentIsEmpty", 0).load();
Assert.assertEquals(0, items.size());
}
@Test
- public void shouldSaveLoad() throws Exception {
+ public void shouldSaveLoad() {
createUnsavedRepo("shouldSaveLoad", 3).save();
List items = new TagRepository(this.repositoryFile).load();
@@ -93,7 +93,7 @@ public void shouldSaveLoad() throws Exception {
}
@Test
- public void shouldDeleteExistingItem() throws Exception {
+ public void shouldDeleteExistingItem() {
List items = createUnsavedRepo("shouldDeleteExistingItem", 3)
.save()
.delete(createItem(2))
@@ -102,7 +102,7 @@ public void shouldDeleteExistingItem() throws Exception {
}
@Test
- public void shouldNotDeleteNonExistingItem() throws Exception {
+ public void shouldNotDeleteNonExistingItem() {
List items = createUnsavedRepo("shouldNotDeleteNonExistingItem", 3)
.save()
.delete(createItem(7))
@@ -111,7 +111,7 @@ public void shouldNotDeleteNonExistingItem() throws Exception {
}
@Test
- public void shouldMerge() throws Exception {
+ public void shouldMerge() {
// 1,2,3
TagRepository originalItems = createUnsavedRepo("shouldIncludeItemB12", "a/b1/c,a/b2");
originalItems .save();
@@ -209,7 +209,7 @@ public void shouldIncludePathsWithInsert() throws Exception {
@Test
- public void shouldFindByString() throws Exception {
+ public void shouldFindByString() {
// 1,2,3
TagRepository items = createUnsavedRepo("shouldFindByString", 3);
@@ -263,7 +263,7 @@ public void shouldGetChildren() throws Exception {
TagRepository sut = new TagRepository(null);
sut.load(items, new StringReader(tagData));
- Tag a = sut.findFirstByName(items, "a");
+ Tag a = TagRepository.findFirstByName(items, "a");
List children = a.getChildren(items, true, false);
Assert.assertEquals(3, children.size());
}
@@ -282,14 +282,14 @@ public void shouldDelete() throws Exception {
TagRepository sut = new TagRepository(null);
sut.load(items, new StringReader(tagData));
- Tag a = sut.findFirstByName(items, "a");
+ Tag a = TagRepository.findFirstByName(items, "a");
int delCount = a.delete(items, false);
Assert.assertEquals("delCount", 1, delCount);
- a = sut.findFirstByName(items, "a");
+ a = TagRepository.findFirstByName(items, "a");
Assert.assertEquals("find a again", null, a);
- Tag z = sut.findFirstByName(items, "acz");
+ Tag z = TagRepository.findFirstByName(items, "acz");
Assert.assertEquals("z after delete", "/ac/acz", z.getPath());
}
@@ -308,14 +308,14 @@ public void shouldDeleteRecursive() throws Exception {
TagRepository sut = new TagRepository(null);
sut.load(items, new StringReader(tagData));
- Tag a = sut.findFirstByName(items, "a");
+ Tag a = TagRepository.findFirstByName(items, "a");
int delCount = a.delete(items, true);
List children = a.getChildren(items, false, false);
Assert.assertEquals("delCount", 4, delCount);
}
@Test
- public void shouldInsertHierarchy() throws Exception {
+ public void shouldInsertHierarchy() {
TagRepository sut = createUnsavedRepo("shouldInsertHierarchy", 0);
int changes = sut.includePaths(null,"a/b/c1,a/b/c2");
sut.save();
@@ -323,7 +323,7 @@ public void shouldInsertHierarchy() throws Exception {
}
@Test
- public void shouldInsertIfNotFound() throws Exception {
+ public void shouldInsertIfNotFound() {
TagRepository sut = createUnsavedRepo("shouldInsertIfNotFound", "a/b/c");
int changes = sut.includeTagNamesIfNotFound(ListUtils.fromString("c,b,q"));
sut.save();
@@ -331,7 +331,7 @@ public void shouldInsertIfNotFound() throws Exception {
}
@Test
- public void shouldRenameInHierachy() throws Exception {
+ public void shouldRenameInHierachy() {
TagRepository sut = createUnsavedRepo("shouldRenameInHierachy", "a/b/old/c,x/old/y");
int changes = sut.renameTags("old","new");
sut.save();
@@ -341,7 +341,7 @@ public void shouldRenameInHierachy() throws Exception {
}
@Test
- public void shouldFindByPath() throws Exception {
+ public void shouldFindByPath() {
List sut = createUnsavedRepo("shouldFindByPath", "a/b/c,x/y/z").load();
Tag root = Tag.findByPath(sut, null, "x/y");
@@ -353,7 +353,7 @@ public void shouldFindByPath() throws Exception {
}
@Test
- public void shouldNotFindByPath() throws Exception {
+ public void shouldNotFindByPath() {
List sut = createUnsavedRepo("shouldFindByPath", "a/b/c,x/y/z").load();
Tag root = Tag.findByPath(sut, null, "x/y");
@@ -365,7 +365,7 @@ public void shouldNotFindByPath() throws Exception {
}
@Test
- public void shouldGetPathElements() throws Exception {
+ public void shouldGetPathElements() {
String[] pathElemens = TagExpression.getPathElemens("/a");
Assert.assertEquals(2, pathElemens.length);
Assert.assertEquals("", pathElemens[0]);
diff --git a/fotolib2/src/test/java/de/k3b/translations/TranslationStatisticsTests.java b/fotolib2/src/test/java/de/k3b/translations/TranslationStatisticsTests.java
index d59ad809..72706bb4 100644
--- a/fotolib2/src/test/java/de/k3b/translations/TranslationStatisticsTests.java
+++ b/fotolib2/src/test/java/de/k3b/translations/TranslationStatisticsTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 by k3b.
+ * Copyright (c) 2018-2019 by k3b.
*
* This file is part of #APhotoManager (https://github.com/k3b/APhotoManager/)
* and #toGoZip (https://github.com/k3b/ToGoZip/).
@@ -47,7 +47,7 @@ public void dumpAsMD() {
final TranslationStatistics translationStatistics = new TranslationStatistics();
System.out.println("\n" +
- translationStatistics.formatterMarkdown.toString(translationStatistics.getLocaleInfos(), translationStatistics.english));
+ TranslationStatistics.formatterMarkdown.toString(translationStatistics.getLocaleInfos(), translationStatistics.english));
}
@Test
From 4031118725c28f94caf32d335f4523ec1922ca5f Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Tue, 12 Mar 2019 18:20:04 +0100
Subject: [PATCH 25/35] fixed build-errors ru-translation, osmdroid-6.0.3 not
compatible with mapsforge-0.10.0 yet
---
app/build.gradle | 11 +++++++++--
app/proguard-rules.pro | 6 +++++-
.../k3b/android/osmdroid/forge/MapsForgeSupport.java | 4 +++-
app/src/main/res/layout/fragment_tags.xml | 2 +-
app/src/main/res/values-ru/strings.xml | 2 +-
5 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index 4f0e39c9..1426d483 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -146,8 +146,15 @@ dependencies {
//Mapsforge rendering and database support, which is LGPL
// https://github.com/mapsforge/mapsforge/ 0.10.0 from 8/2018
- implementation 'org.mapsforge:mapsforge-map-android:0.10.0'
- implementation 'org.mapsforge:mapsforge-map:0.10.0'
+
+ implementation 'org.mapsforge:mapsforge-map-android:0.8.0'
+ implementation 'org.mapsforge:mapsforge-map:0.8.0'
+
+ //!!! mapsforge-*:0.10.0 requires osmdroid*:6.0.4 or later because call to
+ // !!! org.mapsforge.map.reader.ReadBuffer#setMaximumBufferSize(...) which was removed
+ //!!! implementation 'org.mapsforge:mapsforge-map-android:0.10.0'
+ //!!! implementation 'org.mapsforge:mapsforge-map:0.10.0'
+
implementation 'org.slf4j:slf4j-api:1.7.7@jar'
implementation 'eu.lp0.slf4j:slf4j-android:1.7.7-1@jar'
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
index 8cf54129..2a0c550f 100644
--- a/app/proguard-rules.pro
+++ b/app/proguard-rules.pro
@@ -21,7 +21,11 @@
-keep class org.xmlpull.** { *; }
-keep class de.k3b.android.widget.EditTextPreferenceWithSummary { *; }
-keep class de.k3b.android.widget.SearchViewWithHistory { *; }
--assumenosideeffects class com.google.android.gms.ads.MobileAds { *; }
+-dontnote MobileAds
+
+# removed in org.mapsforge:mapsforge-map-android:0.10.0
+# but still referenced in org.osmdroid.mapsforge.MapsForgeTileSource
+# -assumenosideeffects class org.mapsforge.map.reader.ReadBuffer { public void setMaximumBufferSize(...); }
###############
# I use proguard only to remove unused stuff and to keep the app small.
diff --git a/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java b/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java
index afd742fb..e7e85cd8 100644
--- a/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java
+++ b/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java
@@ -41,7 +41,9 @@ public static void createInstance(Application application) {
AndroidGraphicFactory.createInstance(application);
// see https://github.com/mapsforge/mapsforge/issues/868
- // ReadBuffer.setMaximumBufferSize(6500000);
+ // org.mapsforge:mapsforge-map:0.10.0
+ // TODO remove, when updgrade to org.mapsforge:mapsforge-map:0.10.0 and org.osmdroid:osmdroid-mapsforge:6.0.4
+ ReadBuffer.setMaximumBufferSize(6500000);
}
public static void load(Activity activity, MapView mMap, File mapsForgeDir) {
diff --git a/app/src/main/res/layout/fragment_tags.xml b/app/src/main/res/layout/fragment_tags.xml
index 6edf03fe..22deb6be 100644
--- a/app/src/main/res/layout/fragment_tags.xml
+++ b/app/src/main/res/layout/fragment_tags.xml
@@ -91,7 +91,7 @@
android:layout_alignParentBottom="true"
/>
- Файл «%1$s» уже существует. \n Вы действительно хотите перезаписать его?
Не удается переименовать файл «%1$s».
Нет фотографий в %1$s.
- Фото пока не найдено в базе данных мультимедиа% %1$s. Сканирование %2$d новых файлов. Отсутствующее фото будет доступно в ближайшее время.
+ Фото пока не найдено в базе данных мультимедиа %1$s. Сканирование %2$d новых файлов. Отсутствующее фото будет доступно в ближайшее время.
"Загрузка (%1$d)…"
Обновлены фотографии %1$d.
Дата
From 0c716421cb82a2dc843b21ad211176893162ac5c Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Tue, 2 Apr 2019 10:12:46 +0200
Subject: [PATCH 26/35] =?UTF-8?q?#21:=20pt-BR=20by=20Lucas=20Magalh=C3=A3e?=
=?UTF-8?q?s=20(whoisroot)=20and=20Leonardo=20Lima=20(LeonardodeLima)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/src/debug/res/values-pt-rBR/fdroid.xml | 36 +++
app/src/main/res/values-pt-rBR/strings.xml | 239 +++++++++++++++---
.../android/pt-BR/short_description.txt | 1 +
fastlane/metadata/android/pt-BR/title.txt | 1 +
4 files changed, 239 insertions(+), 38 deletions(-)
create mode 100644 app/src/debug/res/values-pt-rBR/fdroid.xml
create mode 100644 fastlane/metadata/android/pt-BR/short_description.txt
create mode 100644 fastlane/metadata/android/pt-BR/title.txt
diff --git a/app/src/debug/res/values-pt-rBR/fdroid.xml b/app/src/debug/res/values-pt-rBR/fdroid.xml
new file mode 100644
index 00000000..59b4e545
--- /dev/null
+++ b/app/src/debug/res/values-pt-rBR/fdroid.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+ Um Gerenciador de Fotos (A Photo Manager)
+
+ Gerenciar fotos locais: Encontrar/Copiar/Editar e mostrar na Galeria ou Mapa.
+
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index 30b2cebb..372ccfce 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -2,7 +2,8 @@
- Sobre um Gerenciador de Fotos%1$s
- Selecione a área do mapa
- Fundo
- Marcador deletado %1$s.
- O marcador não pode ser deletado %1$s.
- Deletar o marcador?
- Gerado em %3$s com \'%1$s\' Versão %2$s. Veja https://github.com/k3b/APhotoManager/wiki/intentapi#sql para mais detalhes
- Salvar como …
- Mudar
- Pausar
- Arquivos %1$d/%2$d copiados
- Deletar
- "Você tem certeza de que quer deletar esses arquivos permanentemente?
+ Sobre um Gerenciador de Fotos%1$s
+ Selecione a área do mapa
+ Fundo
+ Álbum
+ Marcador deletado %1$s.
+ O marcador não pode ser deletado %1$s.
+ Deletar o marcador?
+ Gerado em %3$s com \'%1$s\' Versão %2$s. Veja https://github.com/k3b/APhotoManager/wiki/intentapi#sql para mais detalhes
+ Salvar como …
+ Mudar
+ Pausar
+ Arquivos %1$d/%2$d copiados
+ Deletar
+ "Você tem certeza de que quer deletar esses arquivos permanentemente?
%1$s
Essa operação não pode ser revertida."
- Deletar foto(s)?
- Arquivos %1$d/%2$d deletados
- Destino da cópia
- Destino para mover
- Detalhes
- Escolher o editor de fotos
- Editor de fotos não encontrado
- Editar
- "\'%1$s\' protegido contra cópia.
+ Deletar foto(s)?
+ Arquivos %1$d/%2$d deletados
+ Destino da cópia
+ Destino para mover
+ Detalhes
+ Escolher o editor de fotos
+ Editor de fotos não encontrado
+ Editar
+ "\'%1$s\' protegido contra cópia.
Não é possível \'%2$s.\'"
- \'%1$s\' não é uma data válida.
- \'%1$s\' não é uma coordenada válida.
- Filtro
- Selecionar %1$s
- Falha no carregamento da pasta %1$s
- Filtro de pasta
- Fotos
- Mostrar no mapa
+ \'%1$s\' não é uma data válida.
+ \'%1$s\' não é uma coordenada válida.
+ Filtro
+ Selecionar %1$s
+ Falha no carregamento da pasta %1$s
+ Filtro de pasta
+ Fotos
+ Mostrar no mapa
+ Abrir em aplicativo de geolocalização
+ Definir localização
+ Mudando informacoes de geolocalização das fotos selecionadas
+ Seletor de localização não encontrado
+ Selecione uma nova localização para foto
+ Erro SQL %1$s\'\n\n%2$s
+ SQL inválida. Recarregando padrão
+ Erro no sistema. Saindo
+ O arquivo \'%1$s\' já exite. \n Você realmente quer sobrescrever isso?
+ Impossível renomear o arquivo \'%1$s\'.
+ Nenhuma foto encontrada para %1$s.
+ Foto não encontrada no banco de dados de mídia %1$s ainda. Verificando %2$d novos arquivos. A foto faltando estará disponível em breve.
+ "Carregando (%1$d) …"
+ %1$d fotos atualizadas.
+ Data
+ Lat
+ Lon
+ Localização
+ Sem informações de geolocalização
+ nova_pasta
+ Criar Pasta
+ Não foi possível criar %1$s
+ Criado em %1$s
+ Mais…
+ Mover
+ %1$d/%2$d arquivos movidos
+ Blocos de mapa © OpenStreetMap colaboradores
+ Substituir?
+ Renomear
+ Renomeado %1$d/%2$d arquivos
+ Onde começar a verificação?
+ Não é possível processar arquivos de fotos enquanto o leitor de mídia do Android estiver ocupado. Tente novamente mais tarde.
+ Scanner de mídia
+ %1$d Itens de mídia atualizados
+ %1$d Selected
+ Select folder to load pictures from and click ok
+ Selected only
+ Selection: Add all visible
+ Selection: Remove all visible
+ Diagnostics
+ … containing executed SQL.
+ … containing gridview/listview Items.
+ LogCat memory consumption
+ LogCat jpg/xmp metadata read/write
+ … of 3rd party libraries.
+ LogCat misc.
+ … containing other log messages.
+ Clear LogCat
+ Save LogCat to file
+ Errorlog folder
+ Auto hide actionbar after millisecs
+ Initial photo-view in better quality (slow, needs more memory)
+ Improve initial photo-view quality
+ Slideshow interval in millisecs
+ Language
+ System default
+ Max. selected markers in map
+ Set geo history count
+ Set geo history file
+ Clear multi-selection after action
+ Copy, move, rename, etc.
+ Settings
+ No share/send provider found
+ Too many items selected to share at once
+ Share/Send
+ Show in new gallery
+ Slideshow
+ Date
+ Folder
+ Name
+ File path length
+ Unsorted
+ Place
+ Sort
+ Updated %1$d/%2$d files
+ Zoom to fit
+ Show thumbnail for big images
+ Show thumbnail in image detail view if image width or height is bigger than this value (pixels). Memory efficient, fast, but low quality.
+ Thumbnail folder
+ Use Mapsforge offline map
+ ... which you manually downloaded via pc
+ Mapsforge offline Folder
+ Show Photo(s)
+ Repair duplicates
+ Pick Geo from Photo
+ Pick Geo from Map
+ Hide Images
+ "Are you sure?
- Abrir em aplicativo de geolocalização
- Definir localização
- Mudando informacoes de geolocalização das fotos selecionadas
- Seletor de localização não encontrado
- Erro no sistema. Saindo
- Impossível renomear o arquivo \'%1$s\'.
- "Carregando (%1$d) …"
+Do you want to make all media files (photo, video, audio) below
+
+ %1$s
+
+invisible for media database, gallery apps and the media scanner?
+
+You can undo hiding by calling the mediascanner from gallery-menu."
+ Part of Folder or Filename. %=Wildcard
+ Find
+ Part of Tags, Title, Description or Path
+ Public Image
+ Private Image
+ With no Tags
+ +Tags
+ -Tags
+ Tag
+ Tag Filter
+ Type here to filter ...
+ No matching tags found
+ Set Tags
+ Create new Tag
+ new_tag
+ Delete children
+ Update tags in affected photos
+ Long-Tap on tagname opens menu
+ Activities,People,Places,Themes,Projects
+ Write changes to
+ jpg and xmp (Create if not found)
+ jpg (and xmp if exists)
+ jpg file only
+ xmp file only
+ Long Xmp Sidecar File Name?
+ Long: file.jpg.xmp; Short: file.xmp
+
+ Load Context ...
+
+ Edit Exif
+ Title
+ Description
+ Rating
+
+ Rating
+ Last Modified
+
+ Edit Photo Autoprocessing
+ Filename Pattern
+ Exif
+
+ "%1$s %2$d Photos\n\t%3$s (%4$s), …\nTo %5$s\n\t%6$s"
+
+ Size
+ Width
+
+ Visibility
+
+ App protected/pinned
+ App unprotect/unpinned
+
+ Rename private *.jpg to *.jpg-p
+ Clear
+ Open in Filemanager
+
+ Searchbar
+ Date Picker: use decades
+ I.E. Put 2010, 2011,...2019 below 2010*
+ Date Filter
+
+ Edit Virtual Album
+
+ Bookmark folder
diff --git a/fastlane/metadata/android/pt-BR/short_description.txt b/fastlane/metadata/android/pt-BR/short_description.txt
new file mode 100644
index 00000000..0368702a
--- /dev/null
+++ b/fastlane/metadata/android/pt-BR/short_description.txt
@@ -0,0 +1 @@
+Gerenciar fotos locais: Encontrar/Copiar/Editar e mostrar na Galeria ou Mapa.
\ No newline at end of file
diff --git a/fastlane/metadata/android/pt-BR/title.txt b/fastlane/metadata/android/pt-BR/title.txt
new file mode 100644
index 00000000..eb5b585d
--- /dev/null
+++ b/fastlane/metadata/android/pt-BR/title.txt
@@ -0,0 +1 @@
+Um Gerenciador de Fotos (A Photo Manager)
\ No newline at end of file
From 29dd2a6392abacdbcad4542c29d1c4857376b698 Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Tue, 2 Apr 2019 11:02:02 +0200
Subject: [PATCH 27/35] DDD Ubiqus languange: Use PhotoProperties instead of
exif, JpgMetaWorkflow, Media, MetaApi
---
app/build.gradle | 9 ++
app/src/main/AndroidManifest.xml | 4 +-
.../androFotoFinder/AdapterArrayHelper.java | 4 +-
.../androFotoFinder/AndroFotoFinderApp.java | 4 +-
.../PhotoAutoprocessingEditActivity.java | 35 +++---
....java => PhotoPropertiesEditActivity.java} | 86 +++++++--------
.../androFotoFinder/SettingsActivity.java | 8 +-
.../androFotoFinder/ThumbNailUtils.java | 4 +-
.../backup/Backup2ZipService.java | 18 ++--
.../backup/BackupActivity.java | 4 +-
.../directory/DirectoryPickerFragment.java | 8 +-
.../cursor/GalleryCursorAdapterFromArray.java | 5 +-
.../gallery/cursor/GalleryCursorFragment.java | 10 +-
.../ImageDetailActivityViewPager.java | 22 ++--
.../ImageDetailMetaDialogBuilder.java | 5 +-
.../ImagePagerAdapterFromCursor.java | 4 +-
.../ImagePagerAdapterFromCursorArray.java | 4 +-
.../imagedetail/ImagePagerAdapterStatic.java | 101 ++++++++++++++++++
.../imagedetail/PhotoViewEx.java | 4 +-
.../locationmap/GeoEditActivity.java | 5 +-
...roidPhotoPropertiesBulkUpdateService.java} | 14 +--
... PhotoPropertiesMediaDBContentValues.java} | 34 +++---
...toPropertiesMediaDBCsvImportActivity.java} | 23 ++--
...java => PhotoPropertiesMediaDBCursor.java} | 28 ++---
.../androFotoFinder/media/package-info.java | 6 +-
.../queries/AndroidAlbumUtils.java | 4 +-
.../android/androFotoFinder/tagDB/TagSql.java | 24 ++---
.../androFotoFinder/tagDB/TagWorflow.java | 16 +--
.../k3b/android/util/AndroidFileCommands.java | 50 ++++-----
... => PhotoPropertiesMediaFilesScanner.java} | 62 +++++------
...PropertiesMediaFilesScannerAsyncTask.java} | 16 +--
...ertiesMediaFilesScannerExifInterface.java} | 14 +--
...tiesMediaFilesScannerImageMetaReader.java} | 20 ++--
...PropertiesMediaFilesScannerAsyncTask.java} | 32 +++---
.../k3b/android/widget/BaseQueryActivity.java | 4 +-
.../de/k3b/android/widget/UpdateTask.java | 6 +-
app/src/main/res/layout/activity_media_db.xml | 2 +-
.../main/res/menu/menu_bookmark_contextl.xml | 46 --------
...ext.xml => menu_virtual_album_context.xml} | 0
app/src/main/res/values-de/strings.xml | 4 +-
app/src/main/res/values/strings.xml | 4 +-
.../src/main/java/de/k3b/io/FileCommands.java | 28 ++---
.../de/k3b/io/PhotoAutoprocessingDto.java | 16 +--
.../java/de/k3b/media/ExifInterfaceEx.java | 28 ++---
.../{IMetaApi.java => IPhotoProperties.java} | 42 ++++----
...=> PhotoProperties2ExistingFileSaver.java} | 6 +-
...ring.java => PhotoPropertiesAsString.java} | 30 +++---
... => PhotoPropertiesBulkUpdateService.java} | 50 ++++-----
...r.java => PhotoPropertiesChainReader.java} | 6 +-
...vItem.java => PhotoPropertiesCsvItem.java} | 64 +++++------
...aver.java => PhotoPropertiesCsvSaver.java} | 16 +--
...ava => PhotoPropertiesCsvStringSaver.java} | 4 +-
...{MediaDTO.java => PhotoPropertiesDTO.java} | 30 +++---
...Copy.java => PhotoPropertiesDiffCopy.java} | 30 +++---
...r.java => PhotoPropertiesImageReader.java} | 34 +++---
...java => PhotoPropertiesUpdateHandler.java} | 48 ++++-----
...ediaUtil.java => PhotoPropertiesUtil.java} | 58 +++++-----
...apper.java => PhotoPropertiesWrapper.java} | 30 +++---
...=> PhotoPropertiesXmpFieldDefinition.java} | 6 +-
...nt.java => PhotoPropertiesXmpSegment.java} | 96 ++++++++---------
.../main/java/de/k3b/media/XmpSegment.java | 26 ++---
.../MediaTransactionLogEntryType.java | 2 +-
.../transactionlog/TransactionLogParser.java | 4 +-
.../transactionlog/TransactionLoggerBase.java | 20 ++--
fotolib2/src/test/java/de/k3b/TestUtil.java | 10 +-
.../io/FileCommandAutoIntegrationTests.java | 36 +++----
.../ExifInterfaceExIntegrationTests.java | 30 +++---
.../media/ExifInterfaceIntegrationTests.java | 4 +-
.../test/java/de/k3b/media/MediaCsvTests.java | 34 +++---
.../java/de/k3b/media/MediaMappingTests.java | 33 +++---
.../test/java/de/k3b/media/MediaXmpTests.java | 26 ++---
...iesBulkUpdateServiceIntegratoinTests.java} | 12 +--
...java => PhotoPropertiesDiffCopyTests.java} | 74 ++++++-------
...ropertiesImageReaderIntegrationTests.java} | 14 +--
...pertiesUpdateHandlerIntegrationTests.java} | 72 ++++++-------
...sts.java => PhotoPropertiesUtilTests.java} | 82 +++++++-------
...PropertiesXmpSegmentIntegrationTests.java} | 30 +++---
showexif/src/main/java/de/k3b/ShowExif.java | 16 +--
78 files changed, 979 insertions(+), 921 deletions(-)
rename app/src/main/java/de/k3b/android/androFotoFinder/{ExifEditActivity.java => PhotoPropertiesEditActivity.java} (90%)
create mode 100644 app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterStatic.java
rename app/src/main/java/de/k3b/android/androFotoFinder/media/{AndroidJpgMetaWorkflow.java => AndroidPhotoPropertiesBulkUpdateService.java} (69%)
rename app/src/main/java/de/k3b/android/androFotoFinder/media/{MediaContentValues.java => PhotoPropertiesMediaDBContentValues.java} (80%)
rename app/src/main/java/de/k3b/android/androFotoFinder/media/{MediaDBActivity.java => PhotoPropertiesMediaDBCsvImportActivity.java} (90%)
rename app/src/main/java/de/k3b/android/androFotoFinder/media/{MediaCursor.java => PhotoPropertiesMediaDBCursor.java} (85%)
rename app/src/main/java/de/k3b/android/util/{MediaScanner.java => PhotoPropertiesMediaFilesScanner.java} (88%)
rename app/src/main/java/de/k3b/android/util/{MediaScannerAsyncTask.java => PhotoPropertiesMediaFilesScannerAsyncTask.java} (73%)
rename app/src/main/java/de/k3b/android/util/{MediaScannerExifInterface.java => PhotoPropertiesMediaFilesScannerExifInterface.java} (77%)
rename app/src/main/java/de/k3b/android/util/{MediaScannerImageMetaReader.java => PhotoPropertiesMediaFilesScannerImageMetaReader.java} (63%)
rename app/src/main/java/de/k3b/android/util/{RecursiveMediaScannerAsyncTask.java => RecursivePhotoPropertiesMediaFilesScannerAsyncTask.java} (82%)
delete mode 100644 app/src/main/res/menu/menu_bookmark_contextl.xml
rename app/src/main/res/menu/{menu_bookmark_context.xml => menu_virtual_album_context.xml} (100%)
rename fotolib2/src/main/java/de/k3b/media/{IMetaApi.java => IPhotoProperties.java} (79%)
rename fotolib2/src/main/java/de/k3b/media/{Media2ExistingFileSaver.java => PhotoProperties2ExistingFileSaver.java} (79%)
rename fotolib2/src/main/java/de/k3b/media/{MediaAsString.java => PhotoPropertiesAsString.java} (63%)
rename fotolib2/src/main/java/de/k3b/media/{JpgMetaWorkflow.java => PhotoPropertiesBulkUpdateService.java} (76%)
rename fotolib2/src/main/java/de/k3b/media/{MetaApiChainReader.java => PhotoPropertiesChainReader.java} (94%)
rename fotolib2/src/main/java/de/k3b/media/{MediaCsvItem.java => PhotoPropertiesCsvItem.java} (62%)
rename fotolib2/src/main/java/de/k3b/media/{MediaCsvSaver.java => PhotoPropertiesCsvSaver.java} (78%)
rename fotolib2/src/main/java/de/k3b/media/{MediaCsvStringSaver.java => PhotoPropertiesCsvStringSaver.java} (73%)
rename fotolib2/src/main/java/de/k3b/media/{MediaDTO.java => PhotoPropertiesDTO.java} (76%)
rename fotolib2/src/main/java/de/k3b/media/{MediaDiffCopy.java => PhotoPropertiesDiffCopy.java} (88%)
rename fotolib2/src/main/java/de/k3b/media/{ImageMetaReader.java => PhotoPropertiesImageReader.java} (93%)
rename fotolib2/src/main/java/de/k3b/media/{MetaWriterExifXml.java => PhotoPropertiesUpdateHandler.java} (82%)
rename fotolib2/src/main/java/de/k3b/media/{MediaUtil.java => PhotoPropertiesUtil.java} (88%)
rename fotolib2/src/main/java/de/k3b/media/{MetaApiWrapper.java => PhotoPropertiesWrapper.java} (75%)
rename fotolib2/src/main/java/de/k3b/media/{MediaXmpFieldDefinition.java => PhotoPropertiesXmpFieldDefinition.java} (94%)
rename fotolib2/src/main/java/de/k3b/media/{MediaXmpSegment.java => PhotoPropertiesXmpSegment.java} (61%)
rename fotolib2/src/test/java/de/k3b/media/{JpgMetaWorkflowIntegratoinTests.java => PhotoPropertiesBulkUpdateServiceIntegratoinTests.java} (81%)
rename fotolib2/src/test/java/de/k3b/media/{MediaDiffCopyTests.java => PhotoPropertiesDiffCopyTests.java} (59%)
rename fotolib2/src/test/java/de/k3b/media/{ImageMetaReaderIntegrationTests.java => PhotoPropertiesImageReaderIntegrationTests.java} (88%)
rename fotolib2/src/test/java/de/k3b/media/{MetaWriterExifXmlIntegrationTests.java => PhotoPropertiesUpdateHandlerIntegrationTests.java} (67%)
rename fotolib2/src/test/java/de/k3b/media/{MediaUtilTests.java => PhotoPropertiesUtilTests.java} (62%)
rename fotolib2/src/test/java/de/k3b/media/{MediaXmpSegmentIntegrationTests.java => PhotoPropertiesXmpSegmentIntegrationTests.java} (77%)
diff --git a/app/build.gradle b/app/build.gradle
index 1426d483..3ba47fef 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -54,7 +54,16 @@ android {
versionCode = 40
versionName = '0.7.2.181027'
+
+ // all supported locales
+ // resConfigs "ar","de","es","fr","hi","in","it","ja","nl","pl","ro","ru","tr","uk","zz","pt-rBR","zh-rCN","zh-rTW"
}
+
+
+
+ // does not remove german translations :-(
+ // sourceSets.main.res.filter.exclude '**/res/values-de/**'
+
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 7f17fd57..1803f85a 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -217,7 +217,7 @@
-
@@ -451,7 +451,7 @@
-
ExifEditActivity.showActivity(" +
+ + " > PhotoPropertiesEditActivity.showActivity(" +
debugContext + ")");
}
final Intent intent = new Intent().setClass(context,
- ExifEditActivity.class);
+ PhotoPropertiesEditActivity.class);
intent.setAction(Intent.ACTION_EDIT);
if (exifDataToEdit != null) {
- final String exifAsString = MediaAsString.toString(exifDataToEdit);
+ final String exifAsString = PhotoPropertiesAsString.toString(exifDataToEdit);
intent.putExtra(EXTRA_EXIF_DATA, exifAsString);
} else if (!saveChangesToUri) {
// special edit exif via intent without initial value
@@ -204,8 +204,8 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
onCreateButtos();
- mCurrentData = new MediaAsString();
- mInitialData = new MediaAsString();
+ mCurrentData = new PhotoPropertiesAsString();
+ mInitialData = new PhotoPropertiesAsString();
if (savedInstanceState != null) {
VISIBILITY priv = null;
@@ -223,7 +223,7 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mActivityData.setVisibility(priv);
} else {
Intent intent = getIntent();
- IMetaApi currentData = getExifParam(intent);
+ IPhotoProperties currentData = getExifParam(intent);
if (null == currentData) {
// there is no ExifParam : infer exif from jpg file
@@ -231,7 +231,7 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
File first = (items != null) ? items.getFile(0) : null;
if ((first != null) && (first.exists())) {
- currentData = MediaScanner.getInstance(this).getExifFromFile(first);
+ currentData = PhotoPropertiesMediaFilesScanner.getInstance(this).getExifFromFile(first);
}
}
mCurrentData.setData(currentData);
@@ -261,10 +261,10 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
new HashTagEditWatcher(this, edDescription);
}
- public static IMetaApi getExifParam(Intent intent) {
+ public static IPhotoProperties getExifParam(Intent intent) {
String exifAsString = intent.getStringExtra(EXTRA_EXIF_DATA);
if (!StringUtils.isNullOrEmpty(exifAsString)) {
- return new MediaAsString().fromString(exifAsString);
+ return new PhotoPropertiesAsString().fromString(exifAsString);
}
return null;
}
@@ -302,19 +302,19 @@ private static SelectedFiles getSelectedFiles(String dbgContext, Context ctx, In
}
private void loadGuiFromExif(String function) {
- MediaUtil.copy(mActivityData, mCurrentData, true, true);
+ PhotoPropertiesUtil.copy(mActivityData, mCurrentData, true, true);
debugChanges(function);
}
private void saveGuiToExif(String function) {
- MediaUtil.copy(mCurrentData, mActivityData, true, true);
+ PhotoPropertiesUtil.copy(mCurrentData, mActivityData, true, true);
debugChanges(function);
}
// used to analyse error #91:.
private void debugChanges(String function) {
if (LibGlobal.debugEnabledJpgMetaIo){
- MediaDiffCopy diff = new MediaDiffCopy(true, true);
+ PhotoPropertiesDiffCopy diff = new PhotoPropertiesDiffCopy(true, true);
diff.setDiff(mInitialData, mCurrentData);
Log.d(LibGlobal.LOG_TAG, mDebugPrefix + " "
+ function + "\n\t"
@@ -445,7 +445,7 @@ public void showGeoPicker() {
startActivityForResult(Intent.createChooser(intent, getString(R.string.geo_edit_menu_title)), GEO_RESULT_ID);
// this.startActivityForResult(intent, RESULT_ID);
} catch (ActivityNotFoundException ex) {
- Toast.makeText(ExifEditActivity.this, R.string.geo_picker_err_not_found,Toast.LENGTH_LONG).show();
+ Toast.makeText(PhotoPropertiesEditActivity.this, R.string.geo_picker_err_not_found,Toast.LENGTH_LONG).show();
}
}
@@ -470,8 +470,8 @@ public void showTimePicker() {
int hour = c.get(Calendar.HOUR_OF_DAY);
int minute = c.get(Calendar.MINUTE);
- Dialog dlg1 = new TimePickerDialog(ExifEditActivity.this, mDateTimeApi, hour, minute,
- DateFormat.is24HourFormat(ExifEditActivity.this));
+ Dialog dlg1 = new TimePickerDialog(PhotoPropertiesEditActivity.this, mDateTimeApi, hour, minute,
+ DateFormat.is24HourFormat(PhotoPropertiesEditActivity.this));
dlg1.show();
setAutoClose(null, dlg1, null);
}
@@ -490,7 +490,7 @@ public void showDatePicker() {
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH);
int day = c.get(Calendar.DAY_OF_MONTH);
- DatePickerDialog dlg1 = new DatePickerDialog(ExifEditActivity.this, mDateTimeApi,
+ DatePickerDialog dlg1 = new DatePickerDialog(PhotoPropertiesEditActivity.this, mDateTimeApi,
year, month, day);
dlg1.show();
setAutoClose(null, dlg1, null);
@@ -562,16 +562,16 @@ public boolean onOk(List addNames, List removeNames) {
*/
@Override
public boolean onTagPopUpClick(int menuItemItemId, Tag selectedTag) {
- return TagsPickerFragment.handleMenuShow(menuItemItemId, selectedTag, ExifEditActivity.this, null);
+ return TagsPickerFragment.handleMenuShow(menuItemItemId, selectedTag, PhotoPropertiesEditActivity.this, null);
}
}
private static class HashTagEditWatcher implements TextWatcher {
private boolean enabled = true;
private EditText mEditView = null;
- private ExifEditActivity mActivity = null;
+ private PhotoPropertiesEditActivity mActivity = null;
- HashTagEditWatcher(ExifEditActivity activity, EditText editView) {
+ HashTagEditWatcher(PhotoPropertiesEditActivity activity, EditText editView) {
this.mEditView = editView;
this.mActivity = activity;
editView.setTag(this);
@@ -643,8 +643,8 @@ public static HashTagEditWatcher getWatcher(EditText editView) {
}
}
- private final IMetaApi mActivityData = new ActivityData();
- private class ActivityData implements IMetaApi {
+ private final IPhotoProperties mActivityData = new ActivityData();
+ private class ActivityData implements IPhotoProperties {
/**
* Normalized absolute path to file (jpg or xmp)
@@ -655,7 +655,7 @@ public String getPath() {
}
@Override
- public IMetaApi setPath(String filePath) {
+ public IPhotoProperties setPath(String filePath) {
return this;
}
@@ -668,13 +668,13 @@ public Date getDateTimeTaken() {
}
@Override
- public IMetaApi setDateTimeTaken(Date value) {
+ public IPhotoProperties setDateTimeTaken(Date value) {
edDate.setText(DateUtil.toIsoDateTimeString(value));
return this;
}
/** latitude, in degrees north. (-90 .. +90); longitude, in degrees east. (-180 .. + 180) */
- @Override public IMetaApi setLatitudeLongitude(Double latitude, Double longitude) {
+ @Override public IPhotoProperties setLatitudeLongitude(Double latitude, Double longitude) {
edLatitude.setText(GeoUtil.toCsvStringLatLon(latitude));
edLongitude.setText(GeoUtil.toCsvStringLatLon(longitude));
return this;
@@ -691,7 +691,7 @@ public Double getLongitude() {
}
@Override
- public IMetaApi setTitle(String title) {
+ public IPhotoProperties setTitle(String title) {
edTitle.setText(title);
return this;
}
@@ -710,7 +710,7 @@ public String getDescription() {
}
@Override
- public IMetaApi setDescription(String description) {
+ public IPhotoProperties setDescription(String description) {
edDescription.setText(description);
return this;
}
@@ -724,7 +724,7 @@ public List getTags() {
}
@Override
- public IMetaApi setTags(List tags) {
+ public IPhotoProperties setTags(List tags) {
edTagsInclude.setText(TagConverter.asDbString(null, tags));
return this;
}
@@ -739,7 +739,7 @@ public Integer getRating() {
}
@Override
- public IMetaApi setRating(Integer value) {
+ public IPhotoProperties setRating(Integer value) {
rating.setRating((value == null) ? 0 : value.intValue());
return this;
}
@@ -752,7 +752,7 @@ public VISIBILITY getVisibility() {
}
@Override
- public IMetaApi setVisibility(VISIBILITY priv) {
+ public IPhotoProperties setVisibility(VISIBILITY priv) {
checkActive = true;
chkPrivate.setChecked(false);
chkPublic.setChecked(false);
@@ -769,7 +769,7 @@ public IMetaApi setVisibility(VISIBILITY priv) {
@Override
public String toString() {
- return MediaUtil.toString(this);
+ return PhotoPropertiesUtil.toString(this);
}
}
@@ -815,7 +815,7 @@ private void onOk() {
//!!! todo #93: this code also in
AndroidFileCommands cmd = AndroidFileCommands.createFileCommand(this, true);
- MediaDiffCopy exifChanges = new MediaDiffCopy(true, true).setDiff(mInitialData, mCurrentData);
+ PhotoPropertiesDiffCopy exifChanges = new PhotoPropertiesDiffCopy(true, true).setDiff(mInitialData, mCurrentData);
if (exifChanges != null) {
if (!SYNC_UPDATE_EXIF) {
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java
index 63dc63da..e7f8ffbf 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java
@@ -40,9 +40,9 @@
import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.imagedetail.HugeImageLoader;
-import de.k3b.android.util.MediaScanner;
-import de.k3b.android.util.MediaScannerExifInterface;
-import de.k3b.android.util.MediaScannerImageMetaReader;
+import de.k3b.android.util.PhotoPropertiesMediaFilesScanner;
+import de.k3b.android.util.PhotoPropertiesMediaFilesScannerExifInterface;
+import de.k3b.android.util.PhotoPropertiesMediaFilesScannerImageMetaReader;
import de.k3b.android.widget.AboutDialogPreference;
import de.k3b.android.widget.ActivityWithCallContext;
import de.k3b.android.widget.LocalizedActivity;
@@ -327,7 +327,7 @@ private static void fixDefaults(Context context, File previousCacheRoot, File pr
// true if first run or change
if ((sOldEnableNonStandardIptcMediaScanner == null) || (sOldEnableNonStandardIptcMediaScanner.booleanValue() != Global.Media.enableIptcMediaScanner)) {
- MediaScanner.setInstance((Global.Media.enableIptcMediaScanner) ? new MediaScannerImageMetaReader(context) : new MediaScannerExifInterface(context));
+ PhotoPropertiesMediaFilesScanner.setInstance((Global.Media.enableIptcMediaScanner) ? new PhotoPropertiesMediaFilesScannerImageMetaReader(context) : new PhotoPropertiesMediaFilesScannerExifInterface(context));
sOldEnableNonStandardIptcMediaScanner = Global.Media.enableIptcMediaScanner;
}
}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/ThumbNailUtils.java b/app/src/main/java/de/k3b/android/androFotoFinder/ThumbNailUtils.java
index 628d009c..623dd3f8 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/ThumbNailUtils.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/ThumbNailUtils.java
@@ -38,7 +38,7 @@
import java.io.IOException;
import de.k3b.android.androFotoFinder.queries.FotoSql;
-import de.k3b.media.MediaUtil;
+import de.k3b.media.PhotoPropertiesUtil;
/**
* Service facade hiding com.nostra13.universalimageloader
@@ -131,7 +131,7 @@ private static void displayImageImpl(String uriString, ImageView imageView, Stri
/** @param exifOrientationCode either code 0..8 or rotation angle 0, 90, 180, 270 */
public static Bitmap rotateBitmap(Bitmap source, int exifOrientationCode) {
if (exifOrientationCode != 0) {
- int angle = MediaUtil.exifOrientationCode2RotationDegrees(exifOrientationCode, exifOrientationCode);
+ int angle = PhotoPropertiesUtil.exifOrientationCode2RotationDegrees(exifOrientationCode, exifOrientationCode);
if (ThumbNailUtils.DEBUG && Global.debugEnabledViewItem) {
Log.i(ThumbNailUtils.LOG_TAG, "rotateBitmap code=" + exifOrientationCode +
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/backup/Backup2ZipService.java b/app/src/main/java/de/k3b/android/androFotoFinder/backup/Backup2ZipService.java
index f3d39fbd..92dfc1fe 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/backup/Backup2ZipService.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/backup/Backup2ZipService.java
@@ -29,15 +29,15 @@
import java.io.InputStream;
import java.util.Date;
-import de.k3b.android.androFotoFinder.media.MediaCursor;
+import de.k3b.android.androFotoFinder.media.PhotoPropertiesMediaDBCursor;
import de.k3b.android.androFotoFinder.queries.FotoSql;
import de.k3b.android.androFotoFinder.tagDB.TagSql;
import de.k3b.database.QueryParameter;
import de.k3b.io.FileUtils;
import de.k3b.io.IItemSaver;
-import de.k3b.media.IMetaApi;
-import de.k3b.media.Media2ExistingFileSaver;
-import de.k3b.media.MediaCsvStringSaver;
+import de.k3b.media.IPhotoProperties;
+import de.k3b.media.PhotoProperties2ExistingFileSaver;
+import de.k3b.media.PhotoPropertiesCsvStringSaver;
import de.k3b.zip.IZipConfig;
import de.k3b.zip.LibZipGlobal;
import de.k3b.zip.ZipConfigRepository;
@@ -72,11 +72,11 @@ public static IZipConfig execute(IZipConfig zipConfig, ContentResolver contentRe
if (zipConfigFile != null) {
QueryParameter filter = getEffectiveQueryParameter(zipConfig);
- final MediaCsvStringSaver csv = new MediaCsvStringSaver();
+ final PhotoPropertiesCsvStringSaver csv = new PhotoPropertiesCsvStringSaver();
/// !!! todo go on here
final IItemSaver file2Zip = null;
- final Media2ExistingFileSaver media2file = new Media2ExistingFileSaver(file2Zip);
+ final PhotoProperties2ExistingFileSaver media2file = new PhotoProperties2ExistingFileSaver(file2Zip);
execQuery(filter, contentResolver, csv, media2file);
@@ -117,7 +117,7 @@ private static QueryParameter getEffectiveQueryParameter(IZipConfig zipConfig) {
}
private static void execQuery(QueryParameter query, ContentResolver contentResolver,
- IItemSaver... consumers) {
+ IItemSaver... consumers) {
Cursor cursor = null;
try {
cursor = contentResolver.query(Uri.parse(query.toFrom()), query.toColumns(),
@@ -126,9 +126,9 @@ private static void execQuery(QueryParameter query, ContentResolver contentResol
int itemCount = cursor.getCount();
final int expectedCount = itemCount + itemCount;
- MediaCursor mediaItem = new MediaCursor(cursor);
+ PhotoPropertiesMediaDBCursor mediaItem = new PhotoPropertiesMediaDBCursor(cursor);
while (cursor.moveToNext()) {
- for (IItemSaver consumer : consumers){
+ for (IItemSaver consumer : consumers){
if (consumer != null) consumer.save(mediaItem);
}
}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java
index fb316975..8d967d9a 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java
@@ -67,7 +67,7 @@
import de.k3b.io.StringUtils;
import de.k3b.io.collections.SelectedFiles;
import de.k3b.io.DateUtil;
-import de.k3b.media.MediaUtil;
+import de.k3b.media.PhotoPropertiesUtil;
import de.k3b.zip.IZipConfig;
import de.k3b.zip.LibZipGlobal;
import de.k3b.zip.ZipConfigDto;
@@ -520,7 +520,7 @@ private SelectedFiles getSelectedFiles(String dbgContext, Intent intent, boolean
String path = IntentUtil.getFilePath(this, IntentUtil.getUri(intent));
if (!StringUtils.isNullOrEmpty(path)) {
File rootDirFile = new File(path);
- String[] fileNames = rootDirFile.list(MediaUtil.JPG_FILENAME_FILTER);
+ String[] fileNames = rootDirFile.list(PhotoPropertiesUtil.JPG_FILENAME_FILTER);
int itemCount = (fileNames != null) ? fileNames.length : 0;
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/directory/DirectoryPickerFragment.java b/app/src/main/java/de/k3b/android/androFotoFinder/directory/DirectoryPickerFragment.java
index 39acb292..a773c80a 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/directory/DirectoryPickerFragment.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/directory/DirectoryPickerFragment.java
@@ -66,7 +66,7 @@
import de.k3b.android.util.ClipboardUtil;
import de.k3b.android.util.FileManagerUtil;
import de.k3b.android.util.IntentUtil;
-import de.k3b.android.util.MediaScanner;
+import de.k3b.android.util.PhotoPropertiesMediaFilesScanner;
import de.k3b.android.widget.Dialogs;
import de.k3b.database.QueryParameter;
import de.k3b.io.AlbumFile;
@@ -366,7 +366,7 @@ private PopupMenu onCreatePopupMenu(View anchor, IDirectory selection) {
mPopUpSelection = selection;
setMenuVisibility(menu, R.id.cmd_fix_link, FileUtils.isSymlinkDir(new File(absoluteSelectedPath), false));
- setMenuVisibility(menu, R.id.cmd_folder_hide_images, !isAlbumFile && MediaScanner.canHideFolderMedia(absoluteSelectedPath));
+ setMenuVisibility(menu, R.id.cmd_folder_hide_images, !isAlbumFile && PhotoPropertiesMediaFilesScanner.canHideFolderMedia(absoluteSelectedPath));
setMenuVisibility(menu, R.id.cmd_apm_edit, !isAlbumFile && LibGlobal.apmEnabled);
@@ -468,7 +468,7 @@ private boolean onHideFolderMediaQuestion(final String path) {
@Override
protected void onDialogResult(String result, Object[] parameters) {
if (result != null) {
- MediaScanner.hideFolderMedia(mContext, path);
+ PhotoPropertiesMediaFilesScanner.hideFolderMedia(mContext, path);
onDirectoryCancel();
if (mDirectoryListener != null) mDirectoryListener.invalidateDirectories("hide folder " + path);
}
@@ -673,7 +673,7 @@ private boolean fixLinks(IDirectory linkDir) {
FotoSql.deleteMedia("DirectoryPickerFragment.fixLinks", context, FotoSql.FILTER_COL_PK, new String[] {linkIds[i].toString()}, true);
}
}
- MediaScanner.notifyChanges(context, "Fixed link/canonical duplicates");
+ PhotoPropertiesMediaFilesScanner.notifyChanges(context, "Fixed link/canonical duplicates");
}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorAdapterFromArray.java b/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorAdapterFromArray.java
index c364f7cc..788696a0 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorAdapterFromArray.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorAdapterFromArray.java
@@ -34,10 +34,9 @@
import de.k3b.android.androFotoFinder.Global;
import de.k3b.android.androFotoFinder.ThumbNailUtils;
import de.k3b.android.androFotoFinder.imagedetail.HugeImageLoader;
-import de.k3b.android.util.MediaScanner;
+import de.k3b.android.util.PhotoPropertiesMediaFilesScanner;
import de.k3b.io.collections.SelectedFiles;
import de.k3b.io.collections.SelectedItems;
-import de.k3b.media.ExifInterface;
import de.k3b.media.ExifInterfaceEx;
/**
@@ -55,7 +54,7 @@ public class GalleryCursorAdapterFromArray extends GalleryCursorAdapter {
public GalleryCursorAdapterFromArray(final Activity context, SelectedItems selectedItems, String name, String fullPhotoPath) {
super(context, selectedItems, name);
- if (MediaScanner.isNoMedia(fullPhotoPath,MediaScanner.DEFAULT_SCAN_DEPTH)) {
+ if (PhotoPropertiesMediaFilesScanner.isNoMedia(fullPhotoPath, PhotoPropertiesMediaFilesScanner.DEFAULT_SCAN_DEPTH)) {
mArrayImpl = new AdapterArrayHelper(context, fullPhotoPath, "debugContext");
}
}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java b/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java
index ecb5f999..be3fb475 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java
@@ -55,9 +55,9 @@
import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.AffUtils;
+import de.k3b.android.androFotoFinder.PhotoPropertiesEditActivity;
import de.k3b.android.androFotoFinder.backup.BackupActivity;
import de.k3b.android.androFotoFinder.Common;
-import de.k3b.android.androFotoFinder.ExifEditActivity;
import de.k3b.android.androFotoFinder.FotoGalleryActivity;
import de.k3b.android.androFotoFinder.Global;
import de.k3b.android.androFotoFinder.LockScreen;
@@ -79,7 +79,7 @@
import de.k3b.android.androFotoFinder.tagDB.TagsPickerFragment;
import de.k3b.android.util.AndroidFileCommands;
import de.k3b.android.util.DBUtils;
-import de.k3b.android.util.MediaScanner;
+import de.k3b.android.util.PhotoPropertiesMediaFilesScanner;
import de.k3b.android.util.OsUtils;
import de.k3b.android.util.ResourceUtils;
import de.k3b.android.widget.AboutDialogPreference;
@@ -972,7 +972,7 @@ protected Integer doInBackground(List... params) {
}
private boolean onEditExif(SelectedFiles fotos) {
- ExifEditActivity.showActivity("[12]", getActivity(), null, null, fotos, 0, true);
+ PhotoPropertiesEditActivity.showActivity("[12]", getActivity(), null, null, fotos, 0, true);
return true;
}
@@ -1301,7 +1301,7 @@ private void replaceSelectedItems(SelectedItems selectedItems, StringBuffer debu
//-------------------------------------------------------------
private void fixMediaDatabase() {
- if (!MediaScanner.isScannerActive(getActivity().getContentResolver())) {
+ if (!PhotoPropertiesMediaFilesScanner.isScannerActive(getActivity().getContentResolver())) {
if (Global.debugEnabled) {
Log.d(Global.LOG_CONTEXT, "Analysing media database for potential problems");
}
@@ -1319,7 +1319,7 @@ private void repairMissingDisplayNames() {
@Override
protected void doInBackground(Long id, Cursor cursor) {
if (mPathColNo == -2) mPathColNo = cursor.getColumnIndex(FotoSql.SQL_COL_PATH);
- mResultCount += MediaScanner.getInstance(getActivity()).updatePathRelatedFields(getActivity(), cursor, cursor.getString(mPathColNo), mColumnIndexPK, mPathColNo);
+ mResultCount += PhotoPropertiesMediaFilesScanner.getInstance(getActivity()).updatePathRelatedFields(getActivity(), cursor, cursor.getString(mPathColNo), mColumnIndexPK, mPathColNo);
}
@Override
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailActivityViewPager.java b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailActivityViewPager.java
index 159f19d2..d64ecd57 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailActivityViewPager.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailActivityViewPager.java
@@ -52,7 +52,7 @@
import de.k3b.android.androFotoFinder.AffUtils;
import de.k3b.android.androFotoFinder.Common;
-import de.k3b.android.androFotoFinder.ExifEditActivity;
+import de.k3b.android.androFotoFinder.PhotoPropertiesEditActivity;
import de.k3b.android.androFotoFinder.FotoGalleryActivity;
import de.k3b.android.androFotoFinder.Global;
import de.k3b.android.androFotoFinder.LockScreen;
@@ -68,8 +68,8 @@
import de.k3b.android.util.AndroidFileCommands;
import de.k3b.android.util.FileManagerUtil;
import de.k3b.android.util.IntentUtil;
-import de.k3b.android.util.MediaScanner;
-import de.k3b.android.util.MediaScannerAsyncTask;
+import de.k3b.android.util.PhotoPropertiesMediaFilesScanner;
+import de.k3b.android.util.PhotoPropertiesMediaFilesScannerAsyncTask;
import de.k3b.android.util.OsUtils;
import de.k3b.android.widget.AboutDialogPreference;
import de.k3b.android.widget.ActivityWithCallContext;
@@ -84,7 +84,7 @@
import de.k3b.io.GalleryFilterParameter;
import de.k3b.io.IDirectory;
import de.k3b.io.StringUtils;
-import de.k3b.media.MediaUtil;
+import de.k3b.media.PhotoPropertiesUtil;
import de.k3b.tagDB.Tag;
/**
@@ -555,7 +555,7 @@ protected void onActivityResult(final int requestCode,
String orgiginalFileToScan = getCurrentFilePath();
if (orgiginalFileToScan != null) {
- MediaScanner.getInstance(this).updateMediaDatabase_Android42(this, null, orgiginalFileToScan);
+ PhotoPropertiesMediaFilesScanner.getInstance(this).updateMediaDatabase_Android42(this, null, orgiginalFileToScan);
}
}
@@ -774,7 +774,7 @@ private void refreshIfNecessary() {
* return false; activity must me closed
*/
private boolean checkForIncompleteMediaDatabase(String jpgFullFilePath, String why) {
- if (!MediaScanner.isNoMedia(jpgFullFilePath,MediaScanner.DEFAULT_SCAN_DEPTH)) {
+ if (!PhotoPropertiesMediaFilesScanner.isNoMedia(jpgFullFilePath, PhotoPropertiesMediaFilesScanner.DEFAULT_SCAN_DEPTH)) {
File fileToLoad = (jpgFullFilePath != null) ? new File(jpgFullFilePath) : null;
if ((!this.mWaitingForMediaScannerResult) && (fileToLoad != null) && (fileToLoad.exists()) && (fileToLoad.canRead())) {
@@ -805,7 +805,7 @@ private static int updateIncompleteMediaDatabase(String debugPrefix, Context con
if (existing != null) {
for (File file : existing) {
String found = file.getAbsolutePath();
- if (MediaUtil.isImage(found, MediaUtil.IMG_TYPE_ALL) && !known.contains(found)) {
+ if (PhotoPropertiesUtil.isImage(found, PhotoPropertiesUtil.IMG_TYPE_ALL) && !known.contains(found)) {
missing.add(found);
}
}
@@ -822,7 +822,7 @@ private static int updateIncompleteMediaDatabase(String debugPrefix, Context con
Log.d(Global.LOG_CONTEXT, message.toString());
}
- MediaScannerAsyncTask scanner = new MediaScannerAsyncTask(MediaScanner.getInstance(context), context, why);
+ PhotoPropertiesMediaFilesScannerAsyncTask scanner = new PhotoPropertiesMediaFilesScannerAsyncTask(PhotoPropertiesMediaFilesScanner.getInstance(context), context, why);
scanner.execute(null, missing.toArray(new String[missing.size()]));
return missing.size();
}
@@ -951,12 +951,12 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.cmd_gallery: {
reloadContext = false;
- String dirPath = getCurrentFilePath(); // MediaScanner.getDir().getAbsolutePath();
+ String dirPath = getCurrentFilePath(); // PhotoPropertiesMediaFilesScanner.getDir().getAbsolutePath();
if (dirPath != null) {
dirPath = FileUtils.getDir(dirPath).getAbsolutePath();
GalleryFilterParameter newFilter = new GalleryFilterParameter();
newFilter.setPath(dirPath);
- // int callBackId = (MediaScanner.isNoMedia(dirPath,MediaScanner.DEFAULT_SCAN_DEPTH)) ? NOMEDIA_GALLERY : 0;
+ // int callBackId = (PhotoPropertiesMediaFilesScanner.isNoMedia(dirPath,PhotoPropertiesMediaFilesScanner.DEFAULT_SCAN_DEPTH)) ? NOMEDIA_GALLERY : 0;
QueryParameter query = TagSql.filter2NewQuery(this.mFilter);
FotoGalleryActivity.showActivity("[13]" + dirPath, this, query, 0);
@@ -1091,7 +1091,7 @@ private boolean cmdMoveOrCopyWithDestDirPicker(final boolean move, String lastCo
}
private boolean onEditExif(SelectedFiles currentFoto, final long fotoId, final String fotoPath) {
- ExifEditActivity.showActivity("[16]:", this, null, fotoPath, currentFoto, 0, true);
+ PhotoPropertiesEditActivity.showActivity("[16]:", this, null, fotoPath, currentFoto, 0, true);
return true;
}
private boolean onRenameDirQueston(final SelectedFiles currentFoto, final long fotoId, final String fotoPath, final String _newName) {
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailMetaDialogBuilder.java b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailMetaDialogBuilder.java
index e0b5c6d7..c6e1c239 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailMetaDialogBuilder.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailMetaDialogBuilder.java
@@ -33,13 +33,12 @@
import java.util.Date;
import java.util.List;
-import de.k3b.android.androFotoFinder.R;
import de.k3b.android.androFotoFinder.tagDB.TagSql;
import de.k3b.android.widget.ActivityWithCallContext;
import de.k3b.io.DateUtil;
import de.k3b.media.ExifInterfaceEx;
import de.k3b.database.QueryParameter;
-import de.k3b.media.ImageMetaReader;
+import de.k3b.media.PhotoPropertiesImageReader;
import de.k3b.io.FileCommands;
import de.k3b.media.XmpSegment;
@@ -188,7 +187,7 @@ private static void addExif(StringBuilder builder, File file) throws IOException
if (file.exists()) {
builder.append(NL).append(file).append(NL).append(NL);
- ImageMetaReader meta = new ImageMetaReader().load(file.getAbsolutePath(),null, null, "ImageDetailMetaDialogBuilder");
+ PhotoPropertiesImageReader meta = new PhotoPropertiesImageReader().load(file.getAbsolutePath(),null, null, "ImageDetailMetaDialogBuilder");
if (meta != null) builder.append(meta.toString());
builder.append(NL).append(line).append(NL);
} else {
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterFromCursor.java b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterFromCursor.java
index 1e3873a7..db692cee 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterFromCursor.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterFromCursor.java
@@ -48,7 +48,7 @@
import de.k3b.android.androFotoFinder.queries.FotoSql;
import de.k3b.android.util.DBUtils;
import de.k3b.android.util.GarbageCollector;
-import de.k3b.media.JpgMetaWorkflow;
+import de.k3b.media.PhotoPropertiesBulkUpdateService;
import de.k3b.android.util.MenuUtils;
import de.k3b.android.util.ResourceUtils;
@@ -318,7 +318,7 @@ protected View createViewWithContent(int position, ViewGroup container, String f
setImageFromThumbnail(photoView, imageFile);
}
}
- final int rotationInDegrees = JpgMetaWorkflow.getRotationFromExifOrientation(fullPhotoPath, null);
+ final int rotationInDegrees = PhotoPropertiesBulkUpdateService.getRotationFromExifOrientation(fullPhotoPath, null);
if (Global.debugEnabledViewItem) {
Log.i(Global.LOG_CONTEXT, mDebugPrefix + debugContext + position +", rotation=" +
rotationInDegrees + ", "
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterFromCursorArray.java b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterFromCursorArray.java
index c103c77b..6d41dceb 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterFromCursorArray.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterFromCursorArray.java
@@ -29,7 +29,7 @@
import de.k3b.android.androFotoFinder.AdapterArrayHelper;
import de.k3b.android.androFotoFinder.Global;
-import de.k3b.android.util.MediaScanner;
+import de.k3b.android.util.PhotoPropertiesMediaFilesScanner;
/**
* Purpose: allow viewing images from ".nomedia" folders where no data is available in mediadb/cursor.
@@ -46,7 +46,7 @@ public class ImagePagerAdapterFromCursorArray extends ImagePagerAdapterFromCurso
public ImagePagerAdapterFromCursorArray(final Activity context, String name, String fullPhotoPath) {
super(context, name);
- if (MediaScanner.isNoMedia(fullPhotoPath,MediaScanner.DEFAULT_SCAN_DEPTH)) {
+ if (PhotoPropertiesMediaFilesScanner.isNoMedia(fullPhotoPath, PhotoPropertiesMediaFilesScanner.DEFAULT_SCAN_DEPTH)) {
mArrayImpl = new AdapterArrayHelper(context, fullPhotoPath, "debugContext");
}
}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterStatic.java b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterStatic.java
new file mode 100644
index 00000000..7e683b00
--- /dev/null
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImagePagerAdapterStatic.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2019 by k3b.
+ *
+ * This file is part of AndroFotoFinder / #APhotoManager.
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see
+ */
+
+package de.k3b.android.androFotoFinder.imagedetail;
+
+import android.content.Context;
+import android.net.Uri;
+import android.support.v4.view.PagerAdapter;
+import android.util.Log;
+import android.view.View;
+import android.view.ViewGroup;
+
+import java.io.InputStream;
+
+import de.k3b.android.androFotoFinder.Global;
+import de.k3b.io.FileUtils;
+import de.k3b.media.PhotoPropertiesBulkUpdateService;
+
+/**
+ * Adapter for android.support.v4.view.ViewPager for exactly one fixed image uri
+ */
+public class ImagePagerAdapterStatic extends PagerAdapter {
+ private final Uri imageUri;
+
+ public ImagePagerAdapterStatic(Uri imageUri) {
+
+ this.imageUri = imageUri;
+ }
+
+ @Override
+ public int getCount() {
+ return 1;
+ }
+
+ /**
+ * Implementation for PagerAdapter:
+ * Determines whether a page View is associated with a specific key object
+ * as returned by {@link #instantiateItem(ViewGroup, int)}. This method is
+ * required for a PagerAdapter to function properly.
+ *
+ * @param view Page View to check for association with object
+ * @param object Object to check for association with view
+ * @return true if view
is associated with the key object object
+ */
+ @Override
+ public boolean isViewFromObject(View view, Object object) {
+ return (view != null) && view.equals(object);
+ }
+ /**
+ * Implementation for PagerAdapter:
+ * Create the page for the given position. The adapter is responsible
+ * for adding the view to the container given here, although it only
+ * must ensure this is done by the time it returns from
+ * {@link #finishUpdate(ViewGroup)}.
+ *
+ * @param container The containing View in which the page will be shown.
+ * @param position The page position to be instantiated.
+ * @return Returns an Object representing the new page. This does not
+ * need to be a View, but can be some other container of the page.
+ */
+ @Override
+ public View instantiateItem(ViewGroup container, int position) {
+ final Context context = container.getContext();
+ PhotoViewEx photoView = new PhotoViewEx(context);
+
+ photoView.setMaximumScale(20);
+ photoView.setMediumScale(5);
+
+ InputStream inputStream = null;
+ try {
+ photoView.setImageURI(this.imageUri);
+ inputStream = context.getContentResolver().openInputStream(this.imageUri);
+ final int rotationInDegrees = PhotoPropertiesBulkUpdateService.getRotationFromExifOrientation(null, inputStream);
+
+ photoView.setRotationTo(rotationInDegrees);
+ } catch (Exception e) {
+ Log.e(Global.LOG_CONTEXT, this.imageUri + " : cannot show", e);
+ } finally {
+ FileUtils.close(inputStream, this.imageUri);
+ }
+ container.addView(photoView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
+ return photoView;
+ }
+
+}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/PhotoViewEx.java b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/PhotoViewEx.java
index f6366e52..b4700235 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/PhotoViewEx.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/PhotoViewEx.java
@@ -25,7 +25,7 @@
import java.io.File;
-import de.k3b.media.JpgMetaWorkflow;
+import de.k3b.media.PhotoPropertiesBulkUpdateService;
import uk.co.senab.photoview.PhotoView;
import uk.co.senab.photoview.PhotoViewAttacher;
import uk.co.senab.photoview.log.LogManager;
@@ -118,7 +118,7 @@ public void onScale(float scaleFactor, float focusX, float focusY) {
MAX_IMAGE_DIMENSION = (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) ? 4096 : HugeImageLoader.getMaxTextureSize();
}
imageView.setImageBitmap(HugeImageLoader.loadImage(mImageReloadFile.getAbsoluteFile(), MAX_IMAGE_DIMENSION, MAX_IMAGE_DIMENSION));
- this.setRotationTo(JpgMetaWorkflow.getRotationFromExifOrientation(mImageReloadFile.getAbsolutePath(), null));
+ this.setRotationTo(PhotoPropertiesBulkUpdateService.getRotationFromExifOrientation(mImageReloadFile.getAbsolutePath(), null));
} catch (OutOfMemoryError e) {
LogManager.getLogger().e(
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/locationmap/GeoEditActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/locationmap/GeoEditActivity.java
index b6154d0d..2373ebff 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/locationmap/GeoEditActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/locationmap/GeoEditActivity.java
@@ -44,8 +44,7 @@
import de.k3b.android.androFotoFinder.R;
import de.k3b.android.util.AndroidFileCommands;
import de.k3b.android.util.IntentUtil;
-import de.k3b.android.util.MediaScanner;
-import de.k3b.android.widget.ActivityWithCallContext;
+import de.k3b.android.util.PhotoPropertiesMediaFilesScanner;
import de.k3b.android.widget.HistoryEditText;
import de.k3b.android.widget.LocalizedActivity;
import de.k3b.io.collections.SelectedFiles;
@@ -88,7 +87,7 @@ public static void showActivity(String debugContext, Activity context, SelectedF
if (AffUtils.putSelectedFiles(intent, selectedFiles)) {
Long id = selectedFiles.getId(0);
- IGeoPointInfo initialPoint = MediaScanner.getInstance(context).getPositionFromFile(selectedFiles.getFileNames()[0], (id != null) ? id.toString() : null);
+ IGeoPointInfo initialPoint = PhotoPropertiesMediaFilesScanner.getInstance(context).getPositionFromFile(selectedFiles.getFileNames()[0], (id != null) ? id.toString() : null);
if (initialPoint != null) {
initalUri = Uri.parse(PARSER.toUriString(initialPoint));
intent.setData(initalUri);
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/media/AndroidJpgMetaWorkflow.java b/app/src/main/java/de/k3b/android/androFotoFinder/media/AndroidPhotoPropertiesBulkUpdateService.java
similarity index 69%
rename from app/src/main/java/de/k3b/android/androFotoFinder/media/AndroidJpgMetaWorkflow.java
rename to app/src/main/java/de/k3b/android/androFotoFinder/media/AndroidPhotoPropertiesBulkUpdateService.java
index e26a3ee1..af8921f0 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/media/AndroidJpgMetaWorkflow.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/media/AndroidPhotoPropertiesBulkUpdateService.java
@@ -23,9 +23,9 @@
import java.io.File;
-import de.k3b.android.util.MediaScanner;
-import de.k3b.media.IMetaApi;
-import de.k3b.media.JpgMetaWorkflow;
+import de.k3b.android.util.PhotoPropertiesMediaFilesScanner;
+import de.k3b.media.IPhotoProperties;
+import de.k3b.media.PhotoPropertiesBulkUpdateService;
import de.k3b.transactionlog.TransactionLoggerBase;
/**
@@ -36,20 +36,20 @@
* Created by k3b on 23.10.2017.
*/
-public class AndroidJpgMetaWorkflow extends JpgMetaWorkflow {
+public class AndroidPhotoPropertiesBulkUpdateService extends PhotoPropertiesBulkUpdateService {
private final Context ctx;
private final String dbgContext;
- public AndroidJpgMetaWorkflow(Context ctx, TransactionLoggerBase transactionLogger, String dbgContext) {
+ public AndroidPhotoPropertiesBulkUpdateService(Context ctx, TransactionLoggerBase transactionLogger, String dbgContext) {
super(transactionLogger);
this.ctx = (ctx != null) ? ctx.getApplicationContext() : null;
this.dbgContext = dbgContext;
}
/** todo overwrite in android class to implement update media db */
- protected long updateMediaDB(long id, IMetaApi newExif, String oldJpgAbsolutePath, File newJpgFile) {
+ protected long updateMediaDB(long id, IPhotoProperties newExif, String oldJpgAbsolutePath, File newJpgFile) {
// let media scanner re-scan exif data
- Long affectedId = MediaScanner.getInstance(this.ctx).insertOrUpdateMediaDatabase(this.dbgContext, this.ctx, oldJpgAbsolutePath, newJpgFile, null);
+ Long affectedId = PhotoPropertiesMediaFilesScanner.getInstance(this.ctx).insertOrUpdateMediaDatabase(this.dbgContext, this.ctx, oldJpgAbsolutePath, newJpgFile, null);
return (affectedId != null) ? affectedId.longValue() : id;
}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/media/MediaContentValues.java b/app/src/main/java/de/k3b/android/androFotoFinder/media/PhotoPropertiesMediaDBContentValues.java
similarity index 80%
rename from app/src/main/java/de/k3b/android/androFotoFinder/media/MediaContentValues.java
rename to app/src/main/java/de/k3b/android/androFotoFinder/media/PhotoPropertiesMediaDBContentValues.java
index 32245734..e8d0e9db 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/media/MediaContentValues.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/media/PhotoPropertiesMediaDBContentValues.java
@@ -27,21 +27,21 @@
import de.k3b.android.androFotoFinder.queries.FotoSql;
import de.k3b.android.androFotoFinder.tagDB.TagSql;
import de.k3b.io.VISIBILITY;
-import de.k3b.media.IMetaApi;
-import de.k3b.media.MediaUtil;
+import de.k3b.media.IPhotoProperties;
+import de.k3b.media.PhotoPropertiesUtil;
import de.k3b.tagDB.TagConverter;
/**
- * r/w {@link IMetaApi} Implementation for android databse/contentprovider {@link ContentValues}.
+ * r/w {@link IPhotoProperties} Implementation for android databse/contentprovider {@link ContentValues}.
*
* Created by k3b on 10.10.2016.
*/
-public class MediaContentValues implements IMetaApi {
+public class PhotoPropertiesMediaDBContentValues implements IPhotoProperties {
private ContentValues mData;
private Date mXmpFileModifyDate;
- public MediaContentValues set(ContentValues data, Date xmpLastFileModifyDate) {
+ public PhotoPropertiesMediaDBContentValues set(ContentValues data, Date xmpLastFileModifyDate) {
if (data != null) this.mData = data;
mXmpFileModifyDate = xmpLastFileModifyDate;
return this;
@@ -51,7 +51,7 @@ public ContentValues getContentValues(){
return mData;
}
- public MediaContentValues setID(Integer id) {
+ public PhotoPropertiesMediaDBContentValues setID(Integer id) {
mData.put(FotoSql.SQL_COL_PK, id);
return this;
}
@@ -60,11 +60,11 @@ public Integer getID() {
return mData.getAsInteger(FotoSql.SQL_COL_PK);
}
- public MediaContentValues clear(){
+ public PhotoPropertiesMediaDBContentValues clear(){
mData.clear();
return this;
}
- // ############# IMetaApi
+ // ############# IPhotoProperties
@Override
public String getPath() {
@@ -72,7 +72,7 @@ public String getPath() {
}
@Override
- public IMetaApi setPath(String filePath) {
+ public IPhotoProperties setPath(String filePath) {
mData.put(FotoSql.SQL_COL_PATH, filePath);
return this;
}
@@ -86,13 +86,13 @@ public Date getDateTimeTaken() {
}
@Override
- public IMetaApi setDateTimeTaken(Date value) {
+ public IPhotoProperties setDateTimeTaken(Date value) {
Long milliSecs = (value != null) ? value.getTime() : null;
mData.put(FotoSql.SQL_COL_DATE_TAKEN, milliSecs);
return this;
}
- @Override public IMetaApi setLatitudeLongitude(Double latitude, Double longitude) {
+ @Override public IPhotoProperties setLatitudeLongitude(Double latitude, Double longitude) {
mData.put(FotoSql.SQL_COL_LAT, latitude);
mData.put(FotoSql.SQL_COL_LON, longitude);
return this;
@@ -114,7 +114,7 @@ public String getTitle() {
}
@Override
- public IMetaApi setTitle(String title) {
+ public IPhotoProperties setTitle(String title) {
mData.put(TagSql.SQL_COL_EXT_TITLE, title);
return this;
}
@@ -125,7 +125,7 @@ public String getDescription() {
}
@Override
- public IMetaApi setDescription(String description) {
+ public IPhotoProperties setDescription(String description) {
TagSql.setDescription(mData, mXmpFileModifyDate, description);
return this;
}
@@ -136,7 +136,7 @@ public List getTags() {
}
@Override
- public IMetaApi setTags(List tags) {
+ public IPhotoProperties setTags(List tags) {
mData.put(TagSql.SQL_COL_EXT_TAGS, TagConverter.asDbString("",tags));
setLastXmpFileModifyDate();
return this;
@@ -151,7 +151,7 @@ public Integer getRating() {
}
@Override
- public IMetaApi setRating(Integer value) {
+ public IPhotoProperties setRating(Integer value) {
mData.put(TagSql.SQL_COL_EXT_RATING, value);
setLastXmpFileModifyDate();
return this;
@@ -170,7 +170,7 @@ public VISIBILITY getVisibility() {
}
@Override
- public IMetaApi setVisibility(VISIBILITY value) {
+ public IPhotoProperties setVisibility(VISIBILITY value) {
if (VISIBILITY.isChangingValue(value)) {
int iValue = (value.equals(VISIBILITY.PRIVATE))
? FotoSql.MEDIA_TYPE_IMAGE_PRIVATE
@@ -189,6 +189,6 @@ protected void setLastXmpFileModifyDate() {
@Override
public String toString() {
- return MediaUtil.toString(this);
+ return PhotoPropertiesUtil.toString(this);
}
}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/media/MediaDBActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/media/PhotoPropertiesMediaDBCsvImportActivity.java
similarity index 90%
rename from app/src/main/java/de/k3b/android/androFotoFinder/media/MediaDBActivity.java
rename to app/src/main/java/de/k3b/android/androFotoFinder/media/PhotoPropertiesMediaDBCsvImportActivity.java
index f0664058..ed4ecff4 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/media/MediaDBActivity.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/media/PhotoPropertiesMediaDBCsvImportActivity.java
@@ -27,7 +27,6 @@
import android.app.Activity;
import android.util.Log;
import android.view.View;
-import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
@@ -44,12 +43,12 @@
import de.k3b.csv2db.csv.CsvLoader;
import de.k3b.io.FileUtils;
import de.k3b.io.VISIBILITY;
-import de.k3b.media.MediaCsvItem;
-import de.k3b.media.MediaUtil;
+import de.k3b.media.PhotoPropertiesCsvItem;
+import de.k3b.media.PhotoPropertiesUtil;
import de.k3b.tagDB.Tag;
import de.k3b.tagDB.TagRepository;
-public class MediaDBActivity extends Activity {
+public class PhotoPropertiesMediaDBCsvImportActivity extends Activity {
public static final String DBG_CONTEXT = "MediaDB-Import(Csv): ";
/** Does the import into MediaDB in background task */
@@ -150,7 +149,7 @@ protected String processUri(Uri uri) {
reader = new InputStreamReader(getContentResolver().openInputStream(uri));
mLoader = new MediaCsvLoader(csvRootDir);
- mLoader.load(reader, new MediaCsvItem());
+ mLoader.load(reader, new PhotoPropertiesCsvItem());
if (Global.Media.enableXmpNone) {
// set all xmp-file-dates to EXT_LAST_EXT_SCAN_NO_XMP_IN_CSV if null
@@ -183,7 +182,7 @@ private void updateDB(String dbgContext, String _path, long xmlLastFileModifyDat
String path = _path;
if (path != null) {
if (!path.contains("%")) {
- if (MediaUtil.isImage(path, MediaUtil.IMG_TYPE_ALL)) {
+ if (PhotoPropertiesUtil.isImage(path, PhotoPropertiesUtil.IMG_TYPE_ALL)) {
// non xmp-file: do not update file modify date
xmlLastFileModifyDate = (Global.Media.enableXmpNone)
? TagSql.EXT_LAST_EXT_SCAN_NO_XMP_IN_CSV
@@ -207,7 +206,7 @@ private void updateDB(String dbgContext, String _path, long xmlLastFileModifyDat
TagSql.setFileModifyDate(dbValues, new Date().getTime() / 1000);
- mUpdateCount += TagSql.execUpdate(dbgContext, MediaDBActivity.this, path, xmlLastFileModifyDate, dbValues, VISIBILITY.PRIVATE_PUBLIC);
+ mUpdateCount += TagSql.execUpdate(dbgContext, PhotoPropertiesMediaDBCsvImportActivity.this, path, xmlLastFileModifyDate, dbValues, VISIBILITY.PRIVATE_PUBLIC);
mItemCount++;
}
}
@@ -225,20 +224,20 @@ protected void onPostExecute(String errorMessage) {
if (!isCancelled()) {
if (errorMessage != null) {
- Toast.makeText(MediaDBActivity.this, errorMessage, Toast.LENGTH_LONG).show();
+ Toast.makeText(PhotoPropertiesMediaDBCsvImportActivity.this, errorMessage, Toast.LENGTH_LONG).show();
}
finish();
}
}
- private class MediaCsvLoader extends CsvLoader {
+ private class MediaCsvLoader extends CsvLoader {
/**
* path-s in csv are relative to mCsvRootDir
*/
private final File mCsvRootDir;
private ContentValues mDbValues = new ContentValues();
- private MediaContentValues mMediaValueAdapter = new MediaContentValues();
+ private PhotoPropertiesMediaDBContentValues mMediaValueAdapter = new PhotoPropertiesMediaDBContentValues();
private Tag mImportRoot = null;
public MediaCsvLoader(File csvRootDir) {
@@ -246,12 +245,12 @@ public MediaCsvLoader(File csvRootDir) {
}
@Override
- protected void onNextItem(MediaCsvItem next, int lineNumber, int recordNumber) {
+ protected void onNextItem(PhotoPropertiesCsvItem next, int lineNumber, int recordNumber) {
if (next != null) {
String path = next.getPath();
next.setPath(null);
mDbValues.clear();
- if ((path != null) && (MediaUtil.copy(mMediaValueAdapter.set(mDbValues, null), next, false, false) >= 1)) {
+ if ((path != null) && (PhotoPropertiesUtil.copy(mMediaValueAdapter.set(mDbValues, null), next, false, false) >= 1)) {
// >= 1 means at least one extra attribute (excluding path that has been set to null)
Date fileModifyDate = next.getFileModifyDate();
long fileModifyDateMilliSecs = (fileModifyDate != null) ? fileModifyDate.getTime() : TagSql.EXT_LAST_EXT_SCAN_NO_XMP_IN_CSV;
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/media/MediaCursor.java b/app/src/main/java/de/k3b/android/androFotoFinder/media/PhotoPropertiesMediaDBCursor.java
similarity index 85%
rename from app/src/main/java/de/k3b/android/androFotoFinder/media/MediaCursor.java
rename to app/src/main/java/de/k3b/android/androFotoFinder/media/PhotoPropertiesMediaDBCursor.java
index 641bb9d2..a1207696 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/media/MediaCursor.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/media/PhotoPropertiesMediaDBCursor.java
@@ -27,16 +27,16 @@
import de.k3b.android.androFotoFinder.queries.FotoSql;
import de.k3b.android.androFotoFinder.tagDB.TagSql;
import de.k3b.io.VISIBILITY;
-import de.k3b.media.IMetaApi;
-import de.k3b.media.MediaUtil;
+import de.k3b.media.IPhotoProperties;
+import de.k3b.media.PhotoPropertiesUtil;
import de.k3b.tagDB.TagConverter;
/**
- * r {@link IMetaApi} Implementation for {@link Cursor}.
+ * r {@link IPhotoProperties} Implementation for {@link Cursor}.
*
* Created by k3b on 10.10.2016.
*/
-public class MediaCursor implements IMetaApi {
+public class PhotoPropertiesMediaDBCursor implements IPhotoProperties {
private final Cursor cursor;
private final int colId;
private final int colFilePath;
@@ -49,7 +49,7 @@ public class MediaCursor implements IMetaApi {
private final int colRating;
private final int colType;
- public MediaCursor(Cursor cursor) {
+ public PhotoPropertiesMediaDBCursor(Cursor cursor) {
this.cursor = cursor;
colId = getColumnIndex(TagSql.SQL_COL_PK);
@@ -145,46 +145,46 @@ protected int getColumnIndex(String columnName) {
}
@Override
- public IMetaApi setPath(String filePath) {
+ public IPhotoProperties setPath(String filePath) {
throw new UnsupportedOperationException();
}
@Override
- public IMetaApi setDateTimeTaken(Date value) {
+ public IPhotoProperties setDateTimeTaken(Date value) {
throw new UnsupportedOperationException();
}
- @Override public IMetaApi setLatitudeLongitude(Double latitude, Double longitude) {
+ @Override public IPhotoProperties setLatitudeLongitude(Double latitude, Double longitude) {
throw new UnsupportedOperationException();
}
@Override
- public IMetaApi setTitle(String title) {
+ public IPhotoProperties setTitle(String title) {
throw new UnsupportedOperationException();
}
@Override
- public IMetaApi setDescription(String description) {
+ public IPhotoProperties setDescription(String description) {
throw new UnsupportedOperationException();
}
@Override
- public IMetaApi setTags(List tags) {
+ public IPhotoProperties setTags(List tags) {
throw new UnsupportedOperationException();
}
@Override
- public IMetaApi setRating(Integer value) {
+ public IPhotoProperties setRating(Integer value) {
throw new UnsupportedOperationException();
}
@Override
- public IMetaApi setVisibility(VISIBILITY value) {
+ public IPhotoProperties setVisibility(VISIBILITY value) {
throw new UnsupportedOperationException();
}
@Override
public String toString() {
- return MediaUtil.toString(this);
+ return PhotoPropertiesUtil.toString(this);
}
}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/media/package-info.java b/app/src/main/java/de/k3b/android/androFotoFinder/media/package-info.java
index 68dc29da..eb5cda73 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/media/package-info.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/media/package-info.java
@@ -44,7 +44,7 @@
}
package "System" {
- [MediaScanner]
+ [PhotoPropertiesMediaFilesScanner]
[MediaDB]
}
@@ -64,8 +64,8 @@
[JpegFile hires] -> [apm2csv.cmd]
[apm2csv.cmd] -> [CsvFile] : {c}
- [JpegFile 1024] -> [MediaScanner]
- [MediaScanner] -> [MediaDB]
+ [JpegFile 1024] -> [PhotoPropertiesMediaFilesScanner]
+ [PhotoPropertiesMediaFilesScanner] -> [MediaDB]
[JpegFile 1024] -> ["A Photo Manager" Scanner]
[XmpFile] -> ["A Photo Manager" Scanner]
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/AndroidAlbumUtils.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/AndroidAlbumUtils.java
index 1944f7d3..ccc81079 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/AndroidAlbumUtils.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/AndroidAlbumUtils.java
@@ -44,7 +44,7 @@
import de.k3b.android.androFotoFinder.R;
import de.k3b.android.androFotoFinder.tagDB.TagSql;
import de.k3b.android.util.IntentUtil;
-import de.k3b.android.util.MediaScanner;
+import de.k3b.android.util.PhotoPropertiesMediaFilesScanner;
import de.k3b.database.QueryParameter;
import de.k3b.io.AlbumFile;
import de.k3b.io.FileUtils;
@@ -372,7 +372,7 @@ public static void insertToMediaDB(String dbgContext, @NonNull Context context,
public static void insertToMediaDB(String dbgContext, @NonNull Context context, File fileToBeScannedAndInserted) {
if (fileToBeScannedAndInserted != null) {
ContentValues values = new ContentValues();
- String newAbsolutePath = MediaScanner.setFileFields(values, fileToBeScannedAndInserted);
+ String newAbsolutePath = PhotoPropertiesMediaFilesScanner.setFileFields(values, fileToBeScannedAndInserted);
values.put(FotoSql.SQL_COL_EXT_MEDIA_TYPE, FotoSql.MEDIA_TYPE_ALBUM_FILE);
FotoSql.insertOrUpdateMediaDatabase(dbgContext, context, newAbsolutePath, values, null, 1l);
}
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagSql.java b/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagSql.java
index 18daf866..1e47179e 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagSql.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagSql.java
@@ -34,18 +34,18 @@
import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.Global;
-import de.k3b.android.androFotoFinder.media.MediaContentValues;
+import de.k3b.android.androFotoFinder.media.PhotoPropertiesMediaDBContentValues;
import de.k3b.android.androFotoFinder.queries.AndroidAlbumUtils;
import de.k3b.android.androFotoFinder.queries.FotoSql;
-import de.k3b.android.util.MediaScanner;
+import de.k3b.android.util.PhotoPropertiesMediaFilesScanner;
import de.k3b.io.GalleryFilterParameter;
import de.k3b.io.IGalleryFilter;
import de.k3b.database.QueryParameter;
import de.k3b.io.ListUtils;
import de.k3b.io.VISIBILITY;
-import de.k3b.media.MediaUtil;
-import de.k3b.media.MediaXmpSegment;
-import de.k3b.media.MetaWriterExifXml;
+import de.k3b.media.PhotoPropertiesUtil;
+import de.k3b.media.PhotoPropertiesXmpSegment;
+import de.k3b.media.PhotoPropertiesUpdateHandler;
import de.k3b.tagDB.Tag;
import de.k3b.tagDB.TagConverter;
@@ -271,7 +271,7 @@ public static int fixPrivate(Context context) {
.append(TagSql.FILTER_EXPR_TAGS_INCLUDED);
if (LibGlobal.renamePrivateJpg) {
where.append(" OR ").append(TagSql.FILTER_EXPR_PATH_LIKE.replace("?","'%" +
- MediaUtil.IMG_TYPE_PRIVATE + "'"));
+ PhotoPropertiesUtil.IMG_TYPE_PRIVATE + "'"));
}
where.append(")");
return exexUpdateImpl("Fix visibility private", context,
@@ -353,17 +353,17 @@ public static ContentValues getDbContent(Context context, final long id) {
* @return number of changed db items
*/
public static int updateDB(String dbgContext, Context context, String oldFullJpgFilePath,
- MetaWriterExifXml jpg, MediaUtil.FieldID... allowSetNulls) {
- if ((jpg != null) && (!MediaScanner.isNoMedia(oldFullJpgFilePath))) {
+ PhotoPropertiesUpdateHandler jpg, PhotoPropertiesUtil.FieldID... allowSetNulls) {
+ if ((jpg != null) && (!PhotoPropertiesMediaFilesScanner.isNoMedia(oldFullJpgFilePath))) {
ContentValues dbValues = new ContentValues();
- MediaContentValues mediaValueAdapter = new MediaContentValues();
+ PhotoPropertiesMediaDBContentValues mediaValueAdapter = new PhotoPropertiesMediaDBContentValues();
// dbValues.clear();
- final int modifiedColumCout = MediaUtil.copyNonEmpty(mediaValueAdapter.set(dbValues, null), jpg, allowSetNulls);
+ final int modifiedColumCout = PhotoPropertiesUtil.copyNonEmpty(mediaValueAdapter.set(dbValues, null), jpg, allowSetNulls);
if (modifiedColumCout >= 1) {
String newFullJpgFilePath = null;
if (LibGlobal.renamePrivateJpg) {
- newFullJpgFilePath = MediaUtil.getModifiedPath(jpg);
+ newFullJpgFilePath = PhotoPropertiesUtil.getModifiedPath(jpg);
}
if (newFullJpgFilePath == null) {
@@ -372,7 +372,7 @@ public static int updateDB(String dbgContext, Context context, String oldFullJpg
mediaValueAdapter.setPath(newFullJpgFilePath);
- MediaXmpSegment xmp = jpg.getXmp();
+ PhotoPropertiesXmpSegment xmp = jpg.getXmp();
long xmpFilelastModified = (xmp != null) ? xmp.getFilelastModified() : 0;
if (xmpFilelastModified == 0) xmpFilelastModified = TagSql.EXT_LAST_EXT_SCAN_NO_XMP;
TagSql.setXmpFileModifyDate(dbValues, xmpFilelastModified);
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagWorflow.java b/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagWorflow.java
index 71df7217..adf2f90f 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagWorflow.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagWorflow.java
@@ -33,9 +33,9 @@
import de.k3b.io.IProgessListener;
import de.k3b.io.collections.SelectedFiles;
import de.k3b.io.FileCommands;
-import de.k3b.media.MediaUtil;
-import de.k3b.media.MediaXmpSegment;
-import de.k3b.media.MetaWriterExifXml;
+import de.k3b.media.PhotoPropertiesUtil;
+import de.k3b.media.PhotoPropertiesXmpSegment;
+import de.k3b.media.PhotoPropertiesUpdateHandler;
import de.k3b.tagDB.Tag;
import de.k3b.tagDB.TagConverter;
import de.k3b.tagDB.TagProcessor;
@@ -103,7 +103,7 @@ protected int updateTags(TagSql.TagWorflowItem tagWorflowItemFromDB, List currentItemTags = tagWorflowItemFromDB.tags;
try {
- MetaWriterExifXml exif = MetaWriterExifXml.create (tagWorflowItemFromDB.path, null, false, "updateTags:");
+ PhotoPropertiesUpdateHandler exif = PhotoPropertiesUpdateHandler.create (tagWorflowItemFromDB.path, null, false, "updateTags:");
List tagsDbPlusFile = getUpdated(currentItemTags, exif.getTags(), null);
if (tagsDbPlusFile != null) {
mustSave = true;
@@ -124,7 +124,7 @@ protected int updateTags(TagSql.TagWorflowItem tagWorflowItemFromDB, List loadTags(File xmpFile) {
- MediaXmpSegment xmp = loadXmp(xmpFile);
+ PhotoPropertiesXmpSegment xmp = loadXmp(xmpFile);
return (xmp == null) ? null : xmp.getTags();
}
@NonNull
- private MediaXmpSegment loadXmp(File xmpFile) {
+ private PhotoPropertiesXmpSegment loadXmp(File xmpFile) {
if ((xmpFile != null) && (xmpFile.exists())) {
try {
- MediaXmpSegment xmp = new MediaXmpSegment();
+ PhotoPropertiesXmpSegment xmp = new PhotoPropertiesXmpSegment();
xmp.load(xmpFile, "loadXmp(" + xmpFile + ")");
return xmp;
} catch (IOException e) {
diff --git a/app/src/main/java/de/k3b/android/util/AndroidFileCommands.java b/app/src/main/java/de/k3b/android/util/AndroidFileCommands.java
index 5b9a7305..fd0ef313 100644
--- a/app/src/main/java/de/k3b/android/util/AndroidFileCommands.java
+++ b/app/src/main/java/de/k3b/android/util/AndroidFileCommands.java
@@ -41,7 +41,7 @@
import de.k3b.android.androFotoFinder.LockScreen;
import de.k3b.android.androFotoFinder.R;
import de.k3b.android.androFotoFinder.directory.DirectoryPickerFragment;
-import de.k3b.android.androFotoFinder.media.AndroidJpgMetaWorkflow;
+import de.k3b.android.androFotoFinder.media.AndroidPhotoPropertiesBulkUpdateService;
import de.k3b.android.androFotoFinder.queries.DatabaseHelper;
import de.k3b.android.androFotoFinder.queries.FotoSql;
import de.k3b.android.androFotoFinder.tagDB.TagSql;
@@ -53,9 +53,9 @@
import de.k3b.io.DirectoryFormatter;
import de.k3b.io.FileCommands;
import de.k3b.io.IDirectory;
-import de.k3b.media.JpgMetaWorkflow;
-import de.k3b.media.MediaUtil;
-import de.k3b.media.MetaWriterExifXml;
+import de.k3b.media.PhotoPropertiesBulkUpdateService;
+import de.k3b.media.PhotoPropertiesUtil;
+import de.k3b.media.PhotoPropertiesUpdateHandler;
import de.k3b.transactionlog.MediaTransactionLogEntryType;
import de.k3b.transactionlog.TransactionLoggerBase;
@@ -72,7 +72,7 @@ public class AndroidFileCommands extends FileCommands {
protected Activity mContext; // must be activity because of fragmentManager
private AlertDialog mActiveAlert = null;
private boolean mHasNoMedia = false;
- private MediaScanner mScanner = null;
+ private PhotoPropertiesMediaFilesScanner mScanner = null;
public AndroidFileCommands() {
// setLogFilePath(getDefaultLogFile());
@@ -107,7 +107,7 @@ protected void onPreProcess(String what, int opCode, SelectedFiles selectedFiles
}
// a nomedia file is affected => must update gui
- this.mHasNoMedia = MediaScanner.isNoMedia(22, oldPathNames) || MediaScanner.isNoMedia(22, newPathNames);
+ this.mHasNoMedia = PhotoPropertiesMediaFilesScanner.isNoMedia(22, oldPathNames) || PhotoPropertiesMediaFilesScanner.isNoMedia(22, newPathNames);
super.onPreProcess(what, opCode, selectedFiles, oldPathNames, newPathNames);
}
@@ -123,7 +123,7 @@ protected void onPostProcess(String what, int opCode, SelectedFiles selectedFile
Context context = this.mContext;
String message = getModifyMessage(context, opCode, modifyCount, itemCount);
if ((itemCount > 0) && (mScanner != null)) {
- MediaScannerAsyncTask.updateMediaDBInBackground(mScanner, mContext, message, oldPathNames, newPathNames);
+ PhotoPropertiesMediaFilesScannerAsyncTask.updateMediaDBInBackground(mScanner, mContext, message, oldPathNames, newPathNames);
}
if (false && this.mHasNoMedia && (mContext != null)) {
@@ -231,7 +231,7 @@ public int execRename(File srcDirFile, String newFolderName) {
MediaTransactionLogEntryType.MOVE_DIR,
destDirFile.getAbsolutePath());
- MediaScanner.notifyChanges(this.mContext,"renamed dir");
+ PhotoPropertiesMediaFilesScanner.notifyChanges(this.mContext,"renamed dir");
}
}
}
@@ -372,7 +372,7 @@ public void dismiss() {
}
public boolean cmdMediaScannerWithQuestion() {
- final RecursiveMediaScannerAsyncTask scanner = RecursiveMediaScannerAsyncTask.sScanner;
+ final RecursivePhotoPropertiesMediaFilesScannerAsyncTask scanner = RecursivePhotoPropertiesMediaFilesScannerAsyncTask.sScanner;
if (scanner != null) {
// connect gui to already running scanner if possible
@@ -398,10 +398,10 @@ public boolean cmdMediaScannerWithQuestion() {
/** answer from "which directory to start scanner from"? */
private void onMediaScannerAnswer(String scanRootDir) {
- if ((AndroidFileCommands.canProcessFile(mContext, this.isInBackground)) || (RecursiveMediaScannerAsyncTask.sScanner == null)){
+ if ((AndroidFileCommands.canProcessFile(mContext, this.isInBackground)) || (RecursivePhotoPropertiesMediaFilesScannerAsyncTask.sScanner == null)){
// remove ".nomedia" file from scan root
- File nomedia = new File(scanRootDir, MediaScanner.MEDIA_IGNORE_FILENAME);
+ File nomedia = new File(scanRootDir, PhotoPropertiesMediaFilesScanner.MEDIA_IGNORE_FILENAME);
if (nomedia.exists()) {
if (Global.debugEnabled) {
Log.i(Global.LOG_CONTEXT, mDebugPrefix + "onMediaScannerAnswer deleting " + nomedia);
@@ -413,21 +413,21 @@ private void onMediaScannerAnswer(String scanRootDir) {
}
final String message = mContext.getString(R.string.scanner_menu_title);
- final RecursiveMediaScannerAsyncTask scanner = (RecursiveMediaScannerAsyncTask.sScanner != null)
- ? RecursiveMediaScannerAsyncTask.sScanner :
- new RecursiveMediaScannerAsyncTask(mScanner, mContext, message);
+ final RecursivePhotoPropertiesMediaFilesScannerAsyncTask scanner = (RecursivePhotoPropertiesMediaFilesScannerAsyncTask.sScanner != null)
+ ? RecursivePhotoPropertiesMediaFilesScannerAsyncTask.sScanner :
+ new RecursivePhotoPropertiesMediaFilesScannerAsyncTask(mScanner, mContext, message);
synchronized (this) {
- if (RecursiveMediaScannerAsyncTask.sScanner == null) {
- RecursiveMediaScannerAsyncTask.sScanner = scanner;
+ if (RecursivePhotoPropertiesMediaFilesScannerAsyncTask.sScanner == null) {
+ RecursivePhotoPropertiesMediaFilesScannerAsyncTask.sScanner = scanner;
scanner.execute(new String[]{scanRootDir});
} // else scanner is already running
}
- showMediaScannerStatus(RecursiveMediaScannerAsyncTask.sScanner);
+ showMediaScannerStatus(RecursivePhotoPropertiesMediaFilesScannerAsyncTask.sScanner);
}
}
- private void showMediaScannerStatus(RecursiveMediaScannerAsyncTask mediaScanner) {
+ private void showMediaScannerStatus(RecursivePhotoPropertiesMediaFilesScannerAsyncTask mediaScanner) {
if (mediaScanner != null) {
mediaScanner.showStatusDialog(mContext);
}
@@ -464,9 +464,9 @@ public int setGeo(double latitude, double longitude, SelectedFiles selectedItems
if (!onProgress(itemcount, maxCount, null)) break;
}
File file = files[i];
- MetaWriterExifXml jpg = createWorkflow(null, dbgContext).saveLatLon(file, latitude, longitude);
+ PhotoPropertiesUpdateHandler jpg = createWorkflow(null, dbgContext).saveLatLon(file, latitude, longitude);
resultFile += TagSql.updateDB(dbgContext, applicationContext,
- file.getAbsolutePath(), jpg, MediaUtil.FieldID.latitude_longitude);
+ file.getAbsolutePath(), jpg, PhotoPropertiesUtil.FieldID.latitude_longitude);
itemcount++;
addTransactionLog(selectedItems.getId(i), file.getAbsolutePath(), now, MediaTransactionLogEntryType.GPS, latLong);
}
@@ -485,7 +485,7 @@ public AndroidFileCommands setContext(Activity mContext) {
this.mContext = mContext;
if (mContext != null) {
closeLogFile();
- mScanner = MediaScanner.getInstance(mContext);
+ mScanner = PhotoPropertiesMediaFilesScanner.getInstance(mContext);
}
return this;
@@ -523,14 +523,14 @@ protected boolean canProcessFile(int opCode) {
public static boolean canProcessFile(Context context, boolean isInBackground) {
if (!Global.mustCheckMediaScannerRunning) return true; // always allowed. DANGEROUS !!!
- if (MediaScanner.isScannerActive(context.getContentResolver())) {
+ if (PhotoPropertiesMediaFilesScanner.isScannerActive(context.getContentResolver())) {
if (!isInBackground) {
Toast.makeText(context, R.string.scanner_err_busy, Toast.LENGTH_LONG).show();
}
return false;
}
- return (RecursiveMediaScannerAsyncTask.getBusyScanner() == null);
+ return (RecursivePhotoPropertiesMediaFilesScannerAsyncTask.getBusyScanner() == null);
}
@Override
@@ -546,8 +546,8 @@ public String toString() {
/** overwrite to create a android specific Workflow */
@Override
- public JpgMetaWorkflow createWorkflow(TransactionLoggerBase logger, String dbgContext) {
- return new AndroidJpgMetaWorkflow(mContext, logger, dbgContext);
+ public PhotoPropertiesBulkUpdateService createWorkflow(TransactionLoggerBase logger, String dbgContext) {
+ return new AndroidPhotoPropertiesBulkUpdateService(mContext, logger, dbgContext);
}
diff --git a/app/src/main/java/de/k3b/android/util/MediaScanner.java b/app/src/main/java/de/k3b/android/util/PhotoPropertiesMediaFilesScanner.java
similarity index 88%
rename from app/src/main/java/de/k3b/android/util/MediaScanner.java
rename to app/src/main/java/de/k3b/android/util/PhotoPropertiesMediaFilesScanner.java
index 1ea4c3fc..8b620476 100644
--- a/app/src/main/java/de/k3b/android/util/MediaScanner.java
+++ b/app/src/main/java/de/k3b/android/util/PhotoPropertiesMediaFilesScanner.java
@@ -43,7 +43,7 @@
import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.Global;
-import de.k3b.android.androFotoFinder.media.MediaContentValues;
+import de.k3b.android.androFotoFinder.media.PhotoPropertiesMediaDBContentValues;
import de.k3b.android.androFotoFinder.queries.FotoSql;
import de.k3b.android.androFotoFinder.tagDB.TagSql;
import de.k3b.database.QueryParameter;
@@ -51,10 +51,10 @@
import de.k3b.geo.api.IGeoPointInfo;
import de.k3b.io.FileUtils;
import de.k3b.io.VISIBILITY;
-import de.k3b.media.IMetaApi;
-import de.k3b.media.MediaUtil;
-import de.k3b.media.MediaXmpSegment;
-import de.k3b.media.MetaApiChainReader;
+import de.k3b.media.IPhotoProperties;
+import de.k3b.media.PhotoPropertiesUtil;
+import de.k3b.media.PhotoPropertiesXmpSegment;
+import de.k3b.media.PhotoPropertiesChainReader;
import de.k3b.tagDB.TagRepository;
/**
@@ -66,8 +66,8 @@
*
* Created by k3b on 14.09.2015.
*/
-abstract public class MediaScanner {
- protected static final String CONTEXT = "MediaScanner.";
+abstract public class PhotoPropertiesMediaFilesScanner {
+ protected static final String CONTEXT = "PhotoPropertiesMediaFilesScanner.";
/* the DB_XXXX fields are updated by the scanner via ExifInterfaceEx
protected static final String DB_DATE_TAKEN = MediaStore.Images.Media.DATE_TAKEN;
@@ -89,11 +89,11 @@ abstract public class MediaScanner {
public static final String MEDIA_IGNORE_FILENAME = FileUtils.MEDIA_IGNORE_FILENAME; // MediaStore.MEDIA_IGNORE_FILENAME;
/** singelton */
- private static MediaScanner sInstance = null;
+ private static PhotoPropertiesMediaFilesScanner sInstance = null;
public final Context mContext;
- public MediaScanner(Context context) {
+ public PhotoPropertiesMediaFilesScanner(Context context) {
mContext = context.getApplicationContext();
}
@@ -124,7 +124,7 @@ public static boolean isNoMedia(String path, int maxLevel) {
}
public static boolean isNoMedia(String path) {
- return FileUtils.isNoMedia(path,MediaScanner.DEFAULT_SCAN_DEPTH);
+ return FileUtils.isNoMedia(path, PhotoPropertiesMediaFilesScanner.DEFAULT_SCAN_DEPTH);
}
public static boolean canHideFolderMedia(String absoluteSelectedPath) {
@@ -151,7 +151,7 @@ public static int hideFolderMedia(Activity context, String path) {
}
result = FotoSql.execDeleteByPath(CONTEXT + " hideFolderMedia", context, path, VISIBILITY.PRIVATE_PUBLIC);
if (result > 0) {
- MediaScanner.notifyChanges(context, "hide " + path + "/**");
+ PhotoPropertiesMediaFilesScanner.notifyChanges(context, "hide " + path + "/**");
}
}
}
@@ -187,7 +187,7 @@ private int excludeNomediaFiles(String[] fullPathNames) {
for (int i = 0; i < fullPathNames.length; i++) {
String fullPathName = fullPathNames[i];
if (fullPathName != null) {
- if (!MediaUtil.isImage(fullPathName, MediaUtil.IMG_TYPE_ALL) || isNoMedia(fullPathName, 22)) {
+ if (!PhotoPropertiesUtil.isImage(fullPathName, PhotoPropertiesUtil.IMG_TYPE_ALL) || isNoMedia(fullPathName, 22)) {
fullPathNames[i] = null;
} else {
itemsLeft++;
@@ -214,10 +214,10 @@ private int insertIntoMediaDatabase(Context context, String[] newPathNames) {
Long id = inMediaDb.get(fileName);
if (id != null) {
// already exists
- modifyCount += update_Android42("MediaScanner.insertIntoMediaDatabase already existing "
+ modifyCount += update_Android42("PhotoPropertiesMediaFilesScanner.insertIntoMediaDatabase already existing "
, context, id, new File(fileName));
} else {
- modifyCount += insert_Android42("MediaScanner.insertIntoMediaDatabase new item ", context, new File(fileName));
+ modifyCount += insert_Android42("PhotoPropertiesMediaFilesScanner.insertIntoMediaDatabase new item ", context, new File(fileName));
}
}
}
@@ -321,12 +321,12 @@ private int renameInMediaDatabase(Context context, Map old2NewFi
}
/** updates values with current values of file */
- public MediaContentValues getExifFromFile(File jpgFile) {
+ public PhotoPropertiesMediaDBContentValues getExifFromFile(File jpgFile) {
return getExifFromFile(createDefaultContentValues(), jpgFile);
}
/** updates values with current values of file. */
- protected MediaContentValues getExifFromFile(ContentValues values, File jpgFile) {
+ protected PhotoPropertiesMediaDBContentValues getExifFromFile(ContentValues values, File jpgFile) {
String absoluteJpgPath = FileUtils.tryGetCanonicalPath(jpgFile, jpgFile.getAbsolutePath());
BitmapFactory.Options options = new BitmapFactory.Options();
@@ -336,7 +336,7 @@ protected MediaContentValues getExifFromFile(ContentValues values, File jpgFile)
int mWidth = options.outWidth;
String imageType = options.outMimeType;
- MediaXmpSegment xmpContent = MediaXmpSegment.loadXmpSidecarContentOrNull(absoluteJpgPath, "getExifFromFile");
+ PhotoPropertiesXmpSegment xmpContent = PhotoPropertiesXmpSegment.loadXmpSidecarContentOrNull(absoluteJpgPath, "getExifFromFile");
final long xmpFilelastModified = getXmpFilelastModified(xmpContent);
values.put(FotoSql.SQL_COL_LAST_MODIFIED, jpgFile.lastModified() / 1000);
@@ -350,18 +350,18 @@ protected MediaContentValues getExifFromFile(ContentValues values, File jpgFile)
TagSql.setXmpFileModifyDate(values, xmpFilelastModified);
- IMetaApi exif = loadNonMediaValues(values, absoluteJpgPath, xmpContent);
+ IPhotoProperties exif = loadNonMediaValues(values, absoluteJpgPath, xmpContent);
- IMetaApi src = null;
+ IPhotoProperties src = null;
if (exif == null) {
src = xmpContent;
} else {
// (!writeExif) prefer read from xmp value before exif value
src = (LibGlobal.mediaUpdateStrategy.contains("J"))
? exif
- : new MetaApiChainReader(xmpContent, exif);
+ : new PhotoPropertiesChainReader(xmpContent, exif);
}
- MediaContentValues dest = new MediaContentValues().set(values, null);
+ PhotoPropertiesMediaDBContentValues dest = new PhotoPropertiesMediaDBContentValues().set(values, null);
if (src != null) {
// image has valid exif
@@ -381,7 +381,7 @@ private void updateTagRepository(List tags) {
}
/** in secs since 1970 */
- protected static long getXmpFilelastModified(MediaXmpSegment xmpContent) {
+ protected static long getXmpFilelastModified(PhotoPropertiesXmpSegment xmpContent) {
long xmpFilelastModified = 0;
if (xmpContent != null) {
xmpFilelastModified = xmpContent.getFilelastModified();
@@ -393,13 +393,13 @@ protected static long getXmpFilelastModified(MediaXmpSegment xmpContent) {
}
- protected IGeoPointInfo getPositionFromMeta(String absoluteJpgPath, String id, IMetaApi exif) {
+ protected IGeoPointInfo getPositionFromMeta(String absoluteJpgPath, String id, IPhotoProperties exif) {
if (exif != null) {
Double latitude = exif.getLatitude();
if (latitude != null) {
return new GeoPointDto(latitude, exif.getLongitude(), GeoPointDto.NO_ZOOM).setId(id);
}
- MediaXmpSegment xmpContent = MediaXmpSegment.loadXmpSidecarContentOrNull(absoluteJpgPath, "getPositionFromFile");
+ PhotoPropertiesXmpSegment xmpContent = PhotoPropertiesXmpSegment.loadXmpSidecarContentOrNull(absoluteJpgPath, "getPositionFromFile");
if (xmpContent != null) {
latitude = xmpContent.getLatitude();
if (latitude != null) {
@@ -411,11 +411,11 @@ protected IGeoPointInfo getPositionFromMeta(String absoluteJpgPath, String id, I
return null;
}
- abstract protected IMetaApi loadNonMediaValues(ContentValues destinationValues, String absoluteJpgPath, IMetaApi xmpContent);
+ abstract protected IPhotoProperties loadNonMediaValues(ContentValues destinationValues, String absoluteJpgPath, IPhotoProperties xmpContent);
/** @return number of copied properties */
- protected int getExifValues(MediaContentValues dest, File file, IMetaApi src) {
- return MediaUtil.copyNonEmpty(dest, src);
+ protected int getExifValues(PhotoPropertiesMediaDBContentValues dest, File file, IPhotoProperties src) {
+ return PhotoPropertiesUtil.copyNonEmpty(dest, src);
}
abstract public IGeoPointInfo getPositionFromFile(String absolutePath, String id);
@@ -559,14 +559,14 @@ public static boolean isScannerActive(ContentResolver cr) {
}
- public static MediaScanner getInstance(Context context) {
+ public static PhotoPropertiesMediaFilesScanner getInstance(Context context) {
if (sInstance == null) {
- sInstance = new MediaScannerExifInterface(context);
+ sInstance = new PhotoPropertiesMediaFilesScannerExifInterface(context);
}
return sInstance;
}
- public static void setInstance(MediaScanner sInstance) {
- MediaScanner.sInstance = sInstance;
+ public static void setInstance(PhotoPropertiesMediaFilesScanner sInstance) {
+ PhotoPropertiesMediaFilesScanner.sInstance = sInstance;
}
}
diff --git a/app/src/main/java/de/k3b/android/util/MediaScannerAsyncTask.java b/app/src/main/java/de/k3b/android/util/PhotoPropertiesMediaFilesScannerAsyncTask.java
similarity index 73%
rename from app/src/main/java/de/k3b/android/util/MediaScannerAsyncTask.java
rename to app/src/main/java/de/k3b/android/util/PhotoPropertiesMediaFilesScannerAsyncTask.java
index 00b45454..2d2439bf 100644
--- a/app/src/main/java/de/k3b/android/util/MediaScannerAsyncTask.java
+++ b/app/src/main/java/de/k3b/android/util/PhotoPropertiesMediaFilesScannerAsyncTask.java
@@ -31,14 +31,14 @@
* Created by k3b on 04.10.2016.
*/
-public class MediaScannerAsyncTask extends AsyncTask {
- private static final String CONTEXT = "MediaScannerAsyncTask.";
+public class PhotoPropertiesMediaFilesScannerAsyncTask extends AsyncTask {
+ private static final String CONTEXT = "PhotoPropertiesMediaFilesScannerAsyncTask.";
- protected final MediaScanner mScanner;
+ protected final PhotoPropertiesMediaFilesScanner mScanner;
protected final Context mContext;
protected final String mWhy;
- public MediaScannerAsyncTask(MediaScanner scanner, Context context, String why) {
+ public PhotoPropertiesMediaFilesScannerAsyncTask(PhotoPropertiesMediaFilesScanner scanner, Context context, String why) {
mWhy = why;
mContext = context.getApplicationContext();
mScanner = scanner;
@@ -60,21 +60,21 @@ protected void onPostExecute(Integer modifyCount) {
}
if (modifyCount > 0) {
- MediaScanner.notifyChanges(mContext, mWhy);
+ PhotoPropertiesMediaFilesScanner.notifyChanges(mContext, mWhy);
}
}
/** do not wait for result. */
- public static void updateMediaDBInBackground(MediaScanner scanner, Context context, String why, String[] oldPathNames, String[] newPathNames) {
+ public static void updateMediaDBInBackground(PhotoPropertiesMediaFilesScanner scanner, Context context, String why, String[] oldPathNames, String[] newPathNames) {
if (isGuiThread()) {
// update_Android42 scanner in seperate background task
- MediaScannerAsyncTask scanTask = new MediaScannerAsyncTask(scanner, context.getApplicationContext(), why + " from completed new AsycTask");
+ PhotoPropertiesMediaFilesScannerAsyncTask scanTask = new PhotoPropertiesMediaFilesScannerAsyncTask(scanner, context.getApplicationContext(), why + " from completed new AsycTask");
scanTask.execute(oldPathNames, newPathNames);
} else {
// Continute in background task
int modifyCount = scanner.updateMediaDatabase_Android42(context.getApplicationContext(), oldPathNames, newPathNames);
if (modifyCount > 0) {
- MediaScanner.notifyChanges(context, why + " within current non-gui-task");
+ PhotoPropertiesMediaFilesScanner.notifyChanges(context, why + " within current non-gui-task");
}
}
}
diff --git a/app/src/main/java/de/k3b/android/util/MediaScannerExifInterface.java b/app/src/main/java/de/k3b/android/util/PhotoPropertiesMediaFilesScannerExifInterface.java
similarity index 77%
rename from app/src/main/java/de/k3b/android/util/MediaScannerExifInterface.java
rename to app/src/main/java/de/k3b/android/util/PhotoPropertiesMediaFilesScannerExifInterface.java
index 345461d0..952e6235 100644
--- a/app/src/main/java/de/k3b/android/util/MediaScannerExifInterface.java
+++ b/app/src/main/java/de/k3b/android/util/PhotoPropertiesMediaFilesScannerExifInterface.java
@@ -27,24 +27,24 @@
import de.k3b.geo.api.IGeoPointInfo;
import de.k3b.media.ExifInterfaceEx;
-import de.k3b.media.IMetaApi;
+import de.k3b.media.IPhotoProperties;
/**
- * MediaScanner based on android ExifInterface.
+ * PhotoPropertiesMediaFilesScanner based on android ExifInterface.
*
* Created by k3b on 11.04.2017.
*/
-public class MediaScannerExifInterface extends MediaScanner {
- public MediaScannerExifInterface(Context context) {
+public class PhotoPropertiesMediaFilesScannerExifInterface extends PhotoPropertiesMediaFilesScanner {
+ public PhotoPropertiesMediaFilesScannerExifInterface(Context context) {
super(context);
}
@Override
- protected IMetaApi loadNonMediaValues(ContentValues destinationValues, String absoluteJpgPath, IMetaApi xmpContent) {
+ protected IPhotoProperties loadNonMediaValues(ContentValues destinationValues, String absoluteJpgPath, IPhotoProperties xmpContent) {
ExifInterfaceEx exif = null;
try {
- exif = new ExifInterfaceEx(absoluteJpgPath, null, xmpContent, "MediaScannerExifInterface.loadNonMediaValues");
+ exif = new ExifInterfaceEx(absoluteJpgPath, null, xmpContent, "PhotoPropertiesMediaFilesScannerExifInterface.loadNonMediaValues");
if (!exif.isValidJpgExifFormat()) exif = null;
} catch (IOException ex) {
// exif is null
@@ -61,7 +61,7 @@ protected IMetaApi loadNonMediaValues(ContentValues destinationValues, String ab
public IGeoPointInfo getPositionFromFile(String absoluteJpgPath, String id) {
ExifInterfaceEx exif = null;
try {
- exif = new ExifInterfaceEx(absoluteJpgPath, null, null, "MediaScannerExifInterface.getPositionFromFile");
+ exif = new ExifInterfaceEx(absoluteJpgPath, null, null, "PhotoPropertiesMediaFilesScannerExifInterface.getPositionFromFile");
if (!exif.isValidJpgExifFormat()) exif = null;
} catch (IOException ex) {
// exif is null
diff --git a/app/src/main/java/de/k3b/android/util/MediaScannerImageMetaReader.java b/app/src/main/java/de/k3b/android/util/PhotoPropertiesMediaFilesScannerImageMetaReader.java
similarity index 63%
rename from app/src/main/java/de/k3b/android/util/MediaScannerImageMetaReader.java
rename to app/src/main/java/de/k3b/android/util/PhotoPropertiesMediaFilesScannerImageMetaReader.java
index f4a349a4..18187044 100644
--- a/app/src/main/java/de/k3b/android/util/MediaScannerImageMetaReader.java
+++ b/app/src/main/java/de/k3b/android/util/PhotoPropertiesMediaFilesScannerImageMetaReader.java
@@ -25,24 +25,24 @@
import java.io.IOException;
import de.k3b.geo.api.IGeoPointInfo;
-import de.k3b.media.IMetaApi;
-import de.k3b.media.ImageMetaReader;
+import de.k3b.media.IPhotoProperties;
+import de.k3b.media.PhotoPropertiesImageReader;
/**
- * MediaScanner implementation based on Drewnoakes image meta reader.
+ * PhotoPropertiesMediaFilesScanner implementation based on Drewnoakes image meta reader.
* Created by k3b on 18.04.2017.
*/
-public class MediaScannerImageMetaReader extends MediaScanner {
- public MediaScannerImageMetaReader(Context context) {
+public class PhotoPropertiesMediaFilesScannerImageMetaReader extends PhotoPropertiesMediaFilesScanner {
+ public PhotoPropertiesMediaFilesScannerImageMetaReader(Context context) {
super(context);
}
@Override
- protected IMetaApi loadNonMediaValues(ContentValues destinationValues, String absoluteJpgPath, IMetaApi xmpContent) {
- ImageMetaReader exif = null;
+ protected IPhotoProperties loadNonMediaValues(ContentValues destinationValues, String absoluteJpgPath, IPhotoProperties xmpContent) {
+ PhotoPropertiesImageReader exif = null;
try {
- exif = new ImageMetaReader().load(absoluteJpgPath, null, xmpContent, "MediaScannerImageMetaReader load");
+ exif = new PhotoPropertiesImageReader().load(absoluteJpgPath, null, xmpContent, "PhotoPropertiesMediaFilesScannerImageMetaReader load");
} catch (IOException ex) {
// exif is null
}
@@ -56,9 +56,9 @@ protected IMetaApi loadNonMediaValues(ContentValues destinationValues, String ab
@Override
public IGeoPointInfo getPositionFromFile(String absoluteJpgPath, String id) {
- ImageMetaReader exif = null;
+ PhotoPropertiesImageReader exif = null;
try {
- exif = new ImageMetaReader().load(absoluteJpgPath, null, null, "MediaScannerImageMetaReader getPositionFromFile");
+ exif = new PhotoPropertiesImageReader().load(absoluteJpgPath, null, null, "PhotoPropertiesMediaFilesScannerImageMetaReader getPositionFromFile");
} catch (IOException ex) {
// exif is null
}
diff --git a/app/src/main/java/de/k3b/android/util/RecursiveMediaScannerAsyncTask.java b/app/src/main/java/de/k3b/android/util/RecursivePhotoPropertiesMediaFilesScannerAsyncTask.java
similarity index 82%
rename from app/src/main/java/de/k3b/android/util/RecursiveMediaScannerAsyncTask.java
rename to app/src/main/java/de/k3b/android/util/RecursivePhotoPropertiesMediaFilesScannerAsyncTask.java
index 4d00b339..f1ab2bfc 100644
--- a/app/src/main/java/de/k3b/android/util/RecursiveMediaScannerAsyncTask.java
+++ b/app/src/main/java/de/k3b/android/util/RecursivePhotoPropertiesMediaFilesScannerAsyncTask.java
@@ -35,21 +35,21 @@
import de.k3b.android.androFotoFinder.R;
import de.k3b.io.FileUtils;
-import de.k3b.media.MediaUtil;
+import de.k3b.media.PhotoPropertiesUtil;
/**
- * Special MediaScanner that can only handle inserNew/updateExisting for directories or jp(e)g files.
+ * Special PhotoPropertiesMediaFilesScanner that can only handle inserNew/updateExisting for directories or jp(e)g files.
*
* Can handle pause/resume scanning after a directory was scanned before
* continuing scanning other dirs.
*
* Created by k3b on 22.10.2015.
*/
-public class RecursiveMediaScannerAsyncTask extends MediaScannerAsyncTask {
+public class RecursivePhotoPropertiesMediaFilesScannerAsyncTask extends PhotoPropertiesMediaFilesScannerAsyncTask {
/** Either
* - current running scanner instance
* - or reumable instanc */
- public static RecursiveMediaScannerAsyncTask sScanner = null;
+ public static RecursivePhotoPropertiesMediaFilesScannerAsyncTask sScanner = null;
// statistics displayed in the status dialog
private String mCurrentFolder = "";
@@ -64,7 +64,7 @@ public class RecursiveMediaScannerAsyncTask extends MediaScannerAsyncTask {
* - or in pausing mode collecting all canceled scans here to be processed in resumeIfNecessary() */
private List mPaused = null;
- public RecursiveMediaScannerAsyncTask(MediaScanner scanner, Context context, String why) {
+ public RecursivePhotoPropertiesMediaFilesScannerAsyncTask(PhotoPropertiesMediaFilesScanner scanner, Context context, String why) {
super(scanner, context, why);
}
@@ -90,7 +90,7 @@ private int scanDirOrFile(File file) {
if (fullFilePath != null) {
if (!isCancelled()) {
if (file.isDirectory()) {
- String[] childFileNames = file.list(MediaUtil.JPG_FILENAME_FILTER);
+ String[] childFileNames = file.list(PhotoPropertiesUtil.JPG_FILENAME_FILTER);
if (childFileNames != null) {
// #33
@@ -116,7 +116,7 @@ public boolean accept(File file) {
}
}
}
- } else if (MediaUtil.isImage(file.getName(), MediaUtil.IMG_TYPE_ALL)) {
+ } else if (PhotoPropertiesUtil.isImage(file.getName(), PhotoPropertiesUtil.IMG_TYPE_ALL)) {
resultCount += runScanner(fullFilePath, fullFilePath);
}
} else if (mPaused != null) {
@@ -161,7 +161,7 @@ private Integer runScanner(String parentPath, String... fileNames) {
}
private void handleScannerCancel() {
- final boolean mustCreateResumeScanner = (mPaused != null) && ((this == RecursiveMediaScannerAsyncTask.sScanner) || (null == RecursiveMediaScannerAsyncTask.sScanner));
+ final boolean mustCreateResumeScanner = (mPaused != null) && ((this == RecursivePhotoPropertiesMediaFilesScannerAsyncTask.sScanner) || (null == RecursivePhotoPropertiesMediaFilesScannerAsyncTask.sScanner));
onStatusDialogEnd(mPaused, false);
if (sScanner == this) {
@@ -169,9 +169,9 @@ private void handleScannerCancel() {
}
if (mustCreateResumeScanner) {
- RecursiveMediaScannerAsyncTask newScanner = new RecursiveMediaScannerAsyncTask(mScanner, mScanner.mContext,"resumed " + mWhy);
+ RecursivePhotoPropertiesMediaFilesScannerAsyncTask newScanner = new RecursivePhotoPropertiesMediaFilesScannerAsyncTask(mScanner, mScanner.mContext,"resumed " + mWhy);
newScanner.mPaused = this.mPaused;
- RecursiveMediaScannerAsyncTask.sScanner = newScanner;
+ RecursivePhotoPropertiesMediaFilesScannerAsyncTask.sScanner = newScanner;
}
}
@@ -182,9 +182,9 @@ protected void onCancelled(Integer result) {
}
/** returns null if scanner is not busy-active */
- public static RecursiveMediaScannerAsyncTask getBusyScanner() {
- if ((RecursiveMediaScannerAsyncTask.sScanner != null) && (RecursiveMediaScannerAsyncTask.sScanner.getStatus() == Status.RUNNING)) {
- return RecursiveMediaScannerAsyncTask.sScanner;
+ public static RecursivePhotoPropertiesMediaFilesScannerAsyncTask getBusyScanner() {
+ if ((RecursivePhotoPropertiesMediaFilesScannerAsyncTask.sScanner != null) && (RecursivePhotoPropertiesMediaFilesScannerAsyncTask.sScanner.getStatus() == Status.RUNNING)) {
+ return RecursivePhotoPropertiesMediaFilesScannerAsyncTask.sScanner;
}
return null;
}
@@ -225,7 +225,7 @@ public void onClick(DialogInterface dialog, int which) {
@Override
public void run() {
if (mStatusDialog != null) {
- RecursiveMediaScannerAsyncTask scanner = RecursiveMediaScannerAsyncTask.this;
+ RecursivePhotoPropertiesMediaFilesScannerAsyncTask scanner = RecursivePhotoPropertiesMediaFilesScannerAsyncTask.this;
folder.setText(scanner.mCurrentFolder);
count.setText(parent.getString(R.string.image_loading_at_position_format, scanner.mCount));
if (scanner.mTimerRunner != null) {
@@ -254,8 +254,8 @@ private void onStatusDialogEnd(List pauseState, boolean cancelScanner) {
mPaused = pauseState;
cancel(false);
- if (RecursiveMediaScannerAsyncTask.sScanner == this) {
- RecursiveMediaScannerAsyncTask.sScanner = null;
+ if (RecursivePhotoPropertiesMediaFilesScannerAsyncTask.sScanner == this) {
+ RecursivePhotoPropertiesMediaFilesScannerAsyncTask.sScanner = null;
}
}
}
diff --git a/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java b/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java
index 2d7a52cc..44bb4a1d 100644
--- a/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java
+++ b/app/src/main/java/de/k3b/android/widget/BaseQueryActivity.java
@@ -55,7 +55,7 @@
import de.k3b.android.androFotoFinder.tagDB.TagSql;
import de.k3b.android.androFotoFinder.tagDB.TagsPickerFragment;
import de.k3b.android.osmdroid.OsmdroidUtil;
-import de.k3b.android.util.MediaScanner;
+import de.k3b.android.util.PhotoPropertiesMediaFilesScanner;
import de.k3b.database.QueryParameter;
import de.k3b.io.AlbumFile;
@@ -242,7 +242,7 @@ private QueryParameter calculateEffectiveGalleryContentQuery(QueryParameter root
BaseQueryActivity.this, uri, null);
if (albumQuery != null) {
result.getWhereFrom(albumQuery, true);
- } else if (MediaScanner.isNoMedia(path, MediaScanner.DEFAULT_SCAN_DEPTH)) {
+ } else if (PhotoPropertiesMediaFilesScanner.isNoMedia(path, PhotoPropertiesMediaFilesScanner.DEFAULT_SCAN_DEPTH)) {
// do not show (parent-)directories that contain ".nomedia"
return null;
} else {
diff --git a/app/src/main/java/de/k3b/android/widget/UpdateTask.java b/app/src/main/java/de/k3b/android/widget/UpdateTask.java
index 106bf706..2d48b583 100644
--- a/app/src/main/java/de/k3b/android/widget/UpdateTask.java
+++ b/app/src/main/java/de/k3b/android/widget/UpdateTask.java
@@ -12,18 +12,18 @@
import de.k3b.android.util.AndroidFileCommands;
import de.k3b.io.IProgessListener;
import de.k3b.io.collections.SelectedFiles;
-import de.k3b.media.MediaDiffCopy;
+import de.k3b.media.PhotoPropertiesDiffCopy;
/** update exif changes in asynch task mit chow dialog */
public class UpdateTask extends AsyncTaskWithProgressDialog implements IProgessListener {
private static final String mDebugPrefix = "UpdateTaskAsync-";
public static final int EXIF_RESULT_ID = 522;
- private MediaDiffCopy exifChanges;
+ private PhotoPropertiesDiffCopy exifChanges;
private final AndroidFileCommands cmd;
public UpdateTask(Activity ctx, AndroidFileCommands cmd,
- MediaDiffCopy exifChanges) {
+ PhotoPropertiesDiffCopy exifChanges) {
super(ctx, R.string.exif_menu_title);
this.exifChanges = exifChanges;
this.cmd = cmd;
diff --git a/app/src/main/res/layout/activity_media_db.xml b/app/src/main/res/layout/activity_media_db.xml
index 4282fe11..8c61ae58 100644
--- a/app/src/main/res/layout/activity_media_db.xml
+++ b/app/src/main/res/layout/activity_media_db.xml
@@ -8,7 +8,7 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="de.k3b.android.androFotoFinder.media.MediaDBActivity">
+ tools:context="de.k3b.android.androFotoFinder.media.PhotoPropertiesMediaDBCsvImportActivity">
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/menu/menu_bookmark_context.xml b/app/src/main/res/menu/menu_virtual_album_context.xml
similarity index 100%
rename from app/src/main/res/menu/menu_bookmark_context.xml
rename to app/src/main/res/menu/menu_virtual_album_context.xml
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index c15474d0..2573969c 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -200,7 +200,7 @@ Verstecken kann über das 'Media-Scanner' Gallery-Menü rückgängig gemacht wer
Lade Kontext ...
- Exif Metadataen bearbeiten
+ Bildeigenschaften (Exif) bearbeiten
Titel
Beschreibung
Bewertung
@@ -212,7 +212,7 @@ Verstecken kann über das 'Media-Scanner' Gallery-Menü rückgängig gemacht wer
Automatische processing bearbeiten
Umbenennungsmuster
- Exif
+ Bildeigenschaften (Exif)
- Edit Exif
+ Edit Properties (Exif)
Title
Description
Rating
@@ -216,7 +216,7 @@ You can undo hiding by calling the mediascanner from gallery-menu."
Edit Photo Autoprocessing
Filename Pattern
- Exif
+ Photo Properties (Exif)
[MediaContentValues]
- [IMetaApi] --> [MediaCursor]
- [IMetaApi] --> [ExifInterfaceEx]
- [IMetaApi] --> [MediaCsvItem]
- [MediaDTO] <- [IMetaApi]
- [IMetaApi] --> [MediaXmpSegment]
- [IMetaApi] -> [MetaApiWrapper]
+ title IPhotoProperties implementation
+ [IPhotoProperties] --> [MediaContentValues]
+ [IPhotoProperties] --> [MediaCursor]
+ [IPhotoProperties] --> [ExifInterfaceEx]
+ [IPhotoProperties] --> [PhotoPropertiesCsvItem]
+ [PhotoPropertiesDTO] <- [IPhotoProperties]
+ [IPhotoProperties] --> [PhotoPropertiesXmpSegment]
+ [IPhotoProperties] -> [PhotoPropertiesWrapper]
[MediaContentValues] --> [MediaDB]
[MediaCursor] <-- [MediaDB]
@@ -101,11 +101,11 @@
[ExifInterfaceEx] <-- [JPG file]
[ExifInterfaceEx] --> [JPG file]
- [MediaCsvItem] --> [CSV file]
- [MediaCsvItem] <-- [CSV file]
+ [PhotoPropertiesCsvItem] --> [CSV file]
+ [PhotoPropertiesCsvItem] <-- [CSV file]
- [MediaXmpSegment] --> [XMP file]
- [MediaXmpSegment] <-- [XMP file]
+ [PhotoPropertiesXmpSegment] --> [XMP file]
+ [PhotoPropertiesXmpSegment] <-- [XMP file]
@enduml
@@ -118,38 +118,38 @@
*
* Created by k3b on 09.10.2016.
*/
-public interface IMetaApi {
+public interface IPhotoProperties {
/** Normalized absolute path to file (jpg or xmp) */
String getPath();
- IMetaApi setPath(String filePath);
+ IPhotoProperties setPath(String filePath);
/** When the photo was taken (not file create/modify date) in local time or utc*/
Date getDateTimeTaken();
- IMetaApi setDateTimeTaken(Date value);
+ IPhotoProperties setDateTimeTaken(Date value);
/** latitude, in degrees north. (-90 .. +90); longitude, in degrees east. (-180 .. + 180) */
- IMetaApi setLatitudeLongitude(Double latitude, Double longitude);
+ IPhotoProperties setLatitudeLongitude(Double latitude, Double longitude);
Double getLatitude();
Double getLongitude();
/** Title = Short Descrioption used as caption */
String getTitle();
- IMetaApi setTitle(String title);
+ IPhotoProperties setTitle(String title);
/** Longer description = comment. may have more than one line */
String getDescription();
- IMetaApi setDescription(String description);
+ IPhotoProperties setDescription(String description);
/** Tags/Keywords/Categories/VirtualAlbum used to find images */
List getTags();
- IMetaApi setTags(List tags);
+ IPhotoProperties setTags(List tags);
/** 5=best .. 1=worst or 0/null unknown */
Integer getRating();
- IMetaApi setRating(Integer value);
+ IPhotoProperties setRating(Integer value);
/** real photo-files and database entries have either visiblity PUBLIC or PRIVATE (if it has a tag PRIVATE) */
VISIBILITY getVisibility();
- IMetaApi setVisibility(VISIBILITY visibility);
+ IPhotoProperties setVisibility(VISIBILITY visibility);
}
diff --git a/fotolib2/src/main/java/de/k3b/media/Media2ExistingFileSaver.java b/fotolib2/src/main/java/de/k3b/media/PhotoProperties2ExistingFileSaver.java
similarity index 79%
rename from fotolib2/src/main/java/de/k3b/media/Media2ExistingFileSaver.java
rename to fotolib2/src/main/java/de/k3b/media/PhotoProperties2ExistingFileSaver.java
index 07cb6e3c..34079a51 100644
--- a/fotolib2/src/main/java/de/k3b/media/Media2ExistingFileSaver.java
+++ b/fotolib2/src/main/java/de/k3b/media/PhotoProperties2ExistingFileSaver.java
@@ -5,14 +5,14 @@
import de.k3b.io.FileProcessor;
import de.k3b.io.IItemSaver;
-public class Media2ExistingFileSaver implements IItemSaver {
+public class PhotoProperties2ExistingFileSaver implements IItemSaver {
private final IItemSaver fileSaver;
- public Media2ExistingFileSaver(IItemSaver fileSaver) {
+ public PhotoProperties2ExistingFileSaver(IItemSaver fileSaver) {
this.fileSaver = fileSaver;
}
@Override
- public boolean save(IMetaApi item) {
+ public boolean save(IPhotoProperties item) {
if (item != null) {
String path = item.getPath();
if (path != null) {
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaAsString.java b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesAsString.java
similarity index 63%
rename from fotolib2/src/main/java/de/k3b/media/MediaAsString.java
rename to fotolib2/src/main/java/de/k3b/media/PhotoPropertiesAsString.java
index c101ca4d..76cf64c9 100644
--- a/fotolib2/src/main/java/de/k3b/media/MediaAsString.java
+++ b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesAsString.java
@@ -27,15 +27,15 @@
import de.k3b.io.FileUtils;
/**
- * A IMetaApi that can be converted to/from string using toString() and fromString().
+ * A IPhotoProperties that can be converted to/from string using toString() and fromString().
*
* Created by k3b on 14.06.2017.
*/
-public class MediaAsString extends MediaCsvItem implements IMetaApi {
+public class PhotoPropertiesAsString extends PhotoPropertiesCsvItem implements IPhotoProperties {
private int colExtra;
- public MediaAsString() {
+ public PhotoPropertiesAsString() {
setFieldDelimiter(CsvItem.DEFAULT_CSV_FIELD_DELIMITER);
String[] fields = MEDIA_CSV_STANDARD_HEADER.split(CsvItem.DEFAULT_CSV_FIELD_DELIMITER);
this.setHeader(Arrays.asList(fields));
@@ -45,21 +45,21 @@ public MediaAsString() {
setData(new String[size]);
}
- /** convert serializedContent back to IMetaApi if serializedContent was generated
- * by MediaAsString.toString() */
- public MediaAsString fromString(String serializedContent) {
+ /** convert serializedContent back to IPhotoProperties if serializedContent was generated
+ * by PhotoPropertiesAsString.toString() */
+ public PhotoPropertiesAsString fromString(String serializedContent) {
CsvReader reader = new CsvReader(new StringReader(serializedContent));
setData(reader.readLine());
- FileUtils.close(reader,"MediaAsString.fromString");
+ FileUtils.close(reader,"PhotoPropertiesAsString.fromString");
return this;
}
- public MediaAsString setData(IMetaApi data) {
+ public PhotoPropertiesAsString setData(IPhotoProperties data) {
this.clear();
if (data != null) {
- MediaUtil.copy(this, data, true, true);
- if (data instanceof MediaAsString) {
- this.setExtra(((MediaAsString) data).getExtra());
+ PhotoPropertiesUtil.copy(this, data, true, true);
+ if (data instanceof PhotoPropertiesAsString) {
+ this.setExtra(((PhotoPropertiesAsString) data).getExtra());
}
}
return this;
@@ -69,16 +69,16 @@ public String getExtra() {
return getString("getExtra", colExtra);
}
- public MediaAsString setExtra(String title) {
+ public PhotoPropertiesAsString setExtra(String title) {
setString(title, colExtra);
return this;
}
- public static String toString(IMetaApi mediaDefaults) {
+ public static String toString(IPhotoProperties mediaDefaults) {
if (mediaDefaults != null) {
- return (mediaDefaults instanceof MediaAsString)
+ return (mediaDefaults instanceof PhotoPropertiesAsString)
? mediaDefaults.toString()
- : new MediaAsString().setData(mediaDefaults).toString();
+ : new PhotoPropertiesAsString().setData(mediaDefaults).toString();
}
return null;
}
diff --git a/fotolib2/src/main/java/de/k3b/media/JpgMetaWorkflow.java b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesBulkUpdateService.java
similarity index 76%
rename from fotolib2/src/main/java/de/k3b/media/JpgMetaWorkflow.java
rename to fotolib2/src/main/java/de/k3b/media/PhotoPropertiesBulkUpdateService.java
index 303ea33f..ea665a77 100644
--- a/fotolib2/src/main/java/de/k3b/media/JpgMetaWorkflow.java
+++ b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesBulkUpdateService.java
@@ -34,15 +34,15 @@
import de.k3b.transactionlog.TransactionLoggerBase;
/**
- * apply meta data changes to jpg and/or xmp file and log.
+ * apply meta data changes to one ore more jpg and/or xmp file and log.
*
* Created by k3b on 25.08.2015.
*/
-public class JpgMetaWorkflow {
+public class PhotoPropertiesBulkUpdateService {
private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
private final TransactionLoggerBase transactionLogger;
- private StringBuilder debugExif(StringBuilder sb, String context, MetaWriterExifXml exif, File filePath) {
+ private StringBuilder debugExif(StringBuilder sb, String context, PhotoPropertiesUpdateHandler exif, File filePath) {
if (sb != null) {
sb.append("\n\t").append(context).append("\t: ");
@@ -50,7 +50,7 @@ private StringBuilder debugExif(StringBuilder sb, String context, MetaWriterExif
if (exif.getExif() != null) {
sb.append(exif.getExif().getDebugString(" "));
} else {
- sb.append(MediaUtil.toString(exif, false, null, MediaUtil.FieldID.path));
+ sb.append(PhotoPropertiesUtil.toString(exif, false, null, PhotoPropertiesUtil.FieldID.path));
}
}
}
@@ -58,32 +58,32 @@ private StringBuilder debugExif(StringBuilder sb, String context, MetaWriterExif
}
/** overwrite to create a android specific Workflow */
- public JpgMetaWorkflow(TransactionLoggerBase transactionLogger) {
+ public PhotoPropertiesBulkUpdateService(TransactionLoggerBase transactionLogger) {
this.transactionLogger = transactionLogger;
}
- public MetaWriterExifXml saveLatLon(File filePath, Double latitude, Double longitude) {
- IMetaApi changedData = new MediaDTO().setLatitudeLongitude(latitude, longitude);
- MediaDiffCopy metaDiffCopy = new MediaDiffCopy(true, true)
- .setDiff(changedData, MediaUtil.FieldID.latitude_longitude);
- MetaWriterExifXml exif = applyChanges(filePath, null, 0, false, metaDiffCopy);
+ public PhotoPropertiesUpdateHandler saveLatLon(File filePath, Double latitude, Double longitude) {
+ IPhotoProperties changedData = new PhotoPropertiesDTO().setLatitudeLongitude(latitude, longitude);
+ PhotoPropertiesDiffCopy metaDiffCopy = new PhotoPropertiesDiffCopy(true, true)
+ .setDiff(changedData, PhotoPropertiesUtil.FieldID.latitude_longitude);
+ PhotoPropertiesUpdateHandler exif = applyChanges(filePath, null, 0, false, metaDiffCopy);
metaDiffCopy.close();
return exif;
}
/** writes either (changes + _affectedFields) or metaDiffCopy to jpg/xmp-filePath.
* Returns new values or null if no change. */
- public MetaWriterExifXml applyChanges(File inFilePath, String outFilePath,
- long id, boolean deleteOriginalWhenFinished, MediaDiffCopy metaDiffCopy) {
+ public PhotoPropertiesUpdateHandler applyChanges(File inFilePath, String outFilePath,
+ long id, boolean deleteOriginalWhenFinished, PhotoPropertiesDiffCopy metaDiffCopy) {
StringBuilder sb = (LibGlobal.debugEnabled)
? createDebugStringBuilder(inFilePath)
: null;
File outFile = (outFilePath != null) ? new File(outFilePath) : inFilePath;
if ((inFilePath != null) && outFile.getParentFile().canWrite()) {
- MetaWriterExifXml exif = null;
+ PhotoPropertiesUpdateHandler exif = null;
try {
long lastModified = inFilePath.lastModified();
- exif = MetaWriterExifXml.create (inFilePath.getAbsolutePath(), outFilePath, false, "MetaWriterExifXml:");
+ exif = PhotoPropertiesUpdateHandler.create (inFilePath.getAbsolutePath(), outFilePath, false, "PhotoPropertiesUpdateHandler:");
debugExif(sb, "old", exif, inFilePath);
List oldTags = exif.getTags();
@@ -99,12 +99,12 @@ public MetaWriterExifXml applyChanges(File inFilePath, String outFilePath,
}
}
- List changed = metaDiffCopy.applyChanges(exif);
+ List changed = metaDiffCopy.applyChanges(exif);
if (!sameFile || (changed != null)) {
debugExif(sb, "assign ", exif, inFilePath);
- exif.save("MetaWriterExifXml save");
+ exif.save("PhotoPropertiesUpdateHandler save");
if (LibGlobal.preserveJpgFileModificationDate) {
// preseve file modification date
@@ -114,8 +114,8 @@ public MetaWriterExifXml applyChanges(File inFilePath, String outFilePath,
id = updateMediaDB(id, inFilePath.getAbsolutePath(), outFile);
if (sb != null) {
- MetaWriterExifXml exifVerify = MetaWriterExifXml.create (inFilePath.getAbsolutePath(),
- null, false, "dbg in MetaWriterExifXml", true, true, false);
+ PhotoPropertiesUpdateHandler exifVerify = PhotoPropertiesUpdateHandler.create (inFilePath.getAbsolutePath(),
+ null, false, "dbg in PhotoPropertiesUpdateHandler", true, true, false);
debugExif(sb, "new ", exifVerify, inFilePath);
}
@@ -147,7 +147,7 @@ public MetaWriterExifXml applyChanges(File inFilePath, String outFilePath,
}
if (sb != null) {
- JpgMetaWorkflow.logger.info(sb.toString());
+ PhotoPropertiesBulkUpdateService.logger.info(sb.toString());
}
return exif;
} catch (IOException e) {
@@ -157,7 +157,7 @@ public MetaWriterExifXml applyChanges(File inFilePath, String outFilePath,
}
sb.append("error='").append(e.getMessage()).append("' ");
- JpgMetaWorkflow.logger.error(sb.toString(), e);
+ PhotoPropertiesBulkUpdateService.logger.error(sb.toString(), e);
return null;
}
} else {
@@ -166,7 +166,7 @@ public MetaWriterExifXml applyChanges(File inFilePath, String outFilePath,
}
sb.append("error='file is write protected' ");
- JpgMetaWorkflow.logger.error(sb.toString());
+ PhotoPropertiesBulkUpdateService.logger.error(sb.toString());
return null;
}
}
@@ -175,16 +175,16 @@ protected void deleteFile(File delete) {
if ((delete != null) && delete.exists()) {
delete.delete();
if (LibGlobal.debugEnabledJpg) {
- logger.info("JpgMetaWorkflow deleteFile " + delete);
+ logger.info("PhotoPropertiesBulkUpdateService deleteFile " + delete);
}
}
}
/** return modified out file or null if filename must not change due to visibility rule */
- protected File handleVisibility(VISIBILITY newVisibility, File outFile, MetaWriterExifXml exif) {
+ protected File handleVisibility(VISIBILITY newVisibility, File outFile, PhotoPropertiesUpdateHandler exif) {
if (LibGlobal.renamePrivateJpg) {
final String oldAbsoluteOutPath = (outFile == null) ? null : outFile.getAbsolutePath();
- String newAbsoluteOutPath = MediaUtil.getModifiedPath(oldAbsoluteOutPath, newVisibility);
+ String newAbsoluteOutPath = PhotoPropertiesUtil.getModifiedPath(oldAbsoluteOutPath, newVisibility);
if (newAbsoluteOutPath != null) {
String sourcePath = exif.getPath();
@@ -223,7 +223,7 @@ public static int getRotationFromExifOrientation(String fullPathToImageFile, Inp
ExifInterfaceEx exif = new ExifInterfaceEx(fullPathToImageFile, inputStream, null, "getRotationFromExifOrientation");
if (exif.isValidJpgExifFormat()) {
- return MediaUtil.exifOrientationCode2RotationDegrees(exif.getAttributeInt(ExifInterfaceEx.TAG_ORIENTATION, 0), 0);
+ return PhotoPropertiesUtil.exifOrientationCode2RotationDegrees(exif.getAttributeInt(ExifInterfaceEx.TAG_ORIENTATION, 0), 0);
}
}
catch (Exception e) {
diff --git a/fotolib2/src/main/java/de/k3b/media/MetaApiChainReader.java b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesChainReader.java
similarity index 94%
rename from fotolib2/src/main/java/de/k3b/media/MetaApiChainReader.java
rename to fotolib2/src/main/java/de/k3b/media/PhotoPropertiesChainReader.java
index 0decffee..9790b3e5 100644
--- a/fotolib2/src/main/java/de/k3b/media/MetaApiChainReader.java
+++ b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesChainReader.java
@@ -29,10 +29,10 @@
*
* Created by k3b on 22.04.2017.
*/
-public class MetaApiChainReader extends MetaApiWrapper {
- private final IMetaApi readChild2;
+public class PhotoPropertiesChainReader extends PhotoPropertiesWrapper {
+ private final IPhotoProperties readChild2;
- public MetaApiChainReader(IMetaApi readChild1, IMetaApi readChild2) {
+ public PhotoPropertiesChainReader(IPhotoProperties readChild1, IPhotoProperties readChild2) {
super(readChild1, null);
this.readChild2 = readChild2;
}
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaCsvItem.java b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesCsvItem.java
similarity index 62%
rename from fotolib2/src/main/java/de/k3b/media/MediaCsvItem.java
rename to fotolib2/src/main/java/de/k3b/media/PhotoPropertiesCsvItem.java
index 9c1ab98a..a34d1728 100644
--- a/fotolib2/src/main/java/de/k3b/media/MediaCsvItem.java
+++ b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesCsvItem.java
@@ -29,21 +29,21 @@
import de.k3b.tagDB.TagConverter;
/**
- * csv storage for IMetaApi items
+ * csv storage for IPhotoProperties items
*
* Created by k3b on 10.10.2016.
*/
-public class MediaCsvItem extends CsvItem implements IMetaApi {
- public final static String MEDIA_CSV_STANDARD_HEADER = MediaXmpFieldDefinition.SourceFile.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
- MediaXmpFieldDefinition.title.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
- MediaXmpFieldDefinition.description.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
- MediaXmpFieldDefinition.DateTimeOriginal.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
- MediaXmpFieldDefinition.GPSLatitude.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
- MediaXmpFieldDefinition.GPSLongitude.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
- MediaXmpFieldDefinition.subject.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
- MediaXmpFieldDefinition.Rating.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
- MediaXmpFieldDefinition.Visibility.getShortName();
+public class PhotoPropertiesCsvItem extends CsvItem implements IPhotoProperties {
+ public final static String MEDIA_CSV_STANDARD_HEADER = PhotoPropertiesXmpFieldDefinition.SourceFile.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
+ PhotoPropertiesXmpFieldDefinition.title.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
+ PhotoPropertiesXmpFieldDefinition.description.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
+ PhotoPropertiesXmpFieldDefinition.DateTimeOriginal.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
+ PhotoPropertiesXmpFieldDefinition.GPSLatitude.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
+ PhotoPropertiesXmpFieldDefinition.GPSLongitude.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
+ PhotoPropertiesXmpFieldDefinition.subject.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
+ PhotoPropertiesXmpFieldDefinition.Rating.getShortName() + DEFAULT_CSV_FIELD_DELIMITER +
+ PhotoPropertiesXmpFieldDefinition.Visibility.getShortName();
private int colFilePath;
private int colFileModifyDate;
@@ -78,19 +78,19 @@ public void setHeader(List header) {
protected void initFieldDefinitions(List lcHeader) {
// import specific
- colFilePath = getColumnIndex(lcHeader, MediaXmpFieldDefinition.SourceFile);
- colFileModifyDate = getColumnIndex(lcHeader, MediaXmpFieldDefinition.FileModifyDate);
+ colFilePath = getColumnIndex(lcHeader, PhotoPropertiesXmpFieldDefinition.SourceFile);
+ colFileModifyDate = getColumnIndex(lcHeader, PhotoPropertiesXmpFieldDefinition.FileModifyDate);
- colDateTimeTaken = getColumnIndex(lcHeader, MediaXmpFieldDefinition.DateTimeOriginal);
- colDateCreated = getColumnIndex(lcHeader, MediaXmpFieldDefinition.DateCreated);
- colCreateDate = getColumnIndex(lcHeader, MediaXmpFieldDefinition.CreateDate);
- colTitle = getColumnIndex(lcHeader, MediaXmpFieldDefinition.title);
- colDescription = getColumnIndex(lcHeader, MediaXmpFieldDefinition.description);
- colTags = getColumnIndex(lcHeader, MediaXmpFieldDefinition.subject);
- colLatitude = getColumnIndex(lcHeader, MediaXmpFieldDefinition.GPSLatitude);
- colLongitude = getColumnIndex(lcHeader, MediaXmpFieldDefinition.GPSLongitude);
- colRating = getColumnIndex(lcHeader, MediaXmpFieldDefinition.Rating);
- colVisibility = getColumnIndex(lcHeader, MediaXmpFieldDefinition.Visibility);
+ colDateTimeTaken = getColumnIndex(lcHeader, PhotoPropertiesXmpFieldDefinition.DateTimeOriginal);
+ colDateCreated = getColumnIndex(lcHeader, PhotoPropertiesXmpFieldDefinition.DateCreated);
+ colCreateDate = getColumnIndex(lcHeader, PhotoPropertiesXmpFieldDefinition.CreateDate);
+ colTitle = getColumnIndex(lcHeader, PhotoPropertiesXmpFieldDefinition.title);
+ colDescription = getColumnIndex(lcHeader, PhotoPropertiesXmpFieldDefinition.description);
+ colTags = getColumnIndex(lcHeader, PhotoPropertiesXmpFieldDefinition.subject);
+ colLatitude = getColumnIndex(lcHeader, PhotoPropertiesXmpFieldDefinition.GPSLatitude);
+ colLongitude = getColumnIndex(lcHeader, PhotoPropertiesXmpFieldDefinition.GPSLongitude);
+ colRating = getColumnIndex(lcHeader, PhotoPropertiesXmpFieldDefinition.Rating);
+ colVisibility = getColumnIndex(lcHeader, PhotoPropertiesXmpFieldDefinition.Visibility);
}
@Override
@@ -99,7 +99,7 @@ public String getPath() {
}
@Override
- public IMetaApi setPath(String filePath) {
+ public IPhotoProperties setPath(String filePath) {
setString(filePath, colFilePath);
return this;
}
@@ -114,13 +114,13 @@ public Date getDateTimeTaken() {
}
@Override
- public IMetaApi setDateTimeTaken(Date value) {
+ public IPhotoProperties setDateTimeTaken(Date value) {
setDate(value, colCreateDate, colDateCreated, colDateTimeTaken );
return this;
}
/** latitude, in degrees north. (-90 .. +90); longitude, in degrees east. (-180 .. + 180) */
- @Override public IMetaApi setLatitudeLongitude(Double latitude, Double longitude) {
+ @Override public IPhotoProperties setLatitudeLongitude(Double latitude, Double longitude) {
setString(GeoUtil.toCsvStringLatLon(latitude), colLatitude);
setString(GeoUtil.toCsvStringLatLon(longitude), colLongitude);
return this;
@@ -142,7 +142,7 @@ public String getTitle() {
}
@Override
- public IMetaApi setTitle(String title) {
+ public IPhotoProperties setTitle(String title) {
setString(title, colTitle);
return this;
}
@@ -153,7 +153,7 @@ public String getDescription() {
}
@Override
- public IMetaApi setDescription(String description) {
+ public IPhotoProperties setDescription(String description) {
setString(description, colDescription);
return this;
}
@@ -165,7 +165,7 @@ public List getTags() {
}
@Override
- public IMetaApi setTags(List tags) {
+ public IPhotoProperties setTags(List tags) {
setString(TagConverter.asDbString(null, tags), colTags);
return this;
}
@@ -176,7 +176,7 @@ public Integer getRating() {
}
@Override
- public IMetaApi setRating(Integer value) {
+ public IPhotoProperties setRating(Integer value) {
setString(value, colRating);
return this;
}
@@ -189,7 +189,7 @@ public VISIBILITY getVisibility() {
}
@Override
- public IMetaApi setVisibility(VISIBILITY value) {
+ public IPhotoProperties setVisibility(VISIBILITY value) {
String sValue = VISIBILITY.isChangingValue(value) ? value.toString() : null;
setString(sValue, colVisibility);
return this;
@@ -204,7 +204,7 @@ public IMetaApi setVisibility(VISIBILITY value) {
* @return the zero-based column index for the given column name, or -1 if
* the column name does not exist.
*/
- protected int getColumnIndex(List lcHeader, MediaXmpFieldDefinition columnDefinition) {
+ protected int getColumnIndex(List lcHeader, PhotoPropertiesXmpFieldDefinition columnDefinition) {
String destCcolumnName = columnDefinition.getShortName();
int columnIndex = lcHeader.indexOf(destCcolumnName.toLowerCase());
if (columnIndex > maxColumnIndex) maxColumnIndex = columnIndex;
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaCsvSaver.java b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesCsvSaver.java
similarity index 78%
rename from fotolib2/src/main/java/de/k3b/media/MediaCsvSaver.java
rename to fotolib2/src/main/java/de/k3b/media/PhotoPropertiesCsvSaver.java
index 6f32ad1f..ebd3d480 100644
--- a/fotolib2/src/main/java/de/k3b/media/MediaCsvSaver.java
+++ b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesCsvSaver.java
@@ -29,26 +29,26 @@
* Created by k3b on 13.10.2016.
*/
-public class MediaCsvSaver implements IItemSaver {
+public class PhotoPropertiesCsvSaver implements IItemSaver {
private PrintWriter printer;
- private final MediaCsvItem csvLine;
+ private final PhotoPropertiesCsvItem csvLine;
- public MediaCsvSaver(PrintWriter printer) {
+ public PhotoPropertiesCsvSaver(PrintWriter printer) {
setPrinter(printer);
- csvLine = new MediaCsvItem();
- defineHeader(MediaCsvItem.MEDIA_CSV_STANDARD_HEADER);
+ csvLine = new PhotoPropertiesCsvItem();
+ defineHeader(PhotoPropertiesCsvItem.MEDIA_CSV_STANDARD_HEADER);
}
- protected MediaCsvSaver setPrinter(PrintWriter printer) {
+ protected PhotoPropertiesCsvSaver setPrinter(PrintWriter printer) {
this.printer = printer;
return this;
}
@Override
- public boolean save(IMetaApi item) {
+ public boolean save(IPhotoProperties item) {
if (item != null) {
csvLine.clear();
- MediaUtil.copy(csvLine, item, true, true);
+ PhotoPropertiesUtil.copy(csvLine, item, true, true);
if (!csvLine.isEmpty()) {
this.printer.write(csvLine.toString());
this.printer.write(CsvItem.DEFAULT_CHAR_LINE_DELIMITER);
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaCsvStringSaver.java b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesCsvStringSaver.java
similarity index 73%
rename from fotolib2/src/main/java/de/k3b/media/MediaCsvStringSaver.java
rename to fotolib2/src/main/java/de/k3b/media/PhotoPropertiesCsvStringSaver.java
index da9b33c1..ea2069b3 100644
--- a/fotolib2/src/main/java/de/k3b/media/MediaCsvStringSaver.java
+++ b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesCsvStringSaver.java
@@ -3,10 +3,10 @@
import java.io.PrintWriter;
import java.io.StringWriter;
-public class MediaCsvStringSaver extends MediaCsvSaver{
+public class PhotoPropertiesCsvStringSaver extends PhotoPropertiesCsvSaver {
private StringWriter result = new StringWriter();
private PrintWriter writer = new PrintWriter(result);
- public MediaCsvStringSaver() {
+ public PhotoPropertiesCsvStringSaver() {
super(null);
this.setPrinter(writer);
}
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaDTO.java b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesDTO.java
similarity index 76%
rename from fotolib2/src/main/java/de/k3b/media/MediaDTO.java
rename to fotolib2/src/main/java/de/k3b/media/PhotoPropertiesDTO.java
index 6e76d74b..8bfc7c8e 100644
--- a/fotolib2/src/main/java/de/k3b/media/MediaDTO.java
+++ b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesDTO.java
@@ -25,12 +25,12 @@
import de.k3b.io.VISIBILITY;
/**
- * DTO=DataTransferObject: In Memory implementation of {@link IMetaApi}.
+ * DTO=DataTransferObject: In Memory implementation of {@link IPhotoProperties}.
*
* Created by k3b on 10.10.2016.
*/
-public class MediaDTO implements IMetaApi {
+public class PhotoPropertiesDTO implements IPhotoProperties {
public String path;
public Date dateTimeTaken;
public Double latitude;
@@ -41,13 +41,13 @@ public class MediaDTO implements IMetaApi {
private Integer rating;
private VISIBILITY visibility;
- public MediaDTO() {}
+ public PhotoPropertiesDTO() {}
- public MediaDTO(IMetaApi src) {
- MediaUtil.copy(this, src, true, true);
+ public PhotoPropertiesDTO(IPhotoProperties src) {
+ PhotoPropertiesUtil.copy(this, src, true, true);
}
- public MediaDTO clear() {
+ public PhotoPropertiesDTO clear() {
path = null;
dateTimeTaken = null;
latitude = null;
@@ -65,7 +65,7 @@ public String getPath() {
}
@Override
- public IMetaApi setPath(String filePath) {
+ public IPhotoProperties setPath(String filePath) {
path = filePath;
return this;
}
@@ -76,13 +76,13 @@ public Date getDateTimeTaken() {
}
@Override
- public IMetaApi setDateTimeTaken(Date value) {
+ public IPhotoProperties setDateTimeTaken(Date value) {
dateTimeTaken = value;
return this;
}
/** latitude, in degrees north. (-90 .. +90); longitude, in degrees east. (-180 .. + 180) */
- @Override public IMetaApi setLatitudeLongitude(Double latitude, Double longitude) {
+ @Override public IPhotoProperties setLatitudeLongitude(Double latitude, Double longitude) {
this.latitude = latitude;
this.longitude = longitude;
return this;
@@ -104,7 +104,7 @@ public String getTitle() {
}
@Override
- public IMetaApi setTitle(String title) {
+ public IPhotoProperties setTitle(String title) {
this.title = title;
return this;
}
@@ -115,7 +115,7 @@ public String getDescription() {
}
@Override
- public IMetaApi setDescription(String description) {
+ public IPhotoProperties setDescription(String description) {
this.description = description;
return this;
}
@@ -126,7 +126,7 @@ public List getTags() {
}
@Override
- public IMetaApi setTags(List tags) {
+ public IPhotoProperties setTags(List tags) {
this.tags = tags;
return this;
}
@@ -140,7 +140,7 @@ public Integer getRating() {
}
@Override
- public IMetaApi setRating(Integer value) {
+ public IPhotoProperties setRating(Integer value) {
this.rating = value;
return this;
}
@@ -149,13 +149,13 @@ public VISIBILITY getVisibility() {
return visibility;
}
- public IMetaApi setVisibility(VISIBILITY visibility) {
+ public IPhotoProperties setVisibility(VISIBILITY visibility) {
this.visibility = visibility;
return this;
}
@Override
public String toString() {
- return MediaUtil.toString(this);
+ return PhotoPropertiesUtil.toString(this);
}
}
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaDiffCopy.java b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesDiffCopy.java
similarity index 88%
rename from fotolib2/src/main/java/de/k3b/media/MediaDiffCopy.java
rename to fotolib2/src/main/java/de/k3b/media/PhotoPropertiesDiffCopy.java
index ae94718f..5045699c 100644
--- a/fotolib2/src/main/java/de/k3b/media/MediaDiffCopy.java
+++ b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesDiffCopy.java
@@ -26,13 +26,13 @@
import de.k3b.io.ListUtils;
import de.k3b.io.VISIBILITY;
-import de.k3b.media.MediaUtil.FieldID;
+import de.k3b.media.PhotoPropertiesUtil.FieldID;
import de.k3b.tagDB.TagProcessor;
import de.k3b.tagDB.TagRepository;
/**
- * Define and copy delta between two {@link IMetaApi} items.
+ * Define and copy delta between two {@link IPhotoProperties} items.
* Used for multiselection Exif update.
*
* Workflow: setDiff(...); applyChanges(...); .. applyChanges(...); close();
@@ -40,7 +40,7 @@
* Created by k3b on 07.07.2017.
*/
-public class MediaDiffCopy {
+public class PhotoPropertiesDiffCopy {
/** true: do not copy file path */
private final boolean excludePath;
private final boolean overwriteExisting;
@@ -48,9 +48,9 @@ public class MediaDiffCopy {
private int numberOfChangedFields = 0;
/** where modification data comes from */
- private IMetaApi newData = null;
+ private IPhotoProperties newData = null;
- /** the fields that have to be copied by MediaUtil excluding special MediaDiffCopy processing */
+ /** the fields that have to be copied by PhotoPropertiesUtil excluding special PhotoPropertiesDiffCopy processing */
private EnumSet diffSet = null;
/** time units to be added to destination time */
@@ -71,12 +71,12 @@ public class MediaDiffCopy {
* @param excludePath true: do not copy file path
* @param overwriteExisting
*/
- public MediaDiffCopy(boolean excludePath, boolean overwriteExisting) {
+ public PhotoPropertiesDiffCopy(boolean excludePath, boolean overwriteExisting) {
this.excludePath = excludePath;
this.overwriteExisting = overwriteExisting;
}
- public MediaDiffCopy(IMetaApi newData, boolean overwriteExisting) {
+ public PhotoPropertiesDiffCopy(IPhotoProperties newData, boolean overwriteExisting) {
this(true, overwriteExisting);
if (newData != null) {
setDiff(null, newData);
@@ -91,9 +91,9 @@ public MediaDiffCopy(IMetaApi newData, boolean overwriteExisting) {
* @param newData data after change
* @return null if there is no diff between them
*/
- public MediaDiffCopy setDiff(IMetaApi initialData, IMetaApi newData) {
+ public PhotoPropertiesDiffCopy setDiff(IPhotoProperties initialData, IPhotoProperties newData) {
close();
- this.diffSet = MediaUtil.getChangesAsDiffsetOrNull(initialData, newData);
+ this.diffSet = PhotoPropertiesUtil.getChangesAsDiffsetOrNull(initialData, newData);
if (this.diffSet != null) {
// in gui data was changed
@@ -145,12 +145,12 @@ public MediaDiffCopy setDiff(IMetaApi initialData, IMetaApi newData) {
}
/** Initialisation to define the difference. return null if there is no diff between them */
- public MediaDiffCopy setDiff(IMetaApi newData, FieldID fieldId, FieldID... fieldIds) {
+ public PhotoPropertiesDiffCopy setDiff(IPhotoProperties newData, FieldID fieldId, FieldID... fieldIds) {
return setDiff(newData, EnumSet.of(fieldId, fieldIds));
}
/** Initialisation to define the difference. return null if there is no diff between them */
- public MediaDiffCopy setDiff(IMetaApi newData, EnumSet diffSet) {
+ public PhotoPropertiesDiffCopy setDiff(IPhotoProperties newData, EnumSet diffSet) {
close();
this.diffSet = diffSet;
fix(this.diffSet);
@@ -163,12 +163,12 @@ public MediaDiffCopy setDiff(IMetaApi newData, EnumSet diffSet) {
return null;
}
- /** Similar to {@link MediaUtil#copySpecificProperties(IMetaApi, IMetaApi, boolean, EnumSet)} but with special diff handling. */
- public List applyChanges(IMetaApi destination) {
+ /** Similar to {@link PhotoPropertiesUtil#copySpecificProperties(IPhotoProperties, IPhotoProperties, boolean, EnumSet)} but with special diff handling. */
+ public List applyChanges(IPhotoProperties destination) {
if (this.numberOfChangedFields > 0) {
// note: special processing was excluded from this.diffSet
- List collectedChanges = MediaUtil.copySpecificProperties(destination, newData,
+ List collectedChanges = PhotoPropertiesUtil.copySpecificProperties(destination, newData,
this.overwriteExisting, this.diffSet);
if (this.timeAdded != 0) {
@@ -276,7 +276,7 @@ public String toString() {
StringBuilder result = new StringBuilder();
result.append(this.getClass().getSimpleName()).append(":");
if (this.numberOfChangedFields > 0) {
- result.append(MediaUtil.toString(this.newData,true, null, EnumSet.complementOf(this.diffSet)));
+ result.append(PhotoPropertiesUtil.toString(this.newData,true, null, EnumSet.complementOf(this.diffSet)));
if (this.titleAppend != null) result.append(" title+=").append(this.titleAppend);
if (this.descriptionAppend != null) result.append(" description+=").append(this.descriptionAppend);
diff --git a/fotolib2/src/main/java/de/k3b/media/ImageMetaReader.java b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesImageReader.java
similarity index 93%
rename from fotolib2/src/main/java/de/k3b/media/ImageMetaReader.java
rename to fotolib2/src/main/java/de/k3b/media/PhotoPropertiesImageReader.java
index d8260869..25ed0fcf 100644
--- a/fotolib2/src/main/java/de/k3b/media/ImageMetaReader.java
+++ b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesImageReader.java
@@ -53,9 +53,9 @@
* Created by k3b on 27.03.2017.
*/
-public class ImageMetaReader implements IMetaApi, Closeable {
+public class PhotoPropertiesImageReader implements IPhotoProperties, Closeable {
// public: used as log filter for crash report
- public static final String LOG_TAG = "ImageMetaReader";
+ public static final String LOG_TAG = "PhotoPropertiesImageReader";
private static final Logger logger = LoggerFactory.getLogger(LOG_TAG);
@@ -69,8 +69,8 @@ public class ImageMetaReader implements IMetaApi, Closeable {
private static final String checksum4 = "ekbadodui.Btl";
private String mFilename = null;
- private IMetaApi mExternalXmpDir;
- private MediaXmpSegment mInternalXmpDir;
+ private IPhotoProperties mExternalXmpDir;
+ private PhotoPropertiesXmpSegment mInternalXmpDir;
private Metadata mMetadata = null;
protected Directory mExifDir;
protected Directory mExifSubDir;
@@ -102,11 +102,11 @@ private static boolean check(String checksum) {
/**
* Reads Meta data from the specified inputStream (if not null) or File(filename).
*/
- public ImageMetaReader load(String filename, InputStream inputStream, IMetaApi externalXmpContent, String _dbg_context) throws IOException {
+ public PhotoPropertiesImageReader load(String filename, InputStream inputStream, IPhotoProperties externalXmpContent, String _dbg_context) throws IOException {
mInitExecuted = false;
mFilename = filename;
mExternalXmpDir = externalXmpContent;
- this.dbg_context = _dbg_context + "->ImageMetaReader(" + mFilename+ ") ";
+ this.dbg_context = _dbg_context + "->PhotoPropertiesImageReader(" + mFilename+ ") ";
Metadata metadata = null;
File jpegFile = (inputStream == null) ? new File(filename) : null;
@@ -137,7 +137,7 @@ public ImageMetaReader load(String filename, InputStream inputStream, IMetaApi e
if (LibGlobal.debugEnabledJpgMetaIo) {
logger.debug(dbg_context +
- "loaded: " + MediaUtil.toString(this, false, null, MediaUtil.FieldID.path, MediaUtil.FieldID.clasz));
+ "loaded: " + PhotoPropertiesUtil.toString(this, false, null, PhotoPropertiesUtil.FieldID.path, PhotoPropertiesUtil.FieldID.clasz));
}
return this;
@@ -151,7 +151,7 @@ public String getPath() {
}
@Override
- public IMetaApi setPath(String filePath) {
+ public IPhotoProperties setPath(String filePath) {
throw new UnsupportedOperationException ();
}
@@ -175,12 +175,12 @@ public Date getDateTimeTaken() {
}
@Override
- public IMetaApi setDateTimeTaken(Date value) {
+ public IPhotoProperties setDateTimeTaken(Date value) {
throw new UnsupportedOperationException ();
}
/** latitude, in degrees north. (-90 .. +90); longitude, in degrees east. (-180 .. + 180) */
- @Override public IMetaApi setLatitudeLongitude(Double latitude, Double longitude) {
+ @Override public IPhotoProperties setLatitudeLongitude(Double latitude, Double longitude) {
throw new UnsupportedOperationException ();
}
@@ -250,7 +250,7 @@ protected boolean isEmpty(Object result, int tryNumber, String debugContext, Str
}
@Override
- public IMetaApi setTitle(String title) {
+ public IPhotoProperties setTitle(String title) {
throw new UnsupportedOperationException ();
}
@@ -301,7 +301,7 @@ public String getDescription() {
}
@Override
- public IMetaApi setDescription(String description) {
+ public IPhotoProperties setDescription(String description) {
throw new UnsupportedOperationException ();
}
@@ -334,7 +334,7 @@ public List getTags() {
}
@Override
- public IMetaApi setTags(List tags) {
+ public IPhotoProperties setTags(List tags) {
throw new UnsupportedOperationException ();
}
@@ -357,7 +357,7 @@ public Integer getRating() {
}
@Override
- public IMetaApi setRating(Integer value) {
+ public IPhotoProperties setRating(Integer value) {
throw new UnsupportedOperationException ();
}
@@ -380,7 +380,7 @@ public VISIBILITY getVisibility() {
}
@Override
- public IMetaApi setVisibility(VISIBILITY value) {
+ public IPhotoProperties setVisibility(VISIBILITY value) {
throw new UnsupportedOperationException ();
}
@@ -450,7 +450,7 @@ public String toString() {
return builder.toString();
}
- public MediaXmpSegment getImternalXmp() {
+ public PhotoPropertiesXmpSegment getImternalXmp() {
init();
return mInternalXmpDir;
}
@@ -494,7 +494,7 @@ protected void init() {
mInternalXmpDir = null;
XmpDirectory xmp = this.mMetadata.getFirstDirectoryOfType(XmpDirectory.class);
if (xmp != null) {
- mInternalXmpDir = new MediaXmpSegment();
+ mInternalXmpDir = new PhotoPropertiesXmpSegment();
mInternalXmpDir.setXmpMeta(xmp.getXMPMeta(), dbg_context + " embedded xml ");
}
}
diff --git a/fotolib2/src/main/java/de/k3b/media/MetaWriterExifXml.java b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesUpdateHandler.java
similarity index 82%
rename from fotolib2/src/main/java/de/k3b/media/MetaWriterExifXml.java
rename to fotolib2/src/main/java/de/k3b/media/PhotoPropertiesUpdateHandler.java
index 4f4d513e..172a0b6f 100644
--- a/fotolib2/src/main/java/de/k3b/media/MetaWriterExifXml.java
+++ b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesUpdateHandler.java
@@ -33,7 +33,7 @@
/**
* Represents content of exactly one jpg-exif-file with corresponding xmp-file that can be modified
- * via {@link IMetaApi} and {@link #save(String)}.
+ * via {@link IPhotoProperties} and {@link #save(String)}.
*
* Depending on the global settings handles updating/creating jpg-exif and/or xmp-file.
* Also handles jpg/xmp file move/copy.
@@ -44,19 +44,19 @@
* Created by k3b on 21.04.2017.
*/
-public class MetaWriterExifXml extends MetaApiWrapper implements IMetaApi {
+public class PhotoPropertiesUpdateHandler extends PhotoPropertiesWrapper implements IPhotoProperties {
private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
private ExifInterfaceEx exif; // not null if exif changes are written to jpg file
- private MediaXmpSegment xmp; // not null if exif changes are written to xmp sidecar file.
+ private PhotoPropertiesXmpSegment xmp; // not null if exif changes are written to xmp sidecar file.
private String absoluteJpgInPath; // where changes are read from.
private String absoluteJpgOutPath; // where changes are written to. Null meanst same as input
private boolean deleteOriginalAfterFinish; // true: after save original jpg/mxp are deleted (move instead of copy)
private long dbgLoadEndTimestamp;
/**
- * public api: Factory to create MetaWriterExifXml. Settings/ Internal state determine
- * configuration for MetaWriterExifXml.
+ * public api: Factory to create PhotoPropertiesUpdateHandler. Settings/ Internal state determine
+ * configuration for PhotoPropertiesUpdateHandler.
*
*
* @param absoluteJpgInPath where data is read from
@@ -66,8 +66,8 @@ public class MetaWriterExifXml extends MetaApiWrapper implements IMetaApi {
* @return new loaded instance
* @throws IOException
*/
- public static MetaWriterExifXml create(String absoluteJpgInPath, String absoluteJpgOutPath,
- boolean deleteOriginalAfterFinish, String dbg_context)
+ public static PhotoPropertiesUpdateHandler create(String absoluteJpgInPath, String absoluteJpgOutPath,
+ boolean deleteOriginalAfterFinish, String dbg_context)
throws IOException {
return create(absoluteJpgInPath, absoluteJpgOutPath, deleteOriginalAfterFinish, dbg_context,
LibGlobal.mediaUpdateStrategy.contains("J"), // write jpg file
@@ -77,7 +77,7 @@ public static MetaWriterExifXml create(String absoluteJpgInPath, String absolute
}
/**
- * Used by junit tests with no dependency to internal state: factory to create MetaWriterExifXml.
+ * Used by junit tests with no dependency to internal state: factory to create PhotoPropertiesUpdateHandler.
*
*
* @param absoluteJpgInPath where data is read from
@@ -90,17 +90,17 @@ public static MetaWriterExifXml create(String absoluteJpgInPath, String absolute
* @return new loaded instance
* @throws IOException
*/
- public static MetaWriterExifXml create(String absoluteJpgInPath, String absoluteJpgOutPath,
- boolean deleteOriginalAfterFinish, String dbg_context,
- boolean writeJpg, boolean writeXmp, boolean createXmpIfNotExist)
+ public static PhotoPropertiesUpdateHandler create(String absoluteJpgInPath, String absoluteJpgOutPath,
+ boolean deleteOriginalAfterFinish, String dbg_context,
+ boolean writeJpg, boolean writeXmp, boolean createXmpIfNotExist)
throws IOException {
long startTimestamp = 0;
if (LibGlobal.debugEnabledJpgMetaIo) {
startTimestamp = new Date().getTime();
}
- MediaXmpSegment xmp = MediaXmpSegment.loadXmpSidecarContentOrNull(absoluteJpgInPath, dbg_context);
- if ((xmp == null) && (createXmpIfNotExist || MediaUtil.isImage(absoluteJpgInPath,MediaUtil.IMG_TYPE_NON_JPG))) {
- ImageMetaReader jpg = new ImageMetaReader().load(absoluteJpgInPath,null,null,
+ PhotoPropertiesXmpSegment xmp = PhotoPropertiesXmpSegment.loadXmpSidecarContentOrNull(absoluteJpgInPath, dbg_context);
+ if ((xmp == null) && (createXmpIfNotExist || PhotoPropertiesUtil.isImage(absoluteJpgInPath, PhotoPropertiesUtil.IMG_TYPE_NON_JPG))) {
+ PhotoPropertiesImageReader jpg = new PhotoPropertiesImageReader().load(absoluteJpgInPath,null,null,
dbg_context + " xmp-file not found. create/extract from jpg ");
// #124: fix can be null for gif/png
@@ -108,11 +108,11 @@ public static MetaWriterExifXml create(String absoluteJpgInPath, String absolute
// jpg has no embedded xmp create
if (xmp == null) {
- xmp = new MediaXmpSegment();
+ xmp = new PhotoPropertiesXmpSegment();
}
// xmp should have the same data as exif/iptc
- MediaUtil.copyNonEmpty(xmp, jpg);
+ PhotoPropertiesUtil.copyNonEmpty(xmp, jpg);
if ((absoluteJpgInPath != null) && (xmp.getDateTimeTaken() == null)) {
File in = new File(absoluteJpgInPath);
if (in.exists() && in.isFile()) {
@@ -133,20 +133,20 @@ public static MetaWriterExifXml create(String absoluteJpgInPath, String absolute
exif = null;
// if no exif (i.e. png file) always use xmp instead. create xmp if neccessary
- if (xmp == null) xmp = new MediaXmpSegment();
+ if (xmp == null) xmp = new PhotoPropertiesXmpSegment();
}
- MetaWriterExifXml result;
+ PhotoPropertiesUpdateHandler result;
if (exif != null) {
- result = new MetaWriterExifXml(
- (writeJpg) ? exif : new MetaApiChainReader(xmp, exif), // (!writeJpg) prefer read from xmp value before exif value
+ result = new PhotoPropertiesUpdateHandler(
+ (writeJpg) ? exif : new PhotoPropertiesChainReader(xmp, exif), // (!writeJpg) prefer read from xmp value before exif value
(writeJpg) ? exif : xmp, // (!writeJpg) modify xmp value only
(writeJpg) ? exif : null, // (!writeJpg) do not safe changes to jpg exif file
(writeXmp) ? xmp : null); // (!writeXmp) do not safe changes to xmp-sidecar file
} else {
// if no exif (i.e. png file) always use xmp instead
- result = new MetaWriterExifXml(xmp, xmp, null, xmp);
+ result = new PhotoPropertiesUpdateHandler(xmp, xmp, null, xmp);
}
@@ -161,7 +161,7 @@ public static MetaWriterExifXml create(String absoluteJpgInPath, String absolute
return result;
}
- private MetaWriterExifXml(IMetaApi readChild, IMetaApi writeChild, ExifInterfaceEx exif, MediaXmpSegment xmp)
+ private PhotoPropertiesUpdateHandler(IPhotoProperties readChild, IPhotoProperties writeChild, ExifInterfaceEx exif, PhotoPropertiesXmpSegment xmp)
{
super(readChild, writeChild);
this.exif = exif;
@@ -244,7 +244,7 @@ private int copyReplaceIfExist(String absoluteJpgInPath, String outJpgFullPath,
return changedFiles;
}
- private int saveXmp(MediaXmpSegment xmp,
+ private int saveXmp(PhotoPropertiesXmpSegment xmp,
String outFullJpgPath,
boolean isLongFileName, String dbg_context) throws IOException {
File xmpOutFile = FileCommands.getSidecar(outFullJpgPath, isLongFileName);
@@ -278,7 +278,7 @@ public ExifInterfaceEx getExif() {
return exif;
}
- public MediaXmpSegment getXmp() {
+ public PhotoPropertiesXmpSegment getXmp() {
return xmp;
}
}
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaUtil.java b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesUtil.java
similarity index 88%
rename from fotolib2/src/main/java/de/k3b/media/MediaUtil.java
rename to fotolib2/src/main/java/de/k3b/media/PhotoPropertiesUtil.java
index 64fde23d..edb45990 100644
--- a/fotolib2/src/main/java/de/k3b/media/MediaUtil.java
+++ b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesUtil.java
@@ -44,7 +44,7 @@
* Created by k3b on 10.10.2016.
*/
-public class MediaUtil {
+public class PhotoPropertiesUtil {
private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
/** image will get this fileextension if updated from private image to public image. */
@@ -62,7 +62,7 @@ public class MediaUtil {
public static final int IMG_TYPE_PRIVATE = 0x1000; // jpg-p
/**
- * used to identify a member of IMetaApi
+ * used to identify a member of IPhotoProperties
*/
public enum FieldID {
path,
@@ -102,15 +102,15 @@ public String get(FieldID id) {
}
};
- public static String toString(IMetaApi item) {
+ public static String toString(IPhotoProperties item) {
return toString(item, true, null, (EnumSet) null);
}
- public static String toString(IMetaApi item, boolean includeEmpty, ILabelGenerator labeler, FieldID... _excludes) {
+ public static String toString(IPhotoProperties item, boolean includeEmpty, ILabelGenerator labeler, FieldID... _excludes) {
return toString(item, includeEmpty, labeler, toEnumSet(_excludes));
}
- public static String toString(IMetaApi item, boolean includeEmpty, ILabelGenerator _labeler, EnumSet excludes) {
+ public static String toString(IPhotoProperties item, boolean includeEmpty, ILabelGenerator _labeler, EnumSet excludes) {
if (item == null) return "";
ILabelGenerator labeler = (_labeler == null) ? defaultLabeler : _labeler;
@@ -151,7 +151,7 @@ private static void add(StringBuilder result, boolean includeEmpty,
}
/** copy content from source to destination. @return number of copied properties */
- public static int copy(IMetaApi destination, IMetaApi source,
+ public static int copy(IPhotoProperties destination, IPhotoProperties source,
boolean overwriteExisting, boolean allowSetNull) {
return copyImpl(destination, source, false, overwriteExisting, allowSetNull, null, null, (FieldID[]) null);
}
@@ -162,7 +162,7 @@ public static int copy(IMetaApi destination, IMetaApi source,
* @param _allowSetNulls if one of these columns are null, the set null is copied, too
* @return number of copied properties
*/
- public static int copyNonEmpty(IMetaApi destination, IMetaApi source, FieldID... _allowSetNulls) {
+ public static int copyNonEmpty(IPhotoProperties destination, IPhotoProperties source, FieldID... _allowSetNulls) {
return copyImpl(destination, source, false, true, false, null, null, _allowSetNulls);
}
@@ -171,15 +171,15 @@ public static int copyNonEmpty(IMetaApi destination, IMetaApi source, FieldID...
*
* @return possible empy list of FieldID-s of modified properties
*/
- public static List copySpecificProperties(IMetaApi destination, IMetaApi source,
- boolean overwriteExisting, final EnumSet fields2copy) {
+ public static List copySpecificProperties(IPhotoProperties destination, IPhotoProperties source,
+ boolean overwriteExisting, final EnumSet fields2copy) {
List collectedChanges = new ArrayList();
copyImpl(destination, source, false, overwriteExisting, overwriteExisting, fields2copy, collectedChanges, (FieldID[]) null);
return collectedChanges;
}
- public static List getChanges(IMetaApi destination, IMetaApi source) {
+ public static List getChanges(IPhotoProperties destination, IPhotoProperties source) {
List collectedChanges = new ArrayList();
if (0 == copyImpl(destination, source, true, true, true, null, collectedChanges, (FieldID[]) null)) {
return null;
@@ -187,7 +187,7 @@ public static List getChanges(IMetaApi destination, IMetaApi source) {
return collectedChanges;
}
- public static EnumSet getChangesAsDiffsetOrNull(IMetaApi destination, IMetaApi source) {
+ public static EnumSet getChangesAsDiffsetOrNull(IPhotoProperties destination, IPhotoProperties source) {
List differences = getChanges(destination, source);
return (differences != null) ? EnumSet.copyOf(differences) : null;
}
@@ -206,7 +206,7 @@ public static EnumSet getChangesAsDiffsetOrNull(IMetaApi destination, I
* would be copied in this list.
* @param _allowSetNulls if not null: for these fields setNull is allowed @return number of changed fields
*/
- private static int copyImpl(IMetaApi destination, IMetaApi source,
+ private static int copyImpl(IPhotoProperties destination, IPhotoProperties source,
boolean _simulateDoNotCopy, boolean overwriteExisting, boolean allowSetNull,
final EnumSet fields2copy,
List collectedChanges,
@@ -298,7 +298,7 @@ private static int copyImpl(IMetaApi destination, IMetaApi source,
return changes;
}
- public static void setLatitudeLongitude(IMetaApi destination, Double _latitude, Double _longitude) {
+ public static void setLatitudeLongitude(IPhotoProperties destination, Double _latitude, Double _longitude) {
if (destination != null) {
Double latitude = GeoUtil.getValue(_latitude);
Double longitude = GeoUtil.getValue(_longitude);
@@ -339,7 +339,7 @@ private static boolean allowedObject(Object newValue, Object oldValue,
}
/*
- public static String get(IMetaApi data, FieldID field) {
+ public static String get(IPhotoProperties data, FieldID field) {
switch (field) {
case path:
return data.getPath();
@@ -387,7 +387,7 @@ public static boolean isImage(String path, int imageTypeFlags) {
}
/** returns the full path that item should get or null if path is already ok */
- public static String getModifiedPath(IMetaApi item) {
+ public static String getModifiedPath(IPhotoProperties item) {
if (item != null) {
return getModifiedPath(item.getPath(), item.getVisibility());
}
@@ -414,7 +414,7 @@ static String getModifiedPath(String currentPath, VISIBILITY visibility) {
public static final FilenameFilter JPG_FILENAME_FILTER = new FilenameFilter() {
@Override
public boolean accept(File dir, String filename) {
- return MediaUtil.isImage(filename, MediaUtil.IMG_TYPE_ALL);
+ return PhotoPropertiesUtil.isImage(filename, PhotoPropertiesUtil.IMG_TYPE_ALL);
}
};
@@ -426,32 +426,32 @@ public static int exifOrientationCode2RotationDegrees(int exifOrientationCode, i
return notFoundValue;
}
- /** loads IMetaApi from jpg and corresponding xmp */
- public static IMetaApi loadExifAndXmp(String fileName, String dbg_context) {
+ /** loads IPhotoProperties from jpg and corresponding xmp */
+ public static IPhotoProperties loadExifAndXmp(String fileName, String dbg_context) {
try {
- MediaXmpSegment xmp = MediaXmpSegment.loadXmpSidecarContentOrNull(fileName, dbg_context);
+ PhotoPropertiesXmpSegment xmp = PhotoPropertiesXmpSegment.loadXmpSidecarContentOrNull(fileName, dbg_context);
- ImageMetaReader jpg = new ImageMetaReader().load(fileName, null, xmp, dbg_context);
+ PhotoPropertiesImageReader jpg = new PhotoPropertiesImageReader().load(fileName, null, xmp, dbg_context);
return jpg;
} catch (IOException ex) {
- logger.error(dbg_context, "MediaUtil.loadExifAndXmp", ex);
+ logger.error(dbg_context, "PhotoPropertiesUtil.loadExifAndXmp", ex);
}
return null;
}
/** #132: reads lat,lon,description,tags from files until tags and lat/long are found */
- public static T inferAutoprocessingExifDefaults(T result, File... files) {
+ public static T inferAutoprocessingExifDefaults(T result, File... files) {
return inferAutoprocessingExifDefaults(result, files, null,null,null, null);
}
/** #132: reads lat,lon,description,tags from files until tags and lat/long are found */
- public static T inferAutoprocessingExifDefaults(T result,
- File[] files,
- Double latitude,
- Double longitude,
- String description,
- List _tags) {
+ public static T inferAutoprocessingExifDefaults(T result,
+ File[] files,
+ Double latitude,
+ Double longitude,
+ String description,
+ List _tags) {
List tags = (_tags == null) ? new ArrayList() : _tags;
int exampleCount = files.length;
@@ -460,7 +460,7 @@ public static T inferAutoprocessingExifDefaults(T result,
File exampleFile = files[index++];
if ((exampleFile != null) && (exampleFile.exists())) {
- IMetaApi example = MediaUtil.loadExifAndXmp(exampleFile.getPath(),"infer defaults for autoprocessing");
+ IPhotoProperties example = PhotoPropertiesUtil.loadExifAndXmp(exampleFile.getPath(),"infer defaults for autoprocessing");
if (example != null) {
ListUtils.include(tags, example.getTags());
latitude = GeoUtil.getValue(example.getLatitude(), latitude);
diff --git a/fotolib2/src/main/java/de/k3b/media/MetaApiWrapper.java b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesWrapper.java
similarity index 75%
rename from fotolib2/src/main/java/de/k3b/media/MetaApiWrapper.java
rename to fotolib2/src/main/java/de/k3b/media/PhotoPropertiesWrapper.java
index 3e16ef7c..63b9fd37 100644
--- a/fotolib2/src/main/java/de/k3b/media/MetaApiWrapper.java
+++ b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesWrapper.java
@@ -25,23 +25,23 @@
import de.k3b.io.VISIBILITY;
/**
- * (Default) Implementation of {@link IMetaApi} to forward all methods to an inner child {@link IMetaApi}.
+ * (Default) Implementation of {@link IPhotoProperties} to forward all methods to an inner child {@link IPhotoProperties}.
*
* Created by k3b on 09.10.2016.
*/
-public class MetaApiWrapper implements IMetaApi {
- protected final IMetaApi readChild;
- protected final IMetaApi writeChild;
+public class PhotoPropertiesWrapper implements IPhotoProperties {
+ protected final IPhotoProperties readChild;
+ protected final IPhotoProperties writeChild;
/** count the non path write calls */
private int modifyCount = 0;
- public MetaApiWrapper(IMetaApi child) {
+ public PhotoPropertiesWrapper(IPhotoProperties child) {
this(child, child);
}
- public MetaApiWrapper(IMetaApi readChild, IMetaApi writeChild) {
+ public PhotoPropertiesWrapper(IPhotoProperties readChild, IPhotoProperties writeChild) {
this.readChild = readChild;
this.writeChild = writeChild;
@@ -52,13 +52,13 @@ public Date getDateTimeTaken() {
}
@Override
- public MetaApiWrapper setDateTimeTaken(Date value) {
+ public PhotoPropertiesWrapper setDateTimeTaken(Date value) {
modifyCount++;
if (writeChild != null) writeChild.setDateTimeTaken(value);
return this;
}
- @Override public IMetaApi setLatitudeLongitude(Double latitude, Double longitude) {
+ @Override public IPhotoProperties setLatitudeLongitude(Double latitude, Double longitude) {
modifyCount++;
if (writeChild != null) writeChild.setLatitudeLongitude(latitude, longitude);
return this;
@@ -78,7 +78,7 @@ public String getTitle() {
return (readChild == null) ? null : readChild.getTitle();
}
- public MetaApiWrapper setTitle(String title) {
+ public PhotoPropertiesWrapper setTitle(String title) {
modifyCount++;
if (writeChild != null) writeChild.setTitle(title);
return this;
@@ -88,7 +88,7 @@ public String getDescription() {
return (readChild == null) ? null : readChild.getDescription();
}
- public MetaApiWrapper setDescription(String description) {
+ public PhotoPropertiesWrapper setDescription(String description) {
modifyCount++;
if (writeChild != null) writeChild.setDescription(description);
return this;
@@ -98,7 +98,7 @@ public List getTags() {
return (readChild == null) ? null : readChild.getTags();
}
- public MetaApiWrapper setTags(List tags) {
+ public PhotoPropertiesWrapper setTags(List tags) {
modifyCount++;
if (writeChild != null) writeChild.setTags(tags);
return this;
@@ -113,7 +113,7 @@ public Integer getRating() {
}
@Override
- public IMetaApi setRating(Integer value) {
+ public IPhotoProperties setRating(Integer value) {
modifyCount++;
if (writeChild != null) writeChild.setRating(value);
return this;
@@ -125,7 +125,7 @@ public VISIBILITY getVisibility() {
}
@Override
- public IMetaApi setVisibility(VISIBILITY value) {
+ public IPhotoProperties setVisibility(VISIBILITY value) {
modifyCount++;
if (writeChild != null) writeChild.setVisibility(value);
return this;
@@ -136,13 +136,13 @@ public String getPath() {
return (readChild == null) ? null : readChild.getPath();
}
- public MetaApiWrapper setPath(String filePath) {
+ public PhotoPropertiesWrapper setPath(String filePath) {
if (writeChild != null) writeChild.setPath(filePath);
return this;
}
@Override
public String toString() {
- return MediaUtil.toString(this);
+ return PhotoPropertiesUtil.toString(this);
}
}
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaXmpFieldDefinition.java b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesXmpFieldDefinition.java
similarity index 94%
rename from fotolib2/src/main/java/de/k3b/media/MediaXmpFieldDefinition.java
rename to fotolib2/src/main/java/de/k3b/media/PhotoPropertiesXmpFieldDefinition.java
index f8de941c..ff1fb7bb 100644
--- a/fotolib2/src/main/java/de/k3b/media/MediaXmpFieldDefinition.java
+++ b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesXmpFieldDefinition.java
@@ -27,7 +27,7 @@
* Created by k3b on 10.10.2016.
*/
-public enum MediaXmpFieldDefinition {
+public enum PhotoPropertiesXmpFieldDefinition {
SourceFile(XmpNamespace.NONE), // used by exiftool-csv
FileModifyDate(XmpNamespace.NONE), // used by exiftool-csv
@@ -62,11 +62,11 @@ public enum MediaXmpFieldDefinition {
private final XmpNamespace xmpNamespace;
private final int arrayOption;
- MediaXmpFieldDefinition(XmpNamespace xmpNamespace) {
+ PhotoPropertiesXmpFieldDefinition(XmpNamespace xmpNamespace) {
this(xmpNamespace, PropertyOptions.NO_OPTIONS);
}
- MediaXmpFieldDefinition(XmpNamespace xmpNamespace, int arrayOption) {
+ PhotoPropertiesXmpFieldDefinition(XmpNamespace xmpNamespace, int arrayOption) {
this.xmpNamespace = xmpNamespace;
this.arrayOption = arrayOption;
}
diff --git a/fotolib2/src/main/java/de/k3b/media/MediaXmpSegment.java b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesXmpSegment.java
similarity index 61%
rename from fotolib2/src/main/java/de/k3b/media/MediaXmpSegment.java
rename to fotolib2/src/main/java/de/k3b/media/PhotoPropertiesXmpSegment.java
index 78aa942a..2190602f 100644
--- a/fotolib2/src/main/java/de/k3b/media/MediaXmpSegment.java
+++ b/fotolib2/src/main/java/de/k3b/media/PhotoPropertiesXmpSegment.java
@@ -39,13 +39,13 @@
import de.k3b.io.VISIBILITY;
/**
- * {@link XmpSegment} that implements {@link IMetaApi} to read/write xmp.
+ * {@link XmpSegment} that implements {@link IPhotoProperties} to read/write xmp.
*
* Created by k3b on 20.10.2016.
*/
-public class MediaXmpSegment extends XmpSegment implements IMetaApi {
- private static final String dbg_context = "MediaXmpSegment: ";
+public class PhotoPropertiesXmpSegment extends XmpSegment implements IPhotoProperties {
+ private static final String dbg_context = "PhotoPropertiesXmpSegment: ";
private static final Logger logger = LoggerFactory.getLogger(LibGlobal.LOG_TAG);
/** the full path of the image where this xmp-file belongs to */
@@ -63,7 +63,7 @@ public String getPath() {
/** the full path of the image where this xmp-file belongs to */
@Override
- public IMetaApi setPath(String filePath) {
+ public IPhotoProperties setPath(String filePath) {
this.path = filePath;
return this;
}
@@ -71,80 +71,80 @@ public IMetaApi setPath(String filePath) {
@Override
public Date getDateTimeTaken() {
return getPropertyAsDate(
- "getDateTimeTaken", MediaXmpFieldDefinition.CreateDate, // JPhotoTagger default
- MediaXmpFieldDefinition.DateCreated, // exiftool default
- MediaXmpFieldDefinition.DateTimeOriginal,
- MediaXmpFieldDefinition.DateAcquired,
- MediaXmpFieldDefinition.DateCreatedIptcXmp);
+ "getDateTimeTaken", PhotoPropertiesXmpFieldDefinition.CreateDate, // JPhotoTagger default
+ PhotoPropertiesXmpFieldDefinition.DateCreated, // exiftool default
+ PhotoPropertiesXmpFieldDefinition.DateTimeOriginal,
+ PhotoPropertiesXmpFieldDefinition.DateAcquired,
+ PhotoPropertiesXmpFieldDefinition.DateCreatedIptcXmp);
}
@Override
- public IMetaApi setDateTimeTaken(Date value) {
+ public IPhotoProperties setDateTimeTaken(Date value) {
String dateValue = (value == null) ? null : XMPUtils.convertFromDate(new XMPDateTimeImpl(value, DateUtil.UTC));
setProperty(dateValue, // DateUtil.toIsoDateTimeString(value),
- MediaXmpFieldDefinition.CreateDate, // JPhotoTagger default
- MediaXmpFieldDefinition.DateCreated, // exiftool default
- MediaXmpFieldDefinition.DateTimeOriginal, // EXIF
- MediaXmpFieldDefinition.DateAcquired);
+ PhotoPropertiesXmpFieldDefinition.CreateDate, // JPhotoTagger default
+ PhotoPropertiesXmpFieldDefinition.DateCreated, // exiftool default
+ PhotoPropertiesXmpFieldDefinition.DateTimeOriginal, // EXIF
+ PhotoPropertiesXmpFieldDefinition.DateAcquired);
return this;
}
/** latitude, in degrees north. (-90 .. +90); longitude, in degrees east. (-180 .. + 180) */
- @Override public IMetaApi setLatitudeLongitude(Double latitude, Double longitude) {
+ @Override public IPhotoProperties setLatitudeLongitude(Double latitude, Double longitude) {
setProperty(GeoUtil.toXmpStringLatNorth(latitude),
- MediaXmpFieldDefinition.GPSLatitude);
+ PhotoPropertiesXmpFieldDefinition.GPSLatitude);
setProperty(GeoUtil.toXmpStringLonEast(longitude),
- MediaXmpFieldDefinition.GPSLongitude);
+ PhotoPropertiesXmpFieldDefinition.GPSLongitude);
return this;
}
@Override
public Double getLatitude() {
- return GeoUtil.parse(getPropertyAsString("getLatitude", MediaXmpFieldDefinition.GPSLatitude),"NS");
+ return GeoUtil.parse(getPropertyAsString("getLatitude", PhotoPropertiesXmpFieldDefinition.GPSLatitude),"NS");
}
@Override
public Double getLongitude() {
- return GeoUtil.parse(getPropertyAsString("getLongitude", MediaXmpFieldDefinition.GPSLongitude),"EW");
+ return GeoUtil.parse(getPropertyAsString("getLongitude", PhotoPropertiesXmpFieldDefinition.GPSLongitude),"EW");
}
@Override
public String getTitle() {
- return getPropertyAsString("getTitle", MediaXmpFieldDefinition.title);
+ return getPropertyAsString("getTitle", PhotoPropertiesXmpFieldDefinition.title);
}
@Override
- public IMetaApi setTitle(String title) {
+ public IPhotoProperties setTitle(String title) {
setProperty(title,
- MediaXmpFieldDefinition.title);
+ PhotoPropertiesXmpFieldDefinition.title);
return this;
}
@Override
public String getDescription() {
- return getPropertyAsString("getDescription", MediaXmpFieldDefinition.description);
+ return getPropertyAsString("getDescription", PhotoPropertiesXmpFieldDefinition.description);
}
@Override
- public IMetaApi setDescription(String description) {
+ public IPhotoProperties setDescription(String description) {
setProperty(description,
- MediaXmpFieldDefinition.description);
+ PhotoPropertiesXmpFieldDefinition.description);
return this;
}
@Override
public List getTags() {
return getPropertyArray("getTags",
- MediaXmpFieldDefinition.subject,
- MediaXmpFieldDefinition.LastKeywordXMP,
- MediaXmpFieldDefinition.LastKeywordIPTC);
+ PhotoPropertiesXmpFieldDefinition.subject,
+ PhotoPropertiesXmpFieldDefinition.LastKeywordXMP,
+ PhotoPropertiesXmpFieldDefinition.LastKeywordIPTC);
}
@Override
- public IMetaApi setTags(List tags) {
- replacePropertyArray(tags, MediaXmpFieldDefinition.subject);
- replacePropertyArray(tags, MediaXmpFieldDefinition.LastKeywordXMP);
- replacePropertyArray(tags, MediaXmpFieldDefinition.LastKeywordIPTC);
+ public IPhotoProperties setTags(List tags) {
+ replacePropertyArray(tags, PhotoPropertiesXmpFieldDefinition.subject);
+ replacePropertyArray(tags, PhotoPropertiesXmpFieldDefinition.LastKeywordXMP);
+ replacePropertyArray(tags, PhotoPropertiesXmpFieldDefinition.LastKeywordIPTC);
return this;
}
@@ -154,7 +154,7 @@ public IMetaApi setTags(List tags) {
*/
@Override
public Integer getRating() {
- String result = getPropertyAsString("getRating", MediaXmpFieldDefinition.Rating);
+ String result = getPropertyAsString("getRating", PhotoPropertiesXmpFieldDefinition.Rating);
if ((result != null) && (result.length() > 0)){
try {
return Integer.parseInt(result);
@@ -166,23 +166,23 @@ public Integer getRating() {
}
@Override
- public IMetaApi setRating(Integer value) {
+ public IPhotoProperties setRating(Integer value) {
setProperty(value,
- MediaXmpFieldDefinition.Rating);
+ PhotoPropertiesXmpFieldDefinition.Rating);
return this;
}
@Override
public VISIBILITY getVisibility() {
- String sValue = getPropertyAsString("getVisibility", MediaXmpFieldDefinition.Visibility);
+ String sValue = getPropertyAsString("getVisibility", PhotoPropertiesXmpFieldDefinition.Visibility);
return VISIBILITY.fromString(sValue);
}
@Override
- public IMetaApi setVisibility(VISIBILITY value) {
+ public IPhotoProperties setVisibility(VISIBILITY value) {
String sValue = VISIBILITY.isChangingValue(value) ? value.toString() : null;
setProperty(value,
- MediaXmpFieldDefinition.Visibility);
+ PhotoPropertiesXmpFieldDefinition.Visibility);
return this;
}
@@ -191,7 +191,7 @@ public IMetaApi setVisibility(VISIBILITY value) {
public XmpSegment setXmpMeta(XMPMeta xmpMeta, String dbg_context) {
super.setXmpMeta(xmpMeta, dbg_context);
if (LibGlobal.debugEnabledJpgMetaIo) {
- logger.info(dbg_context + " setXmpMeta " + MediaUtil.toString(this, false, null, MediaUtil.FieldID.path, MediaUtil.FieldID.clasz));
+ logger.info(dbg_context + " setXmpMeta " + PhotoPropertiesUtil.toString(this, false, null, PhotoPropertiesUtil.FieldID.path, PhotoPropertiesUtil.FieldID.clasz));
}
return this;
@@ -204,11 +204,11 @@ public XmpSegment save(File file, boolean humanReadable, String dbg_context) thr
}
private void fixAttributes(File file) {
- if (getPropertyAsString(" fixAttributes OriginalFileName", MediaXmpFieldDefinition.OriginalFileName) == null) {
- setProperty(file.getName(), MediaXmpFieldDefinition.OriginalFileName);
+ if (getPropertyAsString(" fixAttributes OriginalFileName", PhotoPropertiesXmpFieldDefinition.OriginalFileName) == null) {
+ setProperty(file.getName(), PhotoPropertiesXmpFieldDefinition.OriginalFileName);
}
- if (getPropertyAsString(" fixAttributes AppVersion", MediaXmpFieldDefinition.AppVersion) == null) {
- setProperty(LibGlobal.appName + "-" + LibGlobal.appVersion, MediaXmpFieldDefinition.AppVersion);
+ if (getPropertyAsString(" fixAttributes AppVersion", PhotoPropertiesXmpFieldDefinition.AppVersion) == null) {
+ setProperty(LibGlobal.appName + "-" + LibGlobal.appVersion, PhotoPropertiesXmpFieldDefinition.AppVersion);
}
}
@@ -217,18 +217,18 @@ private void fixAttributes(File file) {
public XmpSegment save(OutputStream os, boolean humanReadable, String dbg_context) {
super.save(os, humanReadable, dbg_context);
if (LibGlobal.debugEnabledJpgMetaIo) {
- logger.info(dbg_context + " save " + MediaUtil.toString(this, false, null, MediaUtil.FieldID.path, MediaUtil.FieldID.clasz));
+ logger.info(dbg_context + " save " + PhotoPropertiesUtil.toString(this, false, null, PhotoPropertiesUtil.FieldID.path, PhotoPropertiesUtil.FieldID.clasz));
}
return this;
}
- public static MediaXmpSegment loadXmpSidecarContentOrNull(String absoluteJpgPath, String _dbg_context) {
- MediaXmpSegment xmpContent = null;
+ public static PhotoPropertiesXmpSegment loadXmpSidecarContentOrNull(String absoluteJpgPath, String _dbg_context) {
+ PhotoPropertiesXmpSegment xmpContent = null;
FileCommands.XmpFile xmpFile = FileCommands.getExistingSidecarOrNull(absoluteJpgPath);
String dbg_context = _dbg_context + " loadXmpSidecarContent(" + xmpFile + "): ";
if ((xmpFile != null) && xmpFile.isFile() && xmpFile.exists() && xmpFile.canRead()) {
- xmpContent = new MediaXmpSegment();
+ xmpContent = new PhotoPropertiesXmpSegment();
try {
xmpContent.load(xmpFile, dbg_context);
xmpContent.setLongFormat(xmpFile.isLongFormat());
@@ -248,7 +248,7 @@ public static MediaXmpSegment loadXmpSidecarContentOrNull(String absoluteJpgPath
@Override
public String toString() {
- return MediaUtil.toString(this);
+ return PhotoPropertiesUtil.toString(this);
}
/** true: file.jpg.xmp; false: file.xmp */
diff --git a/fotolib2/src/main/java/de/k3b/media/XmpSegment.java b/fotolib2/src/main/java/de/k3b/media/XmpSegment.java
index f44837e1..7f1f7876 100644
--- a/fotolib2/src/main/java/de/k3b/media/XmpSegment.java
+++ b/fotolib2/src/main/java/de/k3b/media/XmpSegment.java
@@ -66,7 +66,7 @@ public class XmpSegment {
/** when xmp sidecar file was last modified (in secs 1970) or 0 */
private long filelastModified = 0;
- protected String getPropertyAsString(String debugContext, MediaXmpFieldDefinition... definitions) {
+ protected String getPropertyAsString(String debugContext, PhotoPropertiesXmpFieldDefinition... definitions) {
List values = getPropertyArray("", definitions);
if ((values != null) && (values.size() > 0)) {
return TagConverter.asDbString(null, values);
@@ -79,7 +79,7 @@ protected String getPropertyAsString(String debugContext, MediaXmpFieldDefinitio
return null;
}
- protected Date getPropertyAsDate(String debugContext, MediaXmpFieldDefinition... definitions) {
+ protected Date getPropertyAsDate(String debugContext, PhotoPropertiesXmpFieldDefinition... definitions) {
try {
String result = getPropertyAsString(debugContext, definitions);
if ((result != null) && (result.length() > 0)) return XMPUtils.convertToDate(result).getCalendar().getTime();
@@ -89,8 +89,8 @@ protected Date getPropertyAsDate(String debugContext, MediaXmpFieldDefinition...
return null;
}
- protected XMPProperty getProperty(MediaXmpFieldDefinition... definitions) {
- for (MediaXmpFieldDefinition definition: definitions) {
+ protected XMPProperty getProperty(PhotoPropertiesXmpFieldDefinition... definitions) {
+ for (PhotoPropertiesXmpFieldDefinition definition: definitions) {
if (!definition.isArray()) {
XMPProperty result = null;
try {
@@ -105,8 +105,8 @@ protected XMPProperty getProperty(MediaXmpFieldDefinition... definitions) {
return null;
}
- protected MediaXmpFieldDefinition findFirst(boolean returnNullIfNotFound, MediaXmpFieldDefinition... definitions) {
- for (MediaXmpFieldDefinition definition: definitions) {
+ protected PhotoPropertiesXmpFieldDefinition findFirst(boolean returnNullIfNotFound, PhotoPropertiesXmpFieldDefinition... definitions) {
+ for (PhotoPropertiesXmpFieldDefinition definition: definitions) {
XMPProperty result = null;
try {
result = getXmpMeta().getProperty(definition.getXmpNamespace().getUriAsString(), definition.getShortName());
@@ -120,10 +120,10 @@ protected MediaXmpFieldDefinition findFirst(boolean returnNullIfNotFound, MediaX
}
/** sets all existing from definitions or first if not found */
- protected void setProperty(Object value, MediaXmpFieldDefinition... definitions) {
+ protected void setProperty(Object value, PhotoPropertiesXmpFieldDefinition... definitions) {
try {
boolean mustAdd = true;
- for (MediaXmpFieldDefinition definition: definitions) {
+ for (PhotoPropertiesXmpFieldDefinition definition: definitions) {
XMPProperty result = getXmpMeta().getProperty(definition.getXmpNamespace().getUriAsString(), definition.getShortName());
if (result != null) {
setPropertyInternal(value, definition);
@@ -138,7 +138,7 @@ protected void setProperty(Object value, MediaXmpFieldDefinition... definitions)
}
}
- private void setPropertyInternal(Object value, MediaXmpFieldDefinition definition) throws XMPException {
+ private void setPropertyInternal(Object value, PhotoPropertiesXmpFieldDefinition definition) throws XMPException {
if (definition != null) {
if (value == null) {
// XMPProperty prop = getXmpMeta().getProperty(definition.getXmpNamespace().getUriAsString(), definition.getShortName());
@@ -152,9 +152,9 @@ private void setPropertyInternal(Object value, MediaXmpFieldDefinition definitio
} // else both porperty and value do not exist
}
- protected void replacePropertyArray(List values, MediaXmpFieldDefinition... definitions) {
+ protected void replacePropertyArray(List values, PhotoPropertiesXmpFieldDefinition... definitions) {
try {
- MediaXmpFieldDefinition definition = findFirst(false, definitions);
+ PhotoPropertiesXmpFieldDefinition definition = findFirst(false, definitions);
if ((definition != null) && definition.isArray()) {
XMPMeta meta = getXmpMeta();
int oldItemCount = meta.countArrayItems(definition.getXmpNamespace().getUriAsString(), definition.getShortName());
@@ -175,10 +175,10 @@ protected void replacePropertyArray(List values, MediaXmpFieldDefinition
}
}
- protected List getPropertyArray(String debugContext, MediaXmpFieldDefinition... definitions) {
+ protected List getPropertyArray(String debugContext, PhotoPropertiesXmpFieldDefinition... definitions) {
try {
XMPMeta meta = getXmpMeta();
- for (MediaXmpFieldDefinition definition : definitions) {
+ for (PhotoPropertiesXmpFieldDefinition definition : definitions) {
if (definition.isArray()) {
int oldItemCount = meta.countArrayItems(definition.getXmpNamespace().getUriAsString(), definition.getShortName());
if (oldItemCount > 0) {
diff --git a/fotolib2/src/main/java/de/k3b/transactionlog/MediaTransactionLogEntryType.java b/fotolib2/src/main/java/de/k3b/transactionlog/MediaTransactionLogEntryType.java
index ff1357bb..e76f9152 100644
--- a/fotolib2/src/main/java/de/k3b/transactionlog/MediaTransactionLogEntryType.java
+++ b/fotolib2/src/main/java/de/k3b/transactionlog/MediaTransactionLogEntryType.java
@@ -32,7 +32,7 @@ public enum MediaTransactionLogEntryType {
DELETE("F-", "apmDelete"),
MOVE("Fm", "apmMove",true),
COPY("F+", "apmCopy",true),
-// IMetaApi
+// IPhotoProperties
GPS("g", "apmGps"),
TAGSADD("T+", "apmTagsAdd"),
TAGSREMOVE("T-", "apmTagsRemove"),
diff --git a/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLogParser.java b/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLogParser.java
index 57ab0940..a3ea043a 100644
--- a/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLogParser.java
+++ b/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLogParser.java
@@ -24,7 +24,7 @@
import java.util.Iterator;
import java.util.List;
-import de.k3b.media.MediaDTO;
+import de.k3b.media.PhotoPropertiesDTO;
/**
* Analyses TransactionLog to generate move/copy/delete script and update-dtos.
@@ -38,7 +38,7 @@ public class TransactionLogParser {
private IMediaTransactionLogEntry lastLog = null;
public static class Status {
- public MediaDTO dto = new MediaDTO();
+ public PhotoPropertiesDTO dto = new PhotoPropertiesDTO();
public List filenames = new ArrayList();
public boolean isDelete = false;
private long lastId=-1;
diff --git a/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLoggerBase.java b/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLoggerBase.java
index 4e6c0d9c..a917b629 100644
--- a/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLoggerBase.java
+++ b/fotolib2/src/main/java/de/k3b/transactionlog/TransactionLoggerBase.java
@@ -32,8 +32,8 @@
import de.k3b.io.FileProcessor;
import de.k3b.io.ListUtils;
import de.k3b.io.VISIBILITY;
-import de.k3b.media.IMetaApi;
-import de.k3b.media.MediaUtil;
+import de.k3b.media.IPhotoProperties;
+import de.k3b.media.PhotoPropertiesUtil;
import de.k3b.tagDB.TagConverter;
import de.k3b.tagDB.TagProcessor;
@@ -69,19 +69,19 @@ public void close() throws IOException {
}
execLog = null;
}
- public void addChanges(IMetaApi newData, EnumSet changes, List oldTags) {
+ public void addChanges(IPhotoProperties newData, EnumSet changes, List oldTags) {
addComment("apply changes image#",id);
- if (changes.contains(MediaUtil.FieldID.dateTimeTaken)) addChangesDateTaken(newData.getDateTimeTaken());
- if (changes.contains(MediaUtil.FieldID.latitude_longitude)) addChanges(MediaTransactionLogEntryType.GPS, DirectoryFormatter.formatLatLon(newData.getLatitude()) + " " + DirectoryFormatter.formatLatLon(newData.getLongitude()), false);
- if (changes.contains(MediaUtil.FieldID.description)) addChanges(MediaTransactionLogEntryType.DESCRIPTION, newData.getDescription(), true);
- if (changes.contains(MediaUtil.FieldID.title)) addChanges(MediaTransactionLogEntryType.HEADER, newData.getTitle(), true);
- if (changes.contains(MediaUtil.FieldID.rating)) addChanges(MediaTransactionLogEntryType.RATING, (newData.getRating() != null) ? newData.getRating().toString(): "0", false);
+ if (changes.contains(PhotoPropertiesUtil.FieldID.dateTimeTaken)) addChangesDateTaken(newData.getDateTimeTaken());
+ if (changes.contains(PhotoPropertiesUtil.FieldID.latitude_longitude)) addChanges(MediaTransactionLogEntryType.GPS, DirectoryFormatter.formatLatLon(newData.getLatitude()) + " " + DirectoryFormatter.formatLatLon(newData.getLongitude()), false);
+ if (changes.contains(PhotoPropertiesUtil.FieldID.description)) addChanges(MediaTransactionLogEntryType.DESCRIPTION, newData.getDescription(), true);
+ if (changes.contains(PhotoPropertiesUtil.FieldID.title)) addChanges(MediaTransactionLogEntryType.HEADER, newData.getTitle(), true);
+ if (changes.contains(PhotoPropertiesUtil.FieldID.rating)) addChanges(MediaTransactionLogEntryType.RATING, (newData.getRating() != null) ? newData.getRating().toString(): "0", false);
- if (changes.contains(MediaUtil.FieldID.tags)) addChangesTags(oldTags, newData.getTags());
+ if (changes.contains(PhotoPropertiesUtil.FieldID.tags)) addChangesTags(oldTags, newData.getTags());
final VISIBILITY visibility = newData.getVisibility();
- if (changes.contains(MediaUtil.FieldID.visibility) && VISIBILITY.isChangingValue(visibility)) {
+ if (changes.contains(PhotoPropertiesUtil.FieldID.visibility) && VISIBILITY.isChangingValue(visibility)) {
addChanges(MediaTransactionLogEntryType.VISIBILITY, ((VISIBILITY.PRIVATE.equals(visibility)) ? "1": "0") + " " + visibility, false);
}
diff --git a/fotolib2/src/test/java/de/k3b/TestUtil.java b/fotolib2/src/test/java/de/k3b/TestUtil.java
index 14c5c7be..fc8f34f9 100644
--- a/fotolib2/src/test/java/de/k3b/TestUtil.java
+++ b/fotolib2/src/test/java/de/k3b/TestUtil.java
@@ -30,8 +30,8 @@
import de.k3b.io.DateUtil;
import de.k3b.io.FileUtils;
import de.k3b.io.VISIBILITY;
-import de.k3b.media.ImageMetaReaderIntegrationTests;
-import de.k3b.media.MediaDTO;
+import de.k3b.media.PhotoPropertiesImageReaderIntegrationTests;
+import de.k3b.media.PhotoPropertiesDTO;
import de.k3b.tagDB.TagConverter;
public class TestUtil {
@@ -52,8 +52,8 @@ public static CsvReader createParser(String csvSrc) {
return new CsvReader(TestUtil.createReader(csvSrc));
}
- public static MediaDTO createTestMediaDTO(int id) {
- MediaDTO result = new MediaDTO();
+ public static PhotoPropertiesDTO createTestMediaDTO(int id) {
+ PhotoPropertiesDTO result = new PhotoPropertiesDTO();
result.setPath("Path" + id);
result.setTitle("Title" + id);
@@ -77,7 +77,7 @@ private static String get2DigitString(int value, int div) {
}
public static InputStream getResourceInputStream(String fileName) {
- InputStream inputStream = ImageMetaReaderIntegrationTests.class.getResourceAsStream("images/" + fileName);
+ InputStream inputStream = PhotoPropertiesImageReaderIntegrationTests.class.getResourceAsStream("images/" + fileName);
Assert.assertNotNull("getResourceInputStream images/" + fileName, inputStream);
return inputStream;
}
diff --git a/fotolib2/src/test/java/de/k3b/io/FileCommandAutoIntegrationTests.java b/fotolib2/src/test/java/de/k3b/io/FileCommandAutoIntegrationTests.java
index 4e369f45..12bfb7f4 100644
--- a/fotolib2/src/test/java/de/k3b/io/FileCommandAutoIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/io/FileCommandAutoIntegrationTests.java
@@ -36,11 +36,11 @@
import de.k3b.io.collections.SelectedFiles;
import de.k3b.media.ExifInterface;
import de.k3b.media.ExifInterfaceEx;
-import de.k3b.media.IMetaApi;
-import de.k3b.media.JpgMetaWorkflow;
-import de.k3b.media.MediaDTO;
-import de.k3b.media.MediaDiffCopy;
-import de.k3b.media.MediaUtil;
+import de.k3b.media.IPhotoProperties;
+import de.k3b.media.PhotoPropertiesBulkUpdateService;
+import de.k3b.media.PhotoPropertiesDTO;
+import de.k3b.media.PhotoPropertiesDiffCopy;
+import de.k3b.media.PhotoPropertiesUtil;
import de.k3b.transactionlog.TransactionLoggerBase;
/**
@@ -90,7 +90,7 @@ public void shouldApplyExifChange() throws IOException {
final File testJpg = new File(OUTDIR, outFileBaseName + ".jpg");
TestUtil.saveTestResourceAs(TestUtil.TEST_FILE_JPG_WITH_NO_EXIF, testJpg);
- MediaDiffCopy addExif = new MediaDiffCopy(new MediaDTO().setTitle("title added by " + TEST_CLASS_NAME), true);
+ PhotoPropertiesDiffCopy addExif = new PhotoPropertiesDiffCopy(new PhotoPropertiesDTO().setTitle("title added by " + TEST_CLASS_NAME), true);
// false do not delete source file
int changes = sut.applyExifChanges(false, addExif,SelectedFiles.create(testJpg.toString(), FAKE_ID, FAKE_DATE), null);
@@ -110,7 +110,7 @@ public void shouldCopy() {
@Test
public void shouldCopyExif() {
String outFileBaseName = "shouldCopyExif";
- MediaDiffCopy addExif = new MediaDiffCopy(new MediaDTO().setTitle("title added by " + TEST_CLASS_NAME), true);
+ PhotoPropertiesDiffCopy addExif = new PhotoPropertiesDiffCopy(new PhotoPropertiesDTO().setTitle("title added by " + TEST_CLASS_NAME), true);
FileCommands sut = createFileCommands(outFileBaseName);
RuleFileNameProcessor rename = new RuleFileNameProcessor(null, outFileBaseName, null, OUTDIR);
@@ -137,7 +137,7 @@ public void autoShouldAddTagSameFileNoRenameRule() throws IOException {
FileCommands sut = createFileCommands(outFileBaseName);
SelectedFiles selectedFiles = SelectedFiles.create(inFile.getAbsolutePath(), FAKE_ID, FAKE_DATE);
- final IMetaApi exifChanges = new MediaDTO();
+ final IPhotoProperties exifChanges = new PhotoPropertiesDTO();
exifChanges.setTags(ListUtils.fromString(tagAdded));
PhotoAutoprocessingDto autoProccessData = new PhotoAutoprocessingDto(OUTDIR, new Properties())
@@ -172,7 +172,7 @@ protected void checkMoveCopyWithAutoPrivate(final String outFileBaseName, boolea
FileCommands sut = createFileCommands(outFileBaseName);
SelectedFiles selectedFiles = SelectedFiles.create(inFile.getAbsolutePath(), FAKE_ID, FAKE_DATE);
- final IMetaApi exifChanges = new MediaDTO();
+ final IPhotoProperties exifChanges = new PhotoPropertiesDTO();
exifChanges.setVisibility(VISIBILITY.PRIVATE);
PhotoAutoprocessingDto autoProccessData = new PhotoAutoprocessingDto(OUTDIR, new Properties())
@@ -197,7 +197,7 @@ public void autoShouldAddTagSameFileRenameRuleMatching() throws IOException {
FileCommands sut = createFileCommands(outFileBaseName);
SelectedFiles selectedFiles = SelectedFiles.create(inFile.getAbsolutePath(), FAKE_ID, FAKE_DATE);
- final IMetaApi exifChanges = new MediaDTO();
+ final IPhotoProperties exifChanges = new PhotoPropertiesDTO();
exifChanges.setTags(ListUtils.fromString(tagAdded));
PhotoAutoprocessingDto autoProccessData = new PhotoAutoprocessingDto(OUTDIR, new Properties())
@@ -222,7 +222,7 @@ public void autoShouldAddTagWithRename() throws IOException {
FileCommands sut = createFileCommands(outFileBaseName);
SelectedFiles selectedFiles = SelectedFiles.create(inFile.getAbsolutePath(), FAKE_ID, FAKE_DATE);
- final IMetaApi exifChanges = new MediaDTO();
+ final IPhotoProperties exifChanges = new PhotoPropertiesDTO();
exifChanges.setTags(ListUtils.fromString(tagAdded));
PhotoAutoprocessingDto autoProccessData = new PhotoAutoprocessingDto(OUTDIR, new Properties())
@@ -249,7 +249,7 @@ public void shouldMoveRenameAutoExifSameDir() throws IOException {
SelectedFiles selectedFiles = SelectedFiles.create(inFile.getAbsolutePath(), FAKE_ID, FAKE_DATE);
// 0 avoid rounding of lat/lon; visibility not supported is only public
- final IMetaApi exifChanges = TestUtil.createTestMediaDTO(0).setVisibility(VISIBILITY.PUBLIC);
+ final IPhotoProperties exifChanges = TestUtil.createTestMediaDTO(0).setVisibility(VISIBILITY.PUBLIC);
PhotoAutoprocessingDto autoProccessData = new PhotoAutoprocessingDto(OUTDIR, new Properties())
.setName(newName).setMediaDefaults(exifChanges);
@@ -261,8 +261,8 @@ public void shouldMoveRenameAutoExifSameDir() throws IOException {
ExifInterfaceEx result = new ExifInterfaceEx(new File(OUTDIR, newName + ".jpg").getAbsolutePath(), null, null, "");
- String exprected = MediaUtil.toString(exifChanges, false, null, MediaUtil.FieldID.clasz, MediaUtil.FieldID.path);
- String current = MediaUtil.toString(result, false, null, MediaUtil.FieldID.clasz, MediaUtil.FieldID.path);
+ String exprected = PhotoPropertiesUtil.toString(exifChanges, false, null, PhotoPropertiesUtil.FieldID.clasz, PhotoPropertiesUtil.FieldID.path);
+ String current = PhotoPropertiesUtil.toString(result, false, null, PhotoPropertiesUtil.FieldID.clasz, PhotoPropertiesUtil.FieldID.path);
Assert.assertEquals(exprected, current);
}
@@ -279,8 +279,8 @@ public void shouldChangeFileNameOnVisibilityPrivate() throws IOException {
final String newName = outFileBaseName + "-new";
SelectedFiles selectedFiles = SelectedFiles.create(inFile.getAbsolutePath(), FAKE_ID, FAKE_DATE);
- // final IMetaApi exifChanges = new MediaDTO().setVisibility(VISIBILITY.PUBLIC).setRating(3);
- final IMetaApi exifChanges = new MediaDTO().setVisibility(VISIBILITY.PRIVATE);
+ // final IPhotoProperties exifChanges = new PhotoPropertiesDTO().setVisibility(VISIBILITY.PUBLIC).setRating(3);
+ final IPhotoProperties exifChanges = new PhotoPropertiesDTO().setVisibility(VISIBILITY.PRIVATE);
PhotoAutoprocessingDto autoProccessData = new PhotoAutoprocessingDto(OUTDIR, new Properties())
.setMediaDefaults(exifChanges);
@@ -294,8 +294,8 @@ public void shouldChangeFileNameOnVisibilityPrivate() throws IOException {
private FileCommands createFileCommands(String outFileBaseName) {
FileCommands result = new FileCommands() {
- public JpgMetaWorkflow createWorkflow(TransactionLoggerBase logger, String dbgContext) {
- return new JpgMetaWorkflow(logger) {
+ public PhotoPropertiesBulkUpdateService createWorkflow(TransactionLoggerBase logger, String dbgContext) {
+ return new PhotoPropertiesBulkUpdateService(logger) {
protected long updateMediaDB(long id, String oldJpgAbsolutePath, File newJpgFile) {
// to verify that id has been updated
return id + 1;
diff --git a/fotolib2/src/test/java/de/k3b/media/ExifInterfaceExIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/ExifInterfaceExIntegrationTests.java
index 34cbc5f5..067c8dcd 100644
--- a/fotolib2/src/test/java/de/k3b/media/ExifInterfaceExIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/ExifInterfaceExIntegrationTests.java
@@ -42,7 +42,7 @@
public class ExifInterfaceExIntegrationTests {
private static final Logger logger = LoggerFactory.getLogger(ExifInterfaceExIntegrationTests.class);
- private IMetaApi sut = null;
+ private IPhotoProperties sut = null;
@BeforeClass
public static void initDirectories() {
@@ -99,11 +99,11 @@ public void shouldGetRating() {
@Test
public void shouldModifyInMemory() {
- MediaDTO expected = TestUtil.createTestMediaDTO(2);
+ PhotoPropertiesDTO expected = TestUtil.createTestMediaDTO(2);
expected.setVisibility(VISIBILITY.PUBLIC);
- MediaUtil.copy(sut, expected, true, true);
- MediaDTO actual = new MediaDTO();
- MediaUtil.copy(actual, sut, true, true);
+ PhotoPropertiesUtil.copy(sut, expected, true, true);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO();
+ PhotoPropertiesUtil.copy(actual, sut, true, true);
actual.setPath(expected.path);
Assert.assertEquals(expected.toString(), actual.toString());
@@ -113,11 +113,11 @@ public void shouldModifyInMemory() {
@Test
public void shouldPreservePrivate() {
- MediaDTO expected = TestUtil.createTestMediaDTO(2);
+ PhotoPropertiesDTO expected = TestUtil.createTestMediaDTO(2);
expected.setVisibility(VISIBILITY.PRIVATE);
- MediaUtil.copy(sut, expected, true, true);
- MediaDTO actual = new MediaDTO();
- MediaUtil.copy(actual, sut, true, true);
+ PhotoPropertiesUtil.copy(sut, expected, true, true);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO();
+ PhotoPropertiesUtil.copy(actual, sut, true, true);
actual.setPath(expected.path);
Assert.assertEquals(VISIBILITY.PRIVATE, actual.getVisibility());
@@ -126,11 +126,11 @@ public void shouldPreservePrivate() {
@Test
public void shouldClearInMemory() {
- MediaDTO expected = new MediaDTO();
+ PhotoPropertiesDTO expected = new PhotoPropertiesDTO();
expected.setVisibility(VISIBILITY.PUBLIC);
- MediaUtil.copy(sut, expected, true, true);
- MediaDTO actual = new MediaDTO();
- MediaUtil.copy(actual, sut, true, true);
+ PhotoPropertiesUtil.copy(sut, expected, true, true);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO();
+ PhotoPropertiesUtil.copy(actual, sut, true, true);
actual.setPath(expected.path);
Assert.assertEquals(expected.toString(), actual.toString());
@@ -138,9 +138,9 @@ public void shouldClearInMemory() {
}
- public static IMetaApi getMeta(String fileName) throws IOException {
+ public static IPhotoProperties getMeta(String fileName) throws IOException {
InputStream inputStream = TestUtil.getResourceInputStream(fileName);
- IMetaApi result = new ExifInterfaceEx(fileName, inputStream, null, "JUnit");
+ IPhotoProperties result = new ExifInterfaceEx(fileName, inputStream, null, "JUnit");
return result;
}
diff --git a/fotolib2/src/test/java/de/k3b/media/ExifInterfaceIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/ExifInterfaceIntegrationTests.java
index 308586c6..1dbf175b 100644
--- a/fotolib2/src/test/java/de/k3b/media/ExifInterfaceIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/ExifInterfaceIntegrationTests.java
@@ -162,7 +162,7 @@ public void shouldHanldePrefixStringEmpty() {
}
private ExifInterface assertUpdateSameAsAfterWrite(String fileNameDest, String fileNameSrc, HashMap testItems) throws IOException {
- InputStream inputStream = ImageMetaReaderIntegrationTests.class.getResourceAsStream("images/" + fileNameSrc);
+ InputStream inputStream = PhotoPropertiesImageReaderIntegrationTests.class.getResourceAsStream("images/" + fileNameSrc);
final File sutFile = new File(OUTDIR, fileNameDest);
OutputStream outputStream = new FileOutputStream(sutFile);
@@ -176,7 +176,7 @@ private ExifInterface assertUpdateSameAsAfterWrite(String fileNameDest, String f
FileUtils.close(inputStream, fileNameSrc);
- inputStream = ImageMetaReaderIntegrationTests.class.getResourceAsStream("images/" + fileNameSrc);
+ inputStream = PhotoPropertiesImageReaderIntegrationTests.class.getResourceAsStream("images/" + fileNameSrc);
sutWrite.saveJpegAttributes(inputStream, outputStream, null);
FileUtils.close(outputStream, sutFile);
diff --git a/fotolib2/src/test/java/de/k3b/media/MediaCsvTests.java b/fotolib2/src/test/java/de/k3b/media/MediaCsvTests.java
index fd0e1217..c0555780 100644
--- a/fotolib2/src/test/java/de/k3b/media/MediaCsvTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/MediaCsvTests.java
@@ -40,32 +40,32 @@ public class MediaCsvTests {
public static String createTestCsv(int... ids) {
StringWriter result = new StringWriter();
- MediaCsvSaver saver = new MediaCsvSaver(new PrintWriter(result));
+ PhotoPropertiesCsvSaver saver = new PhotoPropertiesCsvSaver(new PrintWriter(result));
for (int id : ids) {
- MediaDTO item = TestUtil.createTestMediaDTO(id);
+ PhotoPropertiesDTO item = TestUtil.createTestMediaDTO(id);
saver.save(item);
}
return result.toString();
}
- private static class Sut extends CsvLoader {
- private ArrayList result = new ArrayList();
+ private static class Sut extends CsvLoader {
+ private ArrayList result = new ArrayList();
@Override
- protected void onNextItem(MediaCsvItem next, int lineNumber, int recordNumber) {
+ protected void onNextItem(PhotoPropertiesCsvItem next, int lineNumber, int recordNumber) {
if (next != null) {
- result.add(new MediaDTO(next));
+ result.add(new PhotoPropertiesDTO(next));
}
}
- protected List load(int... ids) {
+ protected List load(int... ids) {
String data = createTestCsv(ids);
return load(data);
}
- protected List load(String data) {
+ protected List load(String data) {
result.clear();
- super.load(TestUtil.createReader(data), new MediaCsvItem());
+ super.load(TestUtil.createReader(data), new PhotoPropertiesCsvItem());
return result;
}
}
@@ -74,21 +74,21 @@ protected List load(String data) {
public void shouldLoad1() {
TimeZone.setDefault(DateUtil.UTC);
Sut sut = new Sut();
- List actual = sut.load(1);
- MediaDTO expected = TestUtil.createTestMediaDTO(1);
+ List actual = sut.load(1);
+ PhotoPropertiesDTO expected = TestUtil.createTestMediaDTO(1);
Assert.assertEquals(expected.toString(), actual.get(0).toString());
}
@Test
public void shouldLoadExtremas() {
- String csv = "a;" + MediaXmpFieldDefinition.title.getShortName() + ";c\n"
+ String csv = "a;" + PhotoPropertiesXmpFieldDefinition.title.getShortName() + ";c\n"
+ "normal;#1;regular\n"
+ "short;#2\n"
+ "long;#3;something;extra column\n"
+ "empty\n"
+ "quoted;\"#5\";regular\n";
Sut sut = new Sut();
- List actual = sut.load(csv);
+ List actual = sut.load(csv);
Assert.assertEquals("#", 5, actual.size());
Assert.assertEquals("unquote", "#5", actual.get(4).getTitle());
}
@@ -99,8 +99,8 @@ public void shouldLoadRealData() {
"./02-06Greve/020305blockland/ClaudiaNebenFahrrad.jpg,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,,,,,,,,,,,,,,,,,,,,,,8,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,UTF8,,3,,,,,,,,,Uncalibrated,,,,,,,,,\"Y, Cb, Cr, -\",,,,,,,,,,,,,,,,,,,,2002:03:05 23:09:04,,,,,,,,,,,,,,,,,,,,b443520a10119da99c2550175e6d0efb,,,,,,,,,,2002:03:05 23:09:04,,,,,,,,,,,,,,,,,,,,,,,,,,,,,./02-06Greve/020305blockland,,,,,,,,,,,,,\"Baseline DCT, Huffman coding\",4,\"Big-endian (Motorola, MM)\",480,640,9.74,0220,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2002:03:05 23:09:04+01:00,2013:07:31 19:21:39+02:00,,2002:03:05 23:09:04+01:00,ClaudiaNebenFahrrad.jpg,,,rw-rw-rw-,49 kB,,JPEG,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0100,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,480,,,,,640x480,,,640,,,,,,,b443520a10119da99c2550175e6d0efb,,,,,,,,,,,1.01,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,image/jpeg,,,,,2013:06:14 09:35:16,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,480,pixel,640,0.266667,normalized,0.16875,0.496875,0.141667,ClaudiaGreve,Face,,,,,,,,inches,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Picasa,,,,,,,,,,,,ClaudiaGreve,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Image::ExifTool 6.93,,,,,,72,,Centered,YCbCr4:2:0 (2 2),72,,,\n" +
"./02-06Greve/020305blockland/ClaudiaNebenFahrrad.xmp,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2002:03:05 23:09:04,,,,,,,,,,,,,,,,,,,,,,,,,2002-03-05,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,./02-06Greve/020305blockland,,,,,,,,,,,,,,,,,,9.74,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2013:07:31 20:34:38+02:00,2013:07:31 20:34:38+02:00,,2013:07:31 20:34:38+02:00,ClaudiaNebenFahrrad.xmp,,,rw-rw-rw-,713 bytes,,XMP,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,application/rdf+xml,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\"ClaudiaGreve, Greve\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Image::ExifTool 9.33,,,,,,,,,,,,,\n";
Sut sut = new Sut();
- List actual = sut.load(csv);
- for(IMetaApi item : actual) {
+ List actual = sut.load(csv);
+ for(IPhotoProperties item : actual) {
System.out.println(item.toString());
}
@@ -109,8 +109,8 @@ public void shouldLoadRealData() {
@Test
public void shouldSaveLoadExtra() {
- String data = new MediaAsString().setExtra("some extra").toString();
- MediaAsString sut = new MediaAsString().fromString(data);
+ String data = new PhotoPropertiesAsString().setExtra("some extra").toString();
+ PhotoPropertiesAsString sut = new PhotoPropertiesAsString().fromString(data);
Assert.assertEquals("some extra", sut.getExtra());
}
diff --git a/fotolib2/src/test/java/de/k3b/media/MediaMappingTests.java b/fotolib2/src/test/java/de/k3b/media/MediaMappingTests.java
index ad1a767d..e62e3662 100644
--- a/fotolib2/src/test/java/de/k3b/media/MediaMappingTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/MediaMappingTests.java
@@ -22,7 +22,6 @@
import org.junit.BeforeClass;
import org.junit.Test;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -56,7 +55,7 @@ public void setup() {
}
- private class ImageMetaReaderDummy extends ImageMetaReader {
+ private class PhotoPropertiesImageReaderDummy extends PhotoPropertiesImageReader {
protected boolean isEmpty(Object result, int tryNumber, String debugContext, String debugFieldName) {
return isEmptyDbgImpl(debugResult, result, tryNumber, debugContext, debugFieldName);
}
@@ -69,33 +68,33 @@ protected boolean isEmpty(Object result, int tryNumber, String debugContext, Str
}
- private class MediaXmpSegmentDummy extends MediaXmpSegment {
- protected String getPropertyAsString(String debugContext, MediaXmpFieldDefinition... definitions) {
+ private class PhotoPropertiesXmpSegmentDummy extends PhotoPropertiesXmpSegment {
+ protected String getPropertyAsString(String debugContext, PhotoPropertiesXmpFieldDefinition... definitions) {
debugResult.append("| ").append(debugContext.substring(3)).append(" | ");
- for (MediaXmpFieldDefinition definition : definitions) {
+ for (PhotoPropertiesXmpFieldDefinition definition : definitions) {
debugResult.append(definition.getXmpNamespace().getPrefix()).append(".").append(definition.getShortName()).append(" | ");
}
debugResult.append("\n");
return null;
}
- protected List getPropertyArray(String debugContext, MediaXmpFieldDefinition... definitions) {
+ protected List getPropertyArray(String debugContext, PhotoPropertiesXmpFieldDefinition... definitions) {
getPropertyAsString(debugContext, definitions);
return null;
}
}
- private class MediaCsvItemDummy extends MediaCsvItem {
- private ArrayList cols = new ArrayList<>();
+ private class PhotoPropertiesCsvItemDummy extends PhotoPropertiesCsvItem {
+ private ArrayList cols = new ArrayList<>();
- MediaCsvItemDummy() {
+ PhotoPropertiesCsvItemDummy() {
initFieldDefinitions(null);
}
protected Date getDate(String debugContext, int... columnNumbers) {
debugResult.append("| ").append(debugContext.substring(3)).append(" | ");
for (int columnNumber : columnNumbers) {
- MediaXmpFieldDefinition definition = cols.get(columnNumber);
+ PhotoPropertiesXmpFieldDefinition definition = cols.get(columnNumber);
debugResult.append(definition.getXmpNamespace().getPrefix()).append(".").append(definition.getShortName()).append(" | ");
}
debugResult.append("\n");
@@ -106,7 +105,7 @@ protected String getString(String debugContext, int columnNumber) {
getDate(debugContext, columnNumber);
return null;
}
- protected int getColumnIndex(List lcHeader, MediaXmpFieldDefinition columnDefinition) {
+ protected int getColumnIndex(List lcHeader, PhotoPropertiesXmpFieldDefinition columnDefinition) {
cols.add(columnDefinition);
return cols.indexOf(columnDefinition);
}
@@ -131,21 +130,21 @@ private static boolean isEmptyDbgImpl(StringBuilder debugResult, Object result,
@Test
public void dump1ImageMetaReaderDummy() {
- IMetaApi sut = new ImageMetaReaderDummy();
+ IPhotoProperties sut = new PhotoPropertiesImageReaderDummy();
dump(sut);
}
@Test
public void dump2ExifInterfaceExDummy() {
- IMetaApi sut = new ExifInterfaceExDummy();
+ IPhotoProperties sut = new ExifInterfaceExDummy();
dump(sut);
}
@Test
public void dump3MediaXmpSegmentDummy() {
- IMetaApi sut = new MediaXmpSegmentDummy();
+ IPhotoProperties sut = new PhotoPropertiesXmpSegmentDummy();
dump(sut);
}
@@ -153,12 +152,12 @@ public void dump3MediaXmpSegmentDummy() {
@Test
public void dump4MediaCsvItemDummy() {
- IMetaApi sut = new MediaCsvItemDummy();
+ IPhotoProperties sut = new PhotoPropertiesCsvItemDummy();
dump(sut);
}
- protected void dump(IMetaApi sut) {
- MediaUtil.copyNonEmpty(TestUtil.createTestMediaDTO(3), sut);
+ protected void dump(IPhotoProperties sut) {
+ PhotoPropertiesUtil.copyNonEmpty(TestUtil.createTestMediaDTO(3), sut);
System.out.printf("**" + sut.getClass().getSuperclass().getName() + "**\n" + HEADER);
System.out.printf(debugResult.toString() + "\n");
diff --git a/fotolib2/src/test/java/de/k3b/media/MediaXmpTests.java b/fotolib2/src/test/java/de/k3b/media/MediaXmpTests.java
index 2775b947..4aa4ec89 100644
--- a/fotolib2/src/test/java/de/k3b/media/MediaXmpTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/MediaXmpTests.java
@@ -53,15 +53,15 @@ public static void initDirectories() {
@Test
public void shouldReadExistingXmpFile() throws IOException {
TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
- MediaXmpSegment sut = new MediaXmpSegment();
+ PhotoPropertiesXmpSegment sut = new PhotoPropertiesXmpSegment();
InputStream fis = TestUtil.getResourceInputStream(TestUtil.TEST_FILE_XMP_WITH_EXIF);
- sut = new MediaXmpSegment();
+ sut = new PhotoPropertiesXmpSegment();
sut.load(fis, "JUnit");
fis.close();
- MediaDTO actual = new MediaDTO(sut);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO(sut);
- Assert.assertEquals(sut.toString(), "MediaDTO: path null dateTimeTaken 1962-11-07T09:38:46 title Headline description XPSubject latitude_longitude 27.818611, -15.764444 rating 3 visibility null tags Marker1, Marker2", actual.toString());
+ Assert.assertEquals(sut.toString(), "PhotoPropertiesDTO: path null dateTimeTaken 1962-11-07T09:38:46 title Headline description XPSubject latitude_longitude 27.818611, -15.764444 rating 3 visibility null tags Marker1, Marker2", actual.toString());
}
private InputStream getStream(String _resourceName) {
@@ -95,20 +95,20 @@ private InputStream getStream(String _resourceName) {
@Test
public void shouldCopyAllFields() {
- MediaXmpSegment sut = new MediaXmpSegment();
- MediaDTO expected = TestUtil.createTestMediaDTO(1);
- MediaUtil.copy(sut, expected, true, true);
- MediaDTO actual = new MediaDTO(sut);
+ PhotoPropertiesXmpSegment sut = new PhotoPropertiesXmpSegment();
+ PhotoPropertiesDTO expected = TestUtil.createTestMediaDTO(1);
+ PhotoPropertiesUtil.copy(sut, expected, true, true);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO(sut);
Assert.assertEquals(expected.toString(), actual.toString());
}
@Test
public void shouldSaveAndLoadXmp() throws IOException {
- MediaDTO content = TestUtil.createTestMediaDTO(1);
+ PhotoPropertiesDTO content = TestUtil.createTestMediaDTO(1);
content.setPath(null); // path is not copied to/from xmp file
- MediaXmpSegment sut = new MediaXmpSegment();
- MediaUtil.copy(sut, content, true, true);
+ PhotoPropertiesXmpSegment sut = new PhotoPropertiesXmpSegment();
+ PhotoPropertiesUtil.copy(sut, content, true, true);
OUTDIR.mkdirs();
File outFile = new File(OUTDIR, "shouldSaveAsXmp.xmp");
@@ -117,11 +117,11 @@ public void shouldSaveAndLoadXmp() throws IOException {
fos.close();
FileInputStream fis = new FileInputStream(outFile);
- sut = new MediaXmpSegment();
+ sut = new PhotoPropertiesXmpSegment();
sut.load(fis, "JUnit");
fis.close();
- MediaDTO actual = new MediaDTO(sut);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO(sut);
Assert.assertEquals(content.toString(), actual.toString());
}
diff --git a/fotolib2/src/test/java/de/k3b/media/JpgMetaWorkflowIntegratoinTests.java b/fotolib2/src/test/java/de/k3b/media/PhotoPropertiesBulkUpdateServiceIntegratoinTests.java
similarity index 81%
rename from fotolib2/src/test/java/de/k3b/media/JpgMetaWorkflowIntegratoinTests.java
rename to fotolib2/src/test/java/de/k3b/media/PhotoPropertiesBulkUpdateServiceIntegratoinTests.java
index 0fecabb5..38fec8bb 100644
--- a/fotolib2/src/test/java/de/k3b/media/JpgMetaWorkflowIntegratoinTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/PhotoPropertiesBulkUpdateServiceIntegratoinTests.java
@@ -38,10 +38,10 @@
*/
-public class JpgMetaWorkflowIntegratoinTests {
+public class PhotoPropertiesBulkUpdateServiceIntegratoinTests {
// Obtain a logger instance
- private static final Logger LOGGER = LoggerFactory.getLogger(JpgMetaWorkflowIntegratoinTests.class);
- private static final String SUT_CLASS_NAME = JpgMetaWorkflowIntegratoinTests.class.getSimpleName();
+ private static final Logger LOGGER = LoggerFactory.getLogger(PhotoPropertiesBulkUpdateServiceIntegratoinTests.class);
+ private static final String SUT_CLASS_NAME = PhotoPropertiesBulkUpdateServiceIntegratoinTests.class.getSimpleName();
private static final File OUTDIR = new File(TestUtil.OUTDIR_ROOT, SUT_CLASS_NAME).getAbsoluteFile();
@BeforeClass
@@ -69,9 +69,9 @@ public void shouldUpdateExistingExifWithCreateXmp() throws IOException
File testJpg = copy(fileNameSrc, fileNameDest);
- MediaDTO testData = TestUtil.createTestMediaDTO(4);
- new JpgMetaWorkflow(null).applyChanges(testJpg,
- null, 0, false, new MediaDiffCopy(true, true).setDiff(testData, EnumSet.allOf(MediaUtil.FieldID.class)));
+ PhotoPropertiesDTO testData = TestUtil.createTestMediaDTO(4);
+ new PhotoPropertiesBulkUpdateService(null).applyChanges(testJpg,
+ null, 0, false, new PhotoPropertiesDiffCopy(true, true).setDiff(testData, EnumSet.allOf(PhotoPropertiesUtil.FieldID.class)));
// LOGGER.info(sutRead.toString());
diff --git a/fotolib2/src/test/java/de/k3b/media/MediaDiffCopyTests.java b/fotolib2/src/test/java/de/k3b/media/PhotoPropertiesDiffCopyTests.java
similarity index 59%
rename from fotolib2/src/test/java/de/k3b/media/MediaDiffCopyTests.java
rename to fotolib2/src/test/java/de/k3b/media/PhotoPropertiesDiffCopyTests.java
index f505f46d..1869e468 100644
--- a/fotolib2/src/test/java/de/k3b/media/MediaDiffCopyTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/PhotoPropertiesDiffCopyTests.java
@@ -35,12 +35,12 @@
* Created by k3b on 07.07.2017.
*/
-public class MediaDiffCopyTests {
+public class PhotoPropertiesDiffCopyTests {
@Test
public void shouldHandleNoChanges() {
- IMetaApi initialData = TestUtil.createTestMediaDTO(1);
- IMetaApi modifiedData = TestUtil.createTestMediaDTO(1);
- MediaDiffCopy sut = new MediaDiffCopy(true, true).setDiff(initialData, modifiedData);
+ IPhotoProperties initialData = TestUtil.createTestMediaDTO(1);
+ IPhotoProperties modifiedData = TestUtil.createTestMediaDTO(1);
+ PhotoPropertiesDiffCopy sut = new PhotoPropertiesDiffCopy(true, true).setDiff(initialData, modifiedData);
Assert.assertEquals("null means no changes: " + sut, null, sut);
}
@@ -48,20 +48,20 @@ public void shouldHandleNoChanges() {
// #91: Fix Photo without geo may have different representations values
@Test
public void shouldHandleGpsNanNullNoValue() {
- IMetaApi initialData = TestUtil.createTestMediaDTO(1).setLatitudeLongitude(Double.NaN, Double.NaN);
- IMetaApi modifiedData = TestUtil.createTestMediaDTO(1).setLatitudeLongitude(null, IGeoPointInfo.NO_LAT_LON);
- MediaDiffCopy sut = new MediaDiffCopy(true, true).setDiff(initialData, modifiedData);
+ IPhotoProperties initialData = TestUtil.createTestMediaDTO(1).setLatitudeLongitude(Double.NaN, Double.NaN);
+ IPhotoProperties modifiedData = TestUtil.createTestMediaDTO(1).setLatitudeLongitude(null, IGeoPointInfo.NO_LAT_LON);
+ PhotoPropertiesDiffCopy sut = new PhotoPropertiesDiffCopy(true, true).setDiff(initialData, modifiedData);
Assert.assertEquals("null means no changes: " + sut, null, sut);
}
@Test
public void shouldOverwriteNullDate() {
- IMetaApi initialData = TestUtil.createTestMediaDTO(1).setDateTimeTaken(null);
- IMetaApi modifiedData = TestUtil.createTestMediaDTO(1);
- MediaDiffCopy sut = new MediaDiffCopy(true, true).setDiff(initialData, modifiedData);
+ IPhotoProperties initialData = TestUtil.createTestMediaDTO(1).setDateTimeTaken(null);
+ IPhotoProperties modifiedData = TestUtil.createTestMediaDTO(1);
+ PhotoPropertiesDiffCopy sut = new PhotoPropertiesDiffCopy(true, true).setDiff(initialData, modifiedData);
- IMetaApi destintaion = createMediaDto().setDateTimeTaken(new Date());
+ IPhotoProperties destintaion = createMediaDto().setDateTimeTaken(new Date());
int numberofChanges = sut.applyChanges(destintaion).size();
Assert.assertEquals("#changed date" + sut, modifiedData.getDateTimeTaken(), destintaion.getDateTimeTaken());
Assert.assertEquals("#changes " + sut, 1, numberofChanges);
@@ -69,11 +69,11 @@ public void shouldOverwriteNullDate() {
@Test
public void shouldSetDateNull() {
- IMetaApi initialData = TestUtil.createTestMediaDTO(1);
- IMetaApi modifiedData = TestUtil.createTestMediaDTO(1).setDateTimeTaken(null);
- MediaDiffCopy sut = new MediaDiffCopy(true, true).setDiff(initialData, modifiedData);
+ IPhotoProperties initialData = TestUtil.createTestMediaDTO(1);
+ IPhotoProperties modifiedData = TestUtil.createTestMediaDTO(1).setDateTimeTaken(null);
+ PhotoPropertiesDiffCopy sut = new PhotoPropertiesDiffCopy(true, true).setDiff(initialData, modifiedData);
- IMetaApi destintaion = createMediaDto().setDateTimeTaken(new Date());
+ IPhotoProperties destintaion = createMediaDto().setDateTimeTaken(new Date());
int numberofChanges = sut.applyChanges(destintaion).size();
Assert.assertEquals("#changed date" + sut, null, destintaion.getDateTimeTaken());
Assert.assertEquals("#changes " + sut, 1, numberofChanges);
@@ -83,13 +83,13 @@ public void shouldSetDateNull() {
@Test
public void shouldShiftDate() {
// the examples from documentation
- IMetaApi initialData = TestUtil.createTestMediaDTO(1).setDateTimeTaken(DateUtil.parseIsoDate("2001-01-01T04:11:52"));
- IMetaApi modifiedData = TestUtil.createTestMediaDTO(1).setDateTimeTaken(DateUtil.parseIsoDate("2017-07-03T14:22:52"));
+ IPhotoProperties initialData = TestUtil.createTestMediaDTO(1).setDateTimeTaken(DateUtil.parseIsoDate("2001-01-01T04:11:52"));
+ IPhotoProperties modifiedData = TestUtil.createTestMediaDTO(1).setDateTimeTaken(DateUtil.parseIsoDate("2017-07-03T14:22:52"));
// Added 16 years 6 months 2 days 10 hours and 11 minutes.
- MediaDiffCopy sut = new MediaDiffCopy(true, true).setDiff(initialData, modifiedData);
+ PhotoPropertiesDiffCopy sut = new PhotoPropertiesDiffCopy(true, true).setDiff(initialData, modifiedData);
// example date1
- IMetaApi destintaion = createMediaDto().setDateTimeTaken(DateUtil.parseIsoDate("2001-01-03T08:06:05:52"));
+ IPhotoProperties destintaion = createMediaDto().setDateTimeTaken(DateUtil.parseIsoDate("2001-01-03T08:06:05:52"));
int numberofChanges = sut.applyChanges(destintaion).size();
Assert.assertEquals("#changed date1" + sut, "2017-07-05T18:17:05", DateUtil.toIsoDateTimeString(destintaion.getDateTimeTaken()));
Assert.assertEquals("#changes1 " + sut, 1, numberofChanges);
@@ -113,11 +113,11 @@ public void shouldApplyTagDelta() {
String added = "newTag";
String removed = "oldTag";
- IMetaApi initialData = TestUtil.createTestMediaDTO(1); initialData.getTags().add(removed);
- IMetaApi modifiedData = TestUtil.createTestMediaDTO(1); modifiedData.getTags().add(added);
- MediaDiffCopy sut = new MediaDiffCopy(true, true).setDiff(initialData, modifiedData);
+ IPhotoProperties initialData = TestUtil.createTestMediaDTO(1); initialData.getTags().add(removed);
+ IPhotoProperties modifiedData = TestUtil.createTestMediaDTO(1); modifiedData.getTags().add(added);
+ PhotoPropertiesDiffCopy sut = new PhotoPropertiesDiffCopy(true, true).setDiff(initialData, modifiedData);
- IMetaApi destintaion = createMediaDto();
+ IPhotoProperties destintaion = createMediaDto();
List tagsUnderTest = TestUtil.createTestMediaDTO(2).getTags();
tagsUnderTest.add(removed);
destintaion.setTags(tagsUnderTest);
@@ -131,11 +131,11 @@ public void shouldApplyTagDelta() {
@Test
public void shouldApplyTitleDelta() {
- IMetaApi initialData = TestUtil.createTestMediaDTO(1).setTitle("Hello world");
- IMetaApi modifiedData = TestUtil.createTestMediaDTO(1).setTitle("+ appended");
- MediaDiffCopy sut = new MediaDiffCopy(true, true).setDiff(initialData, modifiedData);
+ IPhotoProperties initialData = TestUtil.createTestMediaDTO(1).setTitle("Hello world");
+ IPhotoProperties modifiedData = TestUtil.createTestMediaDTO(1).setTitle("+ appended");
+ PhotoPropertiesDiffCopy sut = new PhotoPropertiesDiffCopy(true, true).setDiff(initialData, modifiedData);
- IMetaApi destintaion = createMediaDto().setTitle("some title");
+ IPhotoProperties destintaion = createMediaDto().setTitle("some title");
int numberofChanges = sut.applyChanges(destintaion).size();
Assert.assertEquals("#added title missing " + sut, "some title appended", destintaion.getTitle());
@@ -148,7 +148,7 @@ public void shouldApplyTitleDelta() {
Assert.assertEquals("#changes2 " + sut, 1, numberofChanges);
destintaion = createMediaDto().setTitle("already-appended");
- List changes = sut.applyChanges(destintaion);
+ List changes = sut.applyChanges(destintaion);
Assert.assertEquals("#added title already appended " + sut, "already-appended", destintaion.getTitle());
Assert.assertNull("#changes3 " + sut, changes);
@@ -156,11 +156,11 @@ public void shouldApplyTitleDelta() {
@Test
public void shouldApplyDescriptionDelta() {
- IMetaApi initialData = TestUtil.createTestMediaDTO(1).setDescription("Hello world");
- IMetaApi modifiedData = TestUtil.createTestMediaDTO(1).setDescription("+ appended");
- MediaDiffCopy sut = new MediaDiffCopy(true, true).setDiff(initialData, modifiedData);
+ IPhotoProperties initialData = TestUtil.createTestMediaDTO(1).setDescription("Hello world");
+ IPhotoProperties modifiedData = TestUtil.createTestMediaDTO(1).setDescription("+ appended");
+ PhotoPropertiesDiffCopy sut = new PhotoPropertiesDiffCopy(true, true).setDiff(initialData, modifiedData);
- IMetaApi destintaion = createMediaDto().setDescription("some Description");
+ IPhotoProperties destintaion = createMediaDto().setDescription("some Description");
int numberofChanges = sut.applyChanges(destintaion).size();
Assert.assertEquals("#added Description " + sut, "some Description appended", destintaion.getDescription());
@@ -169,14 +169,14 @@ public void shouldApplyDescriptionDelta() {
@Test
public void shouldToString() {
- IMetaApi initialData = TestUtil.createTestMediaDTO(1);
- IMetaApi modifiedData = TestUtil.createTestMediaDTO(2);
- MediaDiffCopy sut = new MediaDiffCopy(true, true).setDiff(initialData, modifiedData);
+ IPhotoProperties initialData = TestUtil.createTestMediaDTO(1);
+ IPhotoProperties modifiedData = TestUtil.createTestMediaDTO(2);
+ PhotoPropertiesDiffCopy sut = new PhotoPropertiesDiffCopy(true, true).setDiff(initialData, modifiedData);
Assert.assertNotNull(sut.toString(), sut.toString());
}
- private static IMetaApi createMediaDto() {
- return new MediaDTO().setVisibility(VISIBILITY.PUBLIC);
+ private static IPhotoProperties createMediaDto() {
+ return new PhotoPropertiesDTO().setVisibility(VISIBILITY.PUBLIC);
}
}
diff --git a/fotolib2/src/test/java/de/k3b/media/ImageMetaReaderIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/PhotoPropertiesImageReaderIntegrationTests.java
similarity index 88%
rename from fotolib2/src/test/java/de/k3b/media/ImageMetaReaderIntegrationTests.java
rename to fotolib2/src/test/java/de/k3b/media/PhotoPropertiesImageReaderIntegrationTests.java
index bbe2bc46..86eb81d2 100644
--- a/fotolib2/src/test/java/de/k3b/media/ImageMetaReaderIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/PhotoPropertiesImageReaderIntegrationTests.java
@@ -42,19 +42,19 @@
* Created by k3b on 28.03.2017.
*/
-public class ImageMetaReaderIntegrationTests {
- private static final Logger logger = LoggerFactory.getLogger(ImageMetaReaderIntegrationTests.class);
+public class PhotoPropertiesImageReaderIntegrationTests {
+ private static final Logger logger = LoggerFactory.getLogger(PhotoPropertiesImageReaderIntegrationTests.class);
- private ImageMetaReader sut = null;
+ private PhotoPropertiesImageReader sut = null;
@BeforeClass
public static void initDirectories() {
LibGlobal.appName = "JUnit";
- LibGlobal.appVersion = "ImageMetaReaderIntegrationTests";
+ LibGlobal.appVersion = "PhotoPropertiesImageReaderIntegrationTests";
}
@Before
public void setup() throws IOException {
- ImageMetaReader.DEBUG = true;
+ PhotoPropertiesImageReader.DEBUG = true;
sut = getMeta(TestUtil.TEST_FILE_JPG_WITH_EXIF);
}
@@ -118,9 +118,9 @@ public void shouldIptcList() {
}
- public static ImageMetaReader getMeta(String fileName) throws IOException {
+ public static PhotoPropertiesImageReader getMeta(String fileName) throws IOException {
InputStream inputStream = TestUtil.getResourceInputStream(fileName);
- ImageMetaReader result = new ImageMetaReader().load(fileName, inputStream, null, "JUnit");
+ PhotoPropertiesImageReader result = new PhotoPropertiesImageReader().load(fileName, inputStream, null, "JUnit");
return result;
}
diff --git a/fotolib2/src/test/java/de/k3b/media/MetaWriterExifXmlIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/PhotoPropertiesUpdateHandlerIntegrationTests.java
similarity index 67%
rename from fotolib2/src/test/java/de/k3b/media/MetaWriterExifXmlIntegrationTests.java
rename to fotolib2/src/test/java/de/k3b/media/PhotoPropertiesUpdateHandlerIntegrationTests.java
index fb62d072..b1e18501 100644
--- a/fotolib2/src/test/java/de/k3b/media/MetaWriterExifXmlIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/PhotoPropertiesUpdateHandlerIntegrationTests.java
@@ -40,14 +40,14 @@
* Created by k3b on 24.04.2017.
*/
-public class MetaWriterExifXmlIntegrationTests {
- private static final Logger logger = LoggerFactory.getLogger(MetaWriterExifXmlIntegrationTests.class);
- private static final File OUTDIR = new File(TestUtil.OUTDIR_ROOT, "MetaWriterExifXmlIntegrationTests");
+public class PhotoPropertiesUpdateHandlerIntegrationTests {
+ private static final Logger logger = LoggerFactory.getLogger(PhotoPropertiesUpdateHandlerIntegrationTests.class);
+ private static final File OUTDIR = new File(TestUtil.OUTDIR_ROOT, "PhotoPropertiesUpdateHandlerIntegrationTests");
@BeforeClass
public static void initDirectories() {
LibGlobal.appName = "JUnit";
- LibGlobal.appVersion = "MetaWriterExifXmlIntegrationTests";
+ LibGlobal.appVersion = "PhotoPropertiesUpdateHandlerIntegrationTests";
OUTDIR.mkdirs();
}
@@ -60,12 +60,12 @@ public void emptyWriteEmptyExifXmpCreate() throws IOException
File out = new File(OUTDIR,"emptyWriteEmptyExifXmpCreate.jpg");
TestUtil.saveTestResourceAs(TestUtil.TEST_FILE_JPG_WITH_NO_EXIF, out);
- MetaWriterExifXml sut = MetaWriterExifXml.create(out.getAbsolutePath(), null, false, "JUnit"
+ PhotoPropertiesUpdateHandler sut = PhotoPropertiesUpdateHandler.create(out.getAbsolutePath(), null, false, "JUnit"
, true, true, true); //exif, xmp, create
- MediaDTO empty = new MediaDTO();
+ PhotoPropertiesDTO empty = new PhotoPropertiesDTO();
empty.setVisibility(VISIBILITY.PUBLIC); // not complete empty since it is public visible
- MediaUtil.copy(sut, empty, true, true);
+ PhotoPropertiesUtil.copy(sut, empty, true, true);
// was overwritten by copy
sut.setPath(out.getAbsolutePath());
@@ -90,14 +90,14 @@ public void existingWriteEmptyExifXmp() throws IOException
TestUtil.saveTestResourceAs(TestUtil.TEST_FILE_JPG_WITH_EXIF, out);
TestUtil.saveTestResourceAs(TestUtil.TEST_FILE_XMP_WITH_EXIF, FileCommands.getSidecar(out.getAbsolutePath(), false));
- MetaWriterExifXml sut = MetaWriterExifXml.create(out.getAbsolutePath(), null, false, "JUnit"
+ PhotoPropertiesUpdateHandler sut = PhotoPropertiesUpdateHandler.create(out.getAbsolutePath(), null, false, "JUnit"
, true, true, true); //exif, xmp, create
- MediaDTO empty = new MediaDTO();
+ PhotoPropertiesDTO empty = new PhotoPropertiesDTO();
empty.setVisibility(VISIBILITY.PUBLIC); // not complete empty since it is public visible
- MediaUtil.copy(sut, empty, true, true);
+ PhotoPropertiesUtil.copy(sut, empty, true, true);
-// System.out.printf("exif " + MediaUtil.toString(sut.getExif()));
- String xmpContent = "xmp " + MediaUtil.toString(sut.getXmp());
+// System.out.printf("exif " + PhotoPropertiesUtil.toString(sut.getExif()));
+ String xmpContent = "xmp " + PhotoPropertiesUtil.toString(sut.getXmp());
System.out.printf(xmpContent);
@@ -116,13 +116,13 @@ public void existingWriteValueExifXmpCreate() throws IOException
File out = new File(OUTDIR,"existingWriteValueExifXmpCreate.jpg");
TestUtil.saveTestResourceAs(TestUtil.TEST_FILE_JPG_WITH_EXIF, out);
- MetaWriterExifXml sut = MetaWriterExifXml.create(out.getAbsolutePath(), null, false, "JUnit"
+ PhotoPropertiesUpdateHandler sut = PhotoPropertiesUpdateHandler.create(out.getAbsolutePath(), null, false, "JUnit"
, true, true, true); //exif, xmp, create
- MediaDTO value = createTestValue();
- MediaUtil.copy(sut, value, true, true);
+ PhotoPropertiesDTO value = createTestValue();
+ PhotoPropertiesUtil.copy(sut, value, true, true);
-// System.out.printf("exif " + MediaUtil.toString(sut.getExif()));
- String xmpContent = "xmp " + MediaUtil.toString(sut.getXmp());
+// System.out.printf("exif " + PhotoPropertiesUtil.toString(sut.getExif()));
+ String xmpContent = "xmp " + PhotoPropertiesUtil.toString(sut.getXmp());
System.out.printf(xmpContent);
@@ -133,10 +133,10 @@ public void existingWriteValueExifXmpCreate() throws IOException
assertEqual(out, value, value, sut);
}
- private static MediaDTO createTestValue() {
- final MediaDTO testMediaDTO = TestUtil.createTestMediaDTO(2);
- testMediaDTO.setVisibility(VISIBILITY.PUBLIC);
- return testMediaDTO;
+ private static PhotoPropertiesDTO createTestValue() {
+ final PhotoPropertiesDTO testPhotoPropertiesDTO = TestUtil.createTestMediaDTO(2);
+ testPhotoPropertiesDTO.setVisibility(VISIBILITY.PUBLIC);
+ return testPhotoPropertiesDTO;
}
@@ -146,10 +146,10 @@ public void emptyWriteValuesXmpCreate() throws IOException
File out = new File(OUTDIR,"emptyWriteValuesXmpCreate.jpg");
TestUtil.saveTestResourceAs(TestUtil.TEST_FILE_JPG_WITH_NO_EXIF, out);
- MetaWriterExifXml sut = MetaWriterExifXml.create(out.getAbsolutePath(), null, false, "JUnit"
+ PhotoPropertiesUpdateHandler sut = PhotoPropertiesUpdateHandler.create(out.getAbsolutePath(), null, false, "JUnit"
, false, true, true); //exif, xmp, create
- MediaDTO values = createTestValue();
- MediaUtil.copy(sut, values, true, true);
+ PhotoPropertiesDTO values = createTestValue();
+ PhotoPropertiesUtil.copy(sut, values, true, true);
// was overwritten by copy
sut.setPath(out.getAbsolutePath());
@@ -167,10 +167,10 @@ public void emptyWriteValuesExifOnly() throws IOException
File out = new File(OUTDIR,"emptyWriteValuesExifOnly.jpg");
TestUtil.saveTestResourceAs(TestUtil.TEST_FILE_JPG_WITH_NO_EXIF, out);
- MetaWriterExifXml sut = MetaWriterExifXml.create(out.getAbsolutePath(), null, false, "JUnit"
+ PhotoPropertiesUpdateHandler sut = PhotoPropertiesUpdateHandler.create(out.getAbsolutePath(), null, false, "JUnit"
, true, false, false); //exif, xmp, create
- MediaDTO values = createTestValue();
- MediaUtil.copy(sut, values, true, true);
+ PhotoPropertiesDTO values = createTestValue();
+ PhotoPropertiesUtil.copy(sut, values, true, true);
// was overwritten by copy
sut.setPath(out.getAbsolutePath());
@@ -182,8 +182,8 @@ public void emptyWriteValuesExifOnly() throws IOException
// logger.info(sut.toString());
}
- private void assertEqual(File file, MediaDTO expectedExif, MediaDTO expectedXmp, MetaWriterExifXml oldSut) throws IOException {
- MetaWriterExifXml sut = MetaWriterExifXml.create(file.getAbsolutePath(), null, false, "JUnit-check"
+ private void assertEqual(File file, PhotoPropertiesDTO expectedExif, PhotoPropertiesDTO expectedXmp, PhotoPropertiesUpdateHandler oldSut) throws IOException {
+ PhotoPropertiesUpdateHandler sut = PhotoPropertiesUpdateHandler.create(file.getAbsolutePath(), null, false, "JUnit-check"
, true, true, false); //exif, xmp, create
if (oldSut != null) {
@@ -191,27 +191,27 @@ private void assertEqual(File file, MediaDTO expectedExif, MediaDTO expectedXmp,
try {
out = new FileWriter(new File(file.getAbsolutePath()+ ".log"), false);
- IMetaApi exif = oldSut.getExif();
+ IPhotoProperties exif = oldSut.getExif();
if (exif != null) {
- out.write("old exif " + MediaUtil.toString(exif) + "\n");
+ out.write("old exif " + PhotoPropertiesUtil.toString(exif) + "\n");
out.write(exif.toString() + "\n");
}
exif = oldSut.getXmp();
if (exif != null) {
- out.write("old xmp " + MediaUtil.toString(exif) + "\n");
+ out.write("old xmp " + PhotoPropertiesUtil.toString(exif) + "\n");
out.write(exif.toString() + "\n");
}
exif = sut.getExif();
if (exif != null) {
- out.write("new exif " + MediaUtil.toString(exif) + "\n");
+ out.write("new exif " + PhotoPropertiesUtil.toString(exif) + "\n");
out.write(exif.toString() + "\n");
}
exif = sut.getXmp();
if (exif != null) {
- out.write("new xmp " + MediaUtil.toString(exif) + "\n");
+ out.write("new xmp " + PhotoPropertiesUtil.toString(exif) + "\n");
out.write(exif.toString() + "\n");
}
} catch (IOException e) {
@@ -227,8 +227,8 @@ private void assertEqual(File file, MediaDTO expectedExif, MediaDTO expectedXmp,
getMediaString(expectedXmp), getMediaString(sut.getExif()));
}
- private String getMediaString(IMetaApi media) {
- String result = MediaUtil.toString(media, false, null, MediaUtil.FieldID.path, MediaUtil.FieldID.clasz);
+ private String getMediaString(IPhotoProperties media) {
+ String result = PhotoPropertiesUtil.toString(media, false, null, PhotoPropertiesUtil.FieldID.path, PhotoPropertiesUtil.FieldID.clasz);
// ignore runtime type and path
return result; // .substring(result.indexOf("dateTimeTaken"));
}
diff --git a/fotolib2/src/test/java/de/k3b/media/MediaUtilTests.java b/fotolib2/src/test/java/de/k3b/media/PhotoPropertiesUtilTests.java
similarity index 62%
rename from fotolib2/src/test/java/de/k3b/media/MediaUtilTests.java
rename to fotolib2/src/test/java/de/k3b/media/PhotoPropertiesUtilTests.java
index c7c28385..501fa921 100644
--- a/fotolib2/src/test/java/de/k3b/media/MediaUtilTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/PhotoPropertiesUtilTests.java
@@ -34,81 +34,81 @@
import de.k3b.io.ListUtils;
import de.k3b.io.VISIBILITY;
-public class MediaUtilTests {
+public class PhotoPropertiesUtilTests {
@Test
public void shouldCopyAllFields() {
- MediaDTO expected = TestUtil.createTestMediaDTO(1);
- MediaDTO actual = new MediaDTO();
- MediaUtil.copy(actual, expected, true, true);
+ PhotoPropertiesDTO expected = TestUtil.createTestMediaDTO(1);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO();
+ PhotoPropertiesUtil.copy(actual, expected, true, true);
Assert.assertEquals(expected.toString(), actual.toString());
}
@Test
public void shouldDeserializeAllFields() {
- MediaDTO expected = TestUtil.createTestMediaDTO(1);
- MediaAsString src = new MediaAsString().setData(expected);
+ PhotoPropertiesDTO expected = TestUtil.createTestMediaDTO(1);
+ PhotoPropertiesAsString src = new PhotoPropertiesAsString().setData(expected);
String serial = src.toString();
- MediaAsString dest = new MediaAsString().fromString(serial);
+ PhotoPropertiesAsString dest = new PhotoPropertiesAsString().fromString(serial);
- MediaDTO actual = new MediaDTO(dest);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO(dest);
Assert.assertEquals(expected.toString(), actual.toString());
}
@Test
public void shouldCopyAllFieldsMetaApiWrapper() {
- MediaDTO expected = TestUtil.createTestMediaDTO(1);
- MediaDTO actual = new MediaDTO();
- MetaApiWrapper src = new MetaApiWrapper(expected, null);
- MetaApiWrapper dest = new MetaApiWrapper(null, actual);
- MediaUtil.copy(dest, src, true, true);
+ PhotoPropertiesDTO expected = TestUtil.createTestMediaDTO(1);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO();
+ PhotoPropertiesWrapper src = new PhotoPropertiesWrapper(expected, null);
+ PhotoPropertiesWrapper dest = new PhotoPropertiesWrapper(null, actual);
+ PhotoPropertiesUtil.copy(dest, src, true, true);
Assert.assertEquals(expected.toString(), actual.toString());
}
@Test
public void shouldNotThrowMetaApiWrapperReadNull() {
- MediaDTO actual = new MediaDTO();
- MetaApiWrapper src = new MetaApiWrapper(null, null);
- MediaUtil.copy(actual, src, true, true);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO();
+ PhotoPropertiesWrapper src = new PhotoPropertiesWrapper(null, null);
+ PhotoPropertiesUtil.copy(actual, src, true, true);
}
@Test
public void shouldNotThrowMetaApiWrapperWriteNull() {
- MediaDTO actual = new MediaDTO();
- MetaApiWrapper dest = new MetaApiWrapper(null, null);
- MediaUtil.copy(dest, actual, true, true);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO();
+ PhotoPropertiesWrapper dest = new PhotoPropertiesWrapper(null, null);
+ PhotoPropertiesUtil.copy(dest, actual, true, true);
}
@Test
public void shouldCopyAllFieldsMetaApiChainReaderNull2() {
- MediaDTO expected = TestUtil.createTestMediaDTO(1);
- MediaDTO actual = new MediaDTO();
- MetaApiChainReader src = new MetaApiChainReader(null, expected);
- MediaUtil.copy(actual, src, true, true);
+ PhotoPropertiesDTO expected = TestUtil.createTestMediaDTO(1);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO();
+ PhotoPropertiesChainReader src = new PhotoPropertiesChainReader(null, expected);
+ PhotoPropertiesUtil.copy(actual, src, true, true);
Assert.assertEquals(expected.toString(), actual.toString());
}
@Test
public void shouldCopyAllFieldsMetaApiChainReaderEmpty2() {
- MediaDTO expected = TestUtil.createTestMediaDTO(1);
- MediaDTO actual = new MediaDTO();
- MetaApiChainReader src = new MetaApiChainReader(new MediaDTO(), expected);
- MediaUtil.copy(actual, src, true, true);
+ PhotoPropertiesDTO expected = TestUtil.createTestMediaDTO(1);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO();
+ PhotoPropertiesChainReader src = new PhotoPropertiesChainReader(new PhotoPropertiesDTO(), expected);
+ PhotoPropertiesUtil.copy(actual, src, true, true);
Assert.assertEquals(expected.toString(), actual.toString());
}
@Test
public void shouldNotThrowMetaApiChainReaderNullNull() {
- MediaDTO actual = new MediaDTO();
- MetaApiChainReader src = new MetaApiChainReader(null, null);
- MediaUtil.copy(actual, src, true, true);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO();
+ PhotoPropertiesChainReader src = new PhotoPropertiesChainReader(null, null);
+ PhotoPropertiesUtil.copy(actual, src, true, true);
}
@Test
public void shouldFindChanges() {
- IMetaApi item1 = TestUtil.createTestMediaDTO(3);
- IMetaApi item2 = TestUtil.createTestMediaDTO(3);
+ IPhotoProperties item1 = TestUtil.createTestMediaDTO(3);
+ IPhotoProperties item2 = TestUtil.createTestMediaDTO(3);
// 3 changes
item1.setTitle("other title");
@@ -119,19 +119,19 @@ public void shouldFindChanges() {
item1.setDescription(null);
item2.setDescription(null);
- List result = MediaUtil.getChanges(item1, item2);
+ List result = PhotoPropertiesUtil.getChanges(item1, item2);
Assert.assertEquals(ListUtils.toString(result), 4, result.size());
}
@Test
public void shouldFindNonEmpty() {
- IMetaApi item1 = new MediaDTO();
+ IPhotoProperties item1 = new PhotoPropertiesDTO();
// 3 changes
item1.setTitle("some title");
item1.setLatitudeLongitude(99.0,99.0);
- List result = MediaUtil.getChanges(null, item1);
+ List result = PhotoPropertiesUtil.getChanges(null, item1);
Assert.assertEquals(ListUtils.toString(result), 3, result.size());
}
@@ -158,10 +158,10 @@ public void shouldCopyNoOverwrite() {
private void check(String initalSrcValue, String initialDestValue,
boolean allowSetNull, boolean overwriteExisting, String expected) {
- IMetaApi src = new MediaDTO().setTitle(initalSrcValue);
- IMetaApi dest = new MediaDTO().setTitle(initialDestValue);
+ IPhotoProperties src = new PhotoPropertiesDTO().setTitle(initalSrcValue);
+ IPhotoProperties dest = new PhotoPropertiesDTO().setTitle(initialDestValue);
- MediaUtil.copy(dest, src, overwriteExisting, allowSetNull);
+ PhotoPropertiesUtil.copy(dest, src, overwriteExisting, allowSetNull);
Assert.assertEquals("(" + initalSrcValue +
"," + initialDestValue +
")=>" +expected, expected, dest.getTitle());
@@ -184,18 +184,18 @@ public void shouldNotCalculateModifiedPath() {
private void check(String expected, String actual, VISIBILITY visibility) {
Assert.assertEquals(visibility +
- "(" + actual + ")=>" +expected, expected, MediaUtil.getModifiedPath(actual,visibility));
+ "(" + actual + ")=>" +expected, expected, PhotoPropertiesUtil.getModifiedPath(actual,visibility));
}
/***** Integrationtests via file system *********/
- private static final File INDIR = new File(TestUtil.OUTDIR_ROOT, "MediaUtilTests");
+ private static final File INDIR = new File(TestUtil.OUTDIR_ROOT, "PhotoPropertiesUtilTests");
@Test
public void shouldInferAutoprocessingExifDefaultsFromExistingFiles() throws IOException {
File[] jpgFilesToAnalyse = TestUtil.saveTestResourcesIn(INDIR,
TestUtil.TEST_FILE_JPG_WITH_NO_EXIF,
TestUtil.TEST_FILE_JPG_WITH_EXIF);
- MediaAsString result = MediaUtil.inferAutoprocessingExifDefaults(new MediaAsString(),
+ PhotoPropertiesAsString result = PhotoPropertiesUtil.inferAutoprocessingExifDefaults(new PhotoPropertiesAsString(),
jpgFilesToAnalyse);
Assert.assertEquals(
diff --git a/fotolib2/src/test/java/de/k3b/media/MediaXmpSegmentIntegrationTests.java b/fotolib2/src/test/java/de/k3b/media/PhotoPropertiesXmpSegmentIntegrationTests.java
similarity index 77%
rename from fotolib2/src/test/java/de/k3b/media/MediaXmpSegmentIntegrationTests.java
rename to fotolib2/src/test/java/de/k3b/media/PhotoPropertiesXmpSegmentIntegrationTests.java
index f85177d1..30cb0eda 100644
--- a/fotolib2/src/test/java/de/k3b/media/MediaXmpSegmentIntegrationTests.java
+++ b/fotolib2/src/test/java/de/k3b/media/PhotoPropertiesXmpSegmentIntegrationTests.java
@@ -39,19 +39,19 @@
* Created by k3b on 25.04.2017.
*/
-public class MediaXmpSegmentIntegrationTests {
- private static final Logger logger = LoggerFactory.getLogger(MediaXmpSegmentIntegrationTests.class);
+public class PhotoPropertiesXmpSegmentIntegrationTests {
+ private static final Logger logger = LoggerFactory.getLogger(PhotoPropertiesXmpSegmentIntegrationTests.class);
- private IMetaApi sut = null;
+ private IPhotoProperties sut = null;
@BeforeClass
public static void initDirectories() {
LibGlobal.appName = "JUnit";
- LibGlobal.appVersion = "MediaXmpSegmentIntegrationTests";
+ LibGlobal.appVersion = "PhotoPropertiesXmpSegmentIntegrationTests";
}
@Before
public void setup() throws IOException {
- // MediaXmpSegment.DEBUG = true;
+ // PhotoPropertiesXmpSegment.DEBUG = true;
sut = getMeta(TestUtil.TEST_FILE_XMP_WITH_EXIF);
TimeZone.setDefault(DateUtil.UTC);
}
@@ -99,10 +99,10 @@ public void shouldGetRating() {
@Test
public void shouldModifyInMemory() {
- MediaDTO expected = TestUtil.createTestMediaDTO(2);
- MediaUtil.copy(sut, expected, true, true);
- MediaDTO actual = new MediaDTO();
- MediaUtil.copy(actual, sut, true, true);
+ PhotoPropertiesDTO expected = TestUtil.createTestMediaDTO(2);
+ PhotoPropertiesUtil.copy(sut, expected, true, true);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO();
+ PhotoPropertiesUtil.copy(actual, sut, true, true);
Assert.assertEquals(expected.toString(), actual.toString());
logger.info("shouldModifyInMemory " + sut.toString());
@@ -111,19 +111,19 @@ public void shouldModifyInMemory() {
@Test
public void shouldClearInMemory() {
- MediaDTO expected = new MediaDTO();
- MediaUtil.copy(sut, expected, true, true);
- MediaDTO actual = new MediaDTO();
- MediaUtil.copy(actual, sut, true, true);
+ PhotoPropertiesDTO expected = new PhotoPropertiesDTO();
+ PhotoPropertiesUtil.copy(sut, expected, true, true);
+ PhotoPropertiesDTO actual = new PhotoPropertiesDTO();
+ PhotoPropertiesUtil.copy(actual, sut, true, true);
actual.setPath(expected.path);
Assert.assertEquals(expected.toString(), actual.toString());
logger.info("shouldClearInMemory " + sut.toString());
}
- private static IMetaApi getMeta(String fileName) {
+ private static IPhotoProperties getMeta(String fileName) {
InputStream inputStream = TestUtil.getResourceInputStream(fileName);
- MediaXmpSegment xmpContent = new MediaXmpSegment();
+ PhotoPropertiesXmpSegment xmpContent = new PhotoPropertiesXmpSegment();
xmpContent.load(inputStream, "JUnit");
return xmpContent;
}
diff --git a/showexif/src/main/java/de/k3b/ShowExif.java b/showexif/src/main/java/de/k3b/ShowExif.java
index bb75bb83..ed9cb1a8 100644
--- a/showexif/src/main/java/de/k3b/ShowExif.java
+++ b/showexif/src/main/java/de/k3b/ShowExif.java
@@ -21,10 +21,10 @@
import java.io.IOException;
import de.k3b.media.ExifInterfaceEx;
-import de.k3b.media.IMetaApi;
-import de.k3b.media.ImageMetaReader;
-import de.k3b.media.MediaUtil;
-import de.k3b.media.MediaXmpSegment;
+import de.k3b.media.IPhotoProperties;
+import de.k3b.media.PhotoPropertiesImageReader;
+import de.k3b.media.PhotoPropertiesUtil;
+import de.k3b.media.PhotoPropertiesXmpSegment;
/** simple commandline tool to show */
public class ShowExif {
@@ -52,10 +52,10 @@ private static void show(String fileName, boolean debug) {
System.out.println(fileName);
try {
- MediaXmpSegment xmp = MediaXmpSegment.loadXmpSidecarContentOrNull(fileName, dbg_context);
+ PhotoPropertiesXmpSegment xmp = PhotoPropertiesXmpSegment.loadXmpSidecarContentOrNull(fileName, dbg_context);
ExifInterfaceEx exif = new ExifInterfaceEx(fileName, null, xmp, dbg_context);
- ImageMetaReader jpg = new ImageMetaReader().load(fileName, null, xmp, dbg_context);
+ PhotoPropertiesImageReader jpg = new PhotoPropertiesImageReader().load(fileName, null, xmp, dbg_context);
show(jpg, debug);
if (exif.isValidJpgExifFormat()) show(exif, debug);
show(xmp, debug);
@@ -66,10 +66,10 @@ private static void show(String fileName, boolean debug) {
}
- private static void show(IMetaApi item, boolean debug) {
+ private static void show(IPhotoProperties item, boolean debug) {
if (item != null) {
if (debug) System.out.println("######## " + item.getClass().getName() + " #########");
- System.out.println(MediaUtil.toString(item, false, null, MediaUtil.FieldID.path));
+ System.out.println(PhotoPropertiesUtil.toString(item, false, null, PhotoPropertiesUtil.FieldID.path));
if (debug) System.out.println(item.toString());
}
}
From 26e69966a3061cd9a653f24b0bd9fb0641c03868 Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Tue, 2 Apr 2019 12:36:54 +0200
Subject: [PATCH 28/35] #135: added support for mapsforge offline maps "v5
format". Upgrade OsmDroid v0.6.1 and Mapsforge 0.11.0
---
app/build.gradle | 18 ++++++------------
.../osmdroid/forge/MapsForgeSupport.java | 2 +-
.../metadata/android/en-US/changelogs/41.txt | 4 ++--
3 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index 3ba47fef..e2679c2e 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -149,21 +149,15 @@ dependencies {
// this is osmdroid
// https://github.com/osmdroid/osmdroid/ 6.0.3 from 11/2018
- implementation 'org.osmdroid:osmdroid-android:6.0.3'
- implementation ('org.osmdroid:osmdroid-mapsforge:6.0.3')
+ // https://github.com/osmdroid/osmdroid/ 6.1.0 from 03/2019
+ implementation 'org.osmdroid:osmdroid-android:6.1.0'
+ implementation ('org.osmdroid:osmdroid-mapsforge:6.1.0')
//Mapsforge rendering and database support, which is LGPL
- // https://github.com/mapsforge/mapsforge/ 0.10.0 from 8/2018
-
- implementation 'org.mapsforge:mapsforge-map-android:0.8.0'
- implementation 'org.mapsforge:mapsforge-map:0.8.0'
-
- //!!! mapsforge-*:0.10.0 requires osmdroid*:6.0.4 or later because call to
- // !!! org.mapsforge.map.reader.ReadBuffer#setMaximumBufferSize(...) which was removed
- //!!! implementation 'org.mapsforge:mapsforge-map-android:0.10.0'
- //!!! implementation 'org.mapsforge:mapsforge-map:0.10.0'
-
+ implementation 'org.mapsforge:mapsforge-map-android:0.11.0'
+ implementation 'org.mapsforge:mapsforge-map:0.11.0'
+ implementation 'org.mapsforge:mapsforge-themes:0.11.0'
implementation 'org.slf4j:slf4j-api:1.7.7@jar'
implementation 'eu.lp0.slf4j:slf4j-android:1.7.7-1@jar'
diff --git a/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java b/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java
index e7e85cd8..52be0dd1 100644
--- a/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java
+++ b/app/src/main/java/de/k3b/android/osmdroid/forge/MapsForgeSupport.java
@@ -43,7 +43,7 @@ public static void createInstance(Application application) {
// see https://github.com/mapsforge/mapsforge/issues/868
// org.mapsforge:mapsforge-map:0.10.0
// TODO remove, when updgrade to org.mapsforge:mapsforge-map:0.10.0 and org.osmdroid:osmdroid-mapsforge:6.0.4
- ReadBuffer.setMaximumBufferSize(6500000);
+ // ReadBuffer.setMaximumBufferSize(6500000);
}
public static void load(Activity activity, MapView mMap, File mapsForgeDir) {
diff --git a/fastlane/metadata/android/en-US/changelogs/41.txt b/fastlane/metadata/android/en-US/changelogs/41.txt
index 9fd4c994..80f6d6f0 100644
--- a/fastlane/metadata/android/en-US/changelogs/41.txt
+++ b/fastlane/metadata/android/en-US/changelogs/41.txt
@@ -1,7 +1,7 @@
Changes from 0.7.2 to 0.7.3
+* #135: added support for mapsforge offline maps "v5 format"
* #132 improved Autoprocessing-Editor: Long press on Exif-Picker butten "..." : get lat/lon/description/tags from selected photos
* #133: Additional filtercriteria date-last-modified from ... to
-* #21: Translation updates ja, nl
-* upgrade mpasforge offline map support from 0.6 (11/2015) to 0.10 (8/2018)
+* #21: Translation updates ja, nl, ru, pt-br
* Bugfix infer DateTimeTaken from exif-TAG_DATETIME if not available in exif-TAG_DATETIME_ORIGINAL
From e459cf8b75011c03e5b0e1b60cf91312860d8600 Mon Sep 17 00:00:00 2001
From: k3b <1374583+k3b@users.noreply.github.com>
Date: Wed, 3 Apr 2019 14:13:51 +0200
Subject: [PATCH 29/35] DDD ubiquitous language: fixed uml diagrams
---
.../androFotoFinder/media/package-info.java | 53 +++++++++---------
.../java/de/k3b/media/IPhotoProperties.java | 15 ++---
wiki/png/PhotoProperties.png | Bin 0 -> 26392 bytes
wiki/png/android2pc.png | Bin 43110 -> 40247 bytes
wiki/png/pc2android.png | Bin 41806 -> 39310 bytes
5 files changed, 33 insertions(+), 35 deletions(-)
create mode 100644 wiki/png/PhotoProperties.png
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/media/package-info.java b/app/src/main/java/de/k3b/android/androFotoFinder/media/package-info.java
index eb5cda73..d31ba616 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/media/package-info.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/media/package-info.java
@@ -22,11 +22,13 @@
This is sourcecode of uml diagrams using
http://plantuml.com/
+
notation
pc2android.png
@startuml
title Workflow from PC to Android
+
package "PC" {
[Irfanview.exe]
[apmJpg2xmp.cmd]
@@ -34,8 +36,9 @@
package "Folder structure with hires Images" {
[JpegFile hires]
}
- ' [JpegFile hires] --> [TODO:syncPC]
+ ' [JpegFile hires] -down-> [TODO:syncPC]
}
+
package "Android" {
package "Folder structure with 1024er Images" {
[JpegFile 1024]
@@ -44,7 +47,7 @@
}
package "System" {
- [PhotoPropertiesMediaFilesScanner]
+ [MediaScanner]
[MediaDB]
}
@@ -55,23 +58,23 @@
' [TODO:syncAndroid] --> [MediaDB]
}
- [JpegFile hires] -> [Irfanview.exe]
- [Irfanview.exe] -> [JpegFile 1024] : {a}
+ [JpegFile hires] -down-> [Irfanview.exe]
+ [Irfanview.exe] -down-> [JpegFile 1024] : {a}
- [JpegFile hires] -> [apmJpg2xmp.cmd]
- [apmJpg2xmp.cmd] -> [XmpFile] : {b}
+ [JpegFile hires] -down-> [apmJpg2xmp.cmd]
+ [apmJpg2xmp.cmd] -down-> [XmpFile] : {b}
- [JpegFile hires] -> [apm2csv.cmd]
- [apm2csv.cmd] -> [CsvFile] : {c}
+ [JpegFile hires] -down-> [apm2csv.cmd]
+ [apm2csv.cmd] -down-> [CsvFile] : {c}
- [JpegFile 1024] -> [PhotoPropertiesMediaFilesScanner]
- [PhotoPropertiesMediaFilesScanner] -> [MediaDB]
+ [JpegFile 1024] -down-> [MediaScanner]
+ [MediaScanner] -right-> [MediaDB]
- [JpegFile 1024] -> ["A Photo Manager" Scanner]
- [XmpFile] -> ["A Photo Manager" Scanner]
- [CsvFile] -> ["A Photo Manager" Scanner]
- ["A Photo Manager" Scanner] -> [MediaDB]
- [MediaDB] -> ["A Photo Manager" Gallery] : filter path date tags geo
+ [JpegFile 1024] -down-> ["A Photo Manager" Scanner]
+ [XmpFile] -down-> ["A Photo Manager" Scanner]
+ [CsvFile] -down-> ["A Photo Manager" Scanner]
+ ["A Photo Manager" Scanner] -down-> [MediaDB]
+ [MediaDB] -down-> ["A Photo Manager" Gallery] : filter path date tags geo
' [TODO:syncAndroid] <-- [TODO:syncPC] : {c}
@@ -84,9 +87,9 @@
package "Folder structure with hires Images" {
[JpegFile hires]
}
- [apmXmp2jpg.cmd] --> [JpegFile hires]
- [apm*.cmd] --> [JpegFile hires]
- [TODO:syncPC] --> [JpegFile hires]
+ [apmXmp2jpg.cmd] -down-> [JpegFile hires]
+ [apm*.cmd] -down-> [JpegFile hires]
+ [TODO:syncPC] -down-> [JpegFile hires]
}
package "Android" {
package "Folder structure with 1024er Images" {
@@ -98,14 +101,14 @@
[MediaDB]
}
- ["A Photo Manager"] -> [Modfy jpg copy del setGeo ...]
+ ["A Photo Manager"] -right-> [Modfy jpg copy del setGeo ...]
- [Modfy jpg copy del setGeo ...] -> [transactionlog]
- [transactionlog] --> [TODO:syncAndroid]
- [Modfy jpg copy del setGeo ...] --> [aPhotoManager.log.cmd]
- [MediaDB] <- [Modfy jpg copy del setGeo ...]
- [Modfy jpg copy del setGeo ...] -> [JpegFile 1024]
- [Modfy jpg copy del setGeo ...] -> [XmpFile]
+ [Modfy jpg copy del setGeo ...] -right-> [transactionlog]
+ [transactionlog] -down-> [TODO:syncAndroid]
+ [Modfy jpg copy del setGeo ...] -down-> [aPhotoManager.log.cmd]
+ [Modfy jpg copy del setGeo ...] -up-> [MediaDB]
+ [Modfy jpg copy del setGeo ...] -down-> [JpegFile 1024]
+ [Modfy jpg copy del setGeo ...] -down-> [XmpFile]
}
[aPhotoManager.log.cmd] --> [apm*.cmd] : {y}
diff --git a/fotolib2/src/main/java/de/k3b/media/IPhotoProperties.java b/fotolib2/src/main/java/de/k3b/media/IPhotoProperties.java
index 89087dd0..b8f241a0 100644
--- a/fotolib2/src/main/java/de/k3b/media/IPhotoProperties.java
+++ b/fotolib2/src/main/java/de/k3b/media/IPhotoProperties.java
@@ -78,24 +78,19 @@
}
@enduml
-
-
-
-
-
-pc2android.png
+PhotoProperties.png
@startuml
title IPhotoProperties implementation
- [IPhotoProperties] --> [MediaContentValues]
- [IPhotoProperties] --> [MediaCursor]
+ [IPhotoProperties] --> [PhotoPropertiesMediaDBContentValues]
+ [IPhotoProperties] --> [PhotoPropertiesMediaDBCursor]
[IPhotoProperties] --> [ExifInterfaceEx]
[IPhotoProperties] --> [PhotoPropertiesCsvItem]
[PhotoPropertiesDTO] <- [IPhotoProperties]
[IPhotoProperties] --> [PhotoPropertiesXmpSegment]
[IPhotoProperties] -> [PhotoPropertiesWrapper]
- [MediaContentValues] --> [MediaDB]
- [MediaCursor] <-- [MediaDB]
+ [PhotoPropertiesMediaDBContentValues] --> [MediaDB]
+ [PhotoPropertiesMediaDBCursor] <-- [MediaDB]
[AndroidFileCommands44] -> [JPG file]
[ExifInterfaceEx] <-- [JPG file]
diff --git a/wiki/png/PhotoProperties.png b/wiki/png/PhotoProperties.png
new file mode 100644
index 0000000000000000000000000000000000000000..02abed4ce93d56d3b9ef3dde9b757cd3c39c1983
GIT binary patch
literal 26392
zcmZ^~1z48d(l$&9f`rl`pwiu4A|>5%(@3{;hk_so(%s!4-KlgcC3(}`-Fypu_PgJ`
z|M%y3j^n`_xURKk&75=2%(;RTB-Cazux2e5h^FyK5;{(&kuf7Q2db$kQ|BMOG-sXr3Ca9S>V)B-
ztDWScP50axuH?cidFP<}C()^ZW0-b&4;PYX7AMLRlo)9k7^Cl!qQWY!(>p0h8rYMQU0LNWVx5>-idi(2T|ee=p0$7O
z!fh-klHOrBBlPo)`TZpGt)BaS^IM$k&-Bew`=|HB6_=bu`f#&l4fwH-ElDm&xk>^?iErzrO2x@Y{#4|NO{TG%6t>s2?`ej?5Ds21Y>*
z2IfVC&N}pf(ZPJOG$kY?Br`L!sK_#9hAY|+3B!4Jx>}fu^1?_nmN0GjYrP%;lgW-&q*{2&uf)B7
zU|=9RE^hxFIwgA#D-G^%%L%K>XcMelfUCUil^h0m;E1MtE#Cv
zA1t&leh+ln`E9q-6M@I5ou8low8FWfq5>NSXLD@BJkUab6qR)l}G^U;+)IL#?McmJ~@#{
zzmH|AqyCl2VPnVdv=tp*Ewc5gaq@I~Qt1B1VNarg(ST9;;u!nxb4RpDbys71i`Vs5
z2#T!i;B>8TWJsAh1X=m?f2~r}SXD&@8ylOPiAkOg2M5Qk_Hr?hw4KjA%v+TgycF%3hBUdd^u{;3
z?EkXw{z@FjpcNYvk-M;*;7zsu*uiDWCeBkT5YVO`bJU@N6I2D#sN`
zo)tz&NciZ{BMJ%%IXStLa`iIZ(<|-x!gUuA2!F!l^-W(PXSBS7E!A@IqPL8sWJcKT
zOzpbo%1wHEO3U!nRD$4Fe3s0iDvkKiPdo%l+Gw<+eSN{l5u90JS>mBfp5!!dNDU1Q
zc}TIauz2dZTMdzWjvnE0n2o%+x)_xg+T7TPj)~#OcYgEcjTsLUQ`j-ft5+WdBOhn1
za#~M6c1Y+*%R7+3&VBCV<1-{7r)WJ>Q!*O*{O0C{gx~d>o3m
zd&kk-xS{xn8uZaHFyOq`nJtTqiprBq(QK@8_hOV8KjwP?gFjf}ZA@`skb9Om#v`{dJlGazE2LuG5Z2AWTU`6A=z`TaQ!uYPx(hbqWVNuF_
z4hkv|`0{$D#(LAx-MxXC=!-LJM>LP!k|<}=EkGu_<*vh_{#wgP#vyjp^73*50)jXu
zz1%Q+d;6QOs>}ASTu-&5i;L;K#>U4P7#ON6Dl%6;z#|3g{Cgo|PED2;brEc>(Bt*t
zFJHdg-rh<+Mft69@!RiV(+|7XkF1cAk=dE4W!h&jh^BVXvnD4a6S2HH*(4k2%1jAi
zHnz97K?gWK)YrGPr)4<3hfd7<-siHwtC%p3%oXwdd}fU;RCl?n9*auu^Z)1FmZ~ihjEHu`*>z
z0=L~O>-6H{foq0CV3i!{xU-F)enSpjAp{@>;T|kuVf7+Ce`m)EQ$5Y|2)Q>**bk9d
z&@5?*lpQ#9UDqoGm=4)OHM)h8B~vp;Wt
z8&nZoSDLt%4R2T~mS4nax)$myeB1HVH}}QWl@eTZM8pU1=1gycNP@pF&t8$BZ4bEDU}L}j$!jO3rIpnA
zP7w|pA3r`i+W)_PRTOgQ@h0W?8!IMFfQis>n4b694gtmM+}zyM)Kn`@B3QpGvD*%E
zw*T4mQXH)vq9VBx>Y%sdaG}y!7I2rmy!C~Jr#LvD{`2AK#ri!>4;ICLhw;bHqjA>P
zNKfziGln>3Z~S(U{yrQW%tK&4PI|le!O2MI!BAUxh{lf|4(zofIF!+p+j?BLWz|#i
zey-9(!J4m7CyzAbj2I7;lPqY-BFIqxX!bHbrd@^^VeqBXY>#m%6k(MTIMi0Qd@-vYz4OGtCmq**U!UabH10N
zS+As9MJ^J*`{;S8Tk#>XT`1;THK)yALF(FvdCay788N-Z?jZFrxgx@1$kR$_cD4!-MK;xBx
zS(lR{(3k~4t*Rf`Ejs3MoUx`$@+eg%<@y)J=%-rC^TXfeS@}=B-SAB--AAkG)X#Jq
zsv5ic0x^b1j8PJ9%>>S89yc1_?_UA;fK(%JeY8x&DFLQ?>JDo%pMzNoUXqmR@TKQE=cl(t
z$%q->=gRg~f59|Knhw;em7@`Yk}(cRy+_vb;^1c=^R3Bdw}iHEB%dZG;@w|upLe_|
zJ8|rm2pjrkpVE1h3geOhZAqRjZ@Q^YP3`N65J9*JY&`3mwrsh!aeVX9DKv(KWew`d
zri5>t!?qo#o|4zPrE#m}FV{$eIA{7rU5!H*^3rt+Ep=_cMpApzB~h1{!J3k&pOJZs
zZP;{F>|yt+@2h_ug}qtyM>@mti+*Q^yYHDgGGc`H0
z-QH#t>v|;|_Fume^S!s_&iEvk!aF9XfM7+o@P1YYAuc>-wFAOPbGSL*OlMlJUbff7
zb#`DgtYwt~!EW`Uq00;dXK^%;u&b@kE)MyLJgEWE*ibF2xS~3~+cQl$Q|6|rXbDLc
z-mi~5NW%G;C)_@oJjL)S&>(E8!MbQX+9t37QODG+n0G3jfL@{GjapI5UA3N%j_?yY
z^*$|#`3M|x$!h=l&yJy#{>>TQFzL0uyOWbm>#E6vML)MB)s(o=p8s*o;#LUqUGR0e
zL|Ex8Y!aetU!a98(*Wm3461Yln51gj{n=^_h=o6LS>IAH(
zU9Qi|%x~s=t8M#(LaVWlY}$NMD>duo^R8u5II&I}hS)a*B{EYh-yDn)@ejt%Dd}&x
zruPueB+zR20|ppQtad{aH4RpNM}m=$1e^JHa5RbgSOOmF|jGc1BE@BpQga9HD4
z?fHJ%(UJR*iPiyU5ie6-L>%%zNdPlu{2c1j?jeuvGW2eK_tTX4!6HKR!rGZXoirla
zRyTx%YwyXBAKEJ;#hbI$>FvpBxE23!HVy4Y=Y^dqVh%MyAMeevf)cbrZ~Ec6cV0E|
zYJ`pnG%p?CUjgSyUF)?eGFI*0qAIrPvVB{Ah+FTiSkj@s{qd1yovaldc>Y6ILI}A7)HWTNE5T8Hi!KF<#`cKQG{Y=O%d0kgz_qyE9Sp#I(!E`|p0t
z%ykHvUk6wLyqcXcG`n8z=IZS^$;Q&CGBZ(%w0^)V@_n4~`m(${N@M=rX|Dmk_NoQ0
zM^BvTjTKFYtVmgwu!fR8hLOz0M=ekE?BtP?@x9qKw&6~C)>jyVB(H2*i;aklijDcM
z0A!zo@x*X_9mB5AJ#P&)zw;5Bg)TSL@!wr-KhtS&%!J##`EP%J9>iK%95g>c+dE-3
z6{dn1vVw%Mh3EB=Ic^mDUv32`LLW*3S2WHR-otl)a#)mNY>GrL*5s=)^{~W4q6sYK5(uO^^6FE?N5CY&AB?C7DRCSLeET*LeGu
zsrJQMX!$qLV$%FKtH~D))+_u$AR6&NP}16^z)|W>
zGM?juEl%o+&ixW;V{fIHu~5JFJPBHQl0&SCG_)-++L83}U+V_!4>R!=o5GYFpBIs&
z$$-oFi|{0bb9v%=Up3UrT<2+&zi-6nt2x)5&R+s$UG$@y?1TC%n1QExOQ$MM1(XY9c9$|@Mq;yGf`Uv
z_)6Az(|9>WSe<6}ZlA||9n?$Qqq1pW;CVNuHMDeWESSX9#m~_nCiglJCd$9%(O>eS
zs>Zze&Al?Mu&-|?J^vgd^wwFonxIyj0LY?E8Z0I}%!2
zGh<_8qoYxSCdxSLVn4cCs?dLz*$6q&NzxSAs(IM*lR8OrjdB%d)>U1?i(Aed#zE;P
zH~DW@SDc1@_+|zeGoP0iU}RKZSDpRF;ngv1ik>;T>FLZZg%V=_Adiqcn{%IfcY^X=
z*S_=%`lli@uLE~wh}u_l*oo|a3XmIVef@MlKlm@5nTyI;%vgndS%HbM>$X#O_S5cN
zoZnL&1|=9zH7-5;8=M=YU%PoLK0zEfJ}#VIR^L8JzI}ITJG?Jo_3S>p!Xg!3pw(W-
zV|KXgYH)PgP3d^w=j=<7ckkkgv%R;HQse>(tz5qp^Ly0ac_wT&&BC=1IR}?dsUGoL
z3+jp*A?UE|<~x6B_O7Uy*yYvLuQqcFi$Wy)ABM7XhCUmm{OQNvE#^`kPOf{C2Itq@
z-*UVe&ZXy*$Al9>pJwtM#Uz~G?u
zp>KJEWA{SQ>Xitt=5xjJ+Hz~VNwBIrKh4zo3?Yr5W*xjqflNdY?D~eoQ!Pd9#JwF-
z=fm>jo966_;#QsI)^*LMQXNHmL|%lEe~v4?`n8|2xHw{Hq7^3}%3I85!nSZ#gR^q8
zRgeoJ%lHcK^C?_qP9AH4eUJ53A}aZLhJw9(!~&86PH8DAO%VC6hLiuhlS5G_2)SISnZGwfPL(Sy6XO)exGg
z^ihI(Y;3bnTPDJs!P-|NI(bPx0VOpC*OQ~B4z9fYC|_hj=R8TP}#DAy>ePf@J8?QoOpZz=!xv9}Bzq8Rf_1qA$I)Ij79{-L$nl9{<>TUHu
z`k49H$y%yg2alxZJx1g}loiCdGlP2-e!RlY=hNfrIC4>nnm3j*Y#X_r)Hl;#Fy=E<
zS8>d~{q4TMM7~k&gqFp+8@)N|b-oe59b$Vph|0@%W5l<`lZ%nb?IaA5Kx+=w@>di2_Uu!|cPFbpnf(_TWYvQuy%RB1@z$`^6#l%dt@4rh;yxdo#`88CgscXFY1s
zVtR5}YCuh=`%4FYm(sT8(mR*G$cl
zLX*c}-WM#=l-k_6-mi_jljUomhOdGhlg)D(sO!4IZYzJv?guS7h89W1DJLfetzrD_
z!MxzDH()7eDt>GATfWTOGQ4vGC$&gUtu<$Is+GS?!D1zIa+&<90T-H1&r!i=j9>qCRcS=_AHYn%EX-X^+F{c8K*
z{yN+kT~5c8U6~a;hPF$5{rB{1tK$f10k!1x71qH+Cy335Xq_FTeFdq+P$cSrA~O~h
zYN_IirPnN2_D7`=A)Y<^J}d&>_HQzw<{KWRyymQLdrzWB1=Q2r&*OyUHar{&|2d~|
zfb-qkQ%EEYo80T_-$@(>0`FH^cJOIJRrpAIlO?q1N5**u=Zrb6SXTRDC~^jxpCYTP
zJrBkl_2SfHkJWkVBwbrktc|inCB*x3t$;u$`m!fS+-t3#fd@0=jCFM1T2+jq0sF6u
zSK%H(sVMQe5s6zi*=@rNn0P8P`u3#5nwtv~-tDR;#!#)|>8Zx_*w>^Sd|6c&s!Y?8
zYImFoQBZqs{|4Gfy+=iZS!PKk%c2^cEUdoLx}JDiYl+%0XrJ23wX?MB80QP3^d5B1
z9^&aO)}wM7ug0*Rgg;T?TK|e6?>GVIv;MJsc(rr?ex6%QzvDJl2RWsFMf;Q2QESrHXJPjv_9
z;N=I6&>A{ECp?V>H06Ml#&}CJId{}SSHKl0n-
zJ5S|s?6)hLIwn3`HxVkj7jG;`9wGd*6X}9)@xS9H#`j|qtB;|*Bln)V0)BcXj5o>>
z0fadFji-Q8c>)ybq#@PpRh15`SPEYyU1WEOTaBZOlF`vJMaApNQz|;2aU0*-Rvp{Y
zi9Tz+U4{fmyf-!{AmoPm(|hx$SeJDyjx}!ccDml2xpNcSKUxON@$I=s&W|_F3enwt
z(9ml-|5Tr`X`?)L8anjeSQ0fuHNJuAgiWG}#Ha%i!Tj8La^6yZ8Hj2
z0$gT$fE)O;D%aQGzWDB3N;LwbOOzy4RZNgtzqnbfwW^QX9GToQvN5!3O9qiieq^V*ub73a%NHisa^oGCH4wDl
zyhbXX@GOf~p`}B|`P6BEM_PF`gu(xw*rm-L_`a+Q8fxRs7-W&lZ?CeX1+v?!MIqN+
zLrnue1pCK&+3c{ibi*j0)0@(cNM;U+PWgtv5mruH?k4nXmr=8HB#DS&=f}hxUZDd*
zt>x25xff$?nY5d(3JgiH2`O_a0Eh2?f0-=$DDidZTKFk%aszfPg+z$a%Af@O>6GKk
zwIIk{BLX+lpVXw!jMJHu;BA|=w{dOV`tJDFJyI$9_WH*DO`S!)J6qJL@5^@{Y8;t=V(~1
z(W|)GeAg2BmL4TM)*L1rk~F}Cw=PAZP*dYaqWUIAhkX20LOVywhEtCK)EZw(w7o3R
zhS+_cboqASnb7~y>(?#18H-YKqNLoD3)#V|MkmBM6Q02tEcZpl#3-S=YxqBK%1)Y-
zP){?VyGW}^(jTT3qA4dCbURiOo&E#V7wF!Bfu4!XcryJcf~DF`
z{QTuh!j%S4Hg>31Y2y*I?ogOsc1l65)qf8&9756lWO837w`b*t?q|Y*w!HoOETH{p
z6dnmq5&%6pVWUDY;(gU)$lWt=G=L&JZoI*^l?*UJK(t%k@k&06q=N@@wJ>lSOY
zryCi8hF48*E_Vm=Mj|={+f5m1cvJ+!5eahq_Ws0_{LEQ98^ZikJU7KdmM~c_@A}s%
zR7Lxq=V@QX0gqZGRa6Z^l7)R3D!kJs%nhyzD!PxB$&nW@4wa(gNzVIX-PMa&
ziqIN{ofT*A&-yA+YhN_|Ab8l3FS|mjUi2c#k833wu*6HN7JMh^bH7QVrZn}XqxoQ|
zz5zg74cTnGnp)uRcF~N-u@y4!&k8Av(mn#$xG--Bq8{v%W_L#Bcm3|%!SvwM1JeZd
zTe`uaT&KPNgiiqKI&kV5!Dod`{AzbLAQu9pv!=4iyxF{kSBn+WrKM=^wJ|3cj{vL&
zoy`ScUI%bD*?D!(9^~J7U0Zw)ku_^MogJR|N>;2d_ynhb{+DKU-CLK4tB($Uhi6a4
zBng5jOEcC}tr48?fP4|y2-}wNJ1EZDj(F7oHeKd(%O*F2XiEbBr$qy|BGyIm
zz^+uV-B*%Y8=@_7xm>?bbyRP*k$VQcZnF~*;i(+4mQjHm`p@T|%
z`TWQry7@Uf$=?6Lv_zAQRT*fW`Ll0&DN3XdTrq$l
z*MJ)^FLLF{rD%-z*FrpYVE)z7?N$*)}#(R8YfwlNnUBibt2S;%xdzw2f#`eoxE!
z#48pM<%iJ5P&m=Bd$mlmfHJQgX@jL$Z|7S^M;N|PmQPC%)geAja4^Kq?TVjfF|>OJaduM?o;;7W<9d+;@K~
z@B$go4cMp;1SJZnoEMEz8RR70)jnnzwh3}1*=?f%=9$>|#e!r6k{9AyzBgYVnz;_IK}TP9=zQ6c^IN=}JN51e5;&X358<{0jv5
zZcrm>}S>qZS<75dIdIp*0_)emaIOuOKj}7`n}{rc;%`^9gTz4i)PwL
zL&|z>CAlMQ=_-<$PfaW7a)!}-&;#+tD4^dix4bYKDr9OOi;}|
z+EI3hFHd1x_XqIIeh1nKxD>{1VkIvg7h*z&YOuV^Z?;U&9Hej1k&QbYf9b&OP+C_I
zx3UcOlFo+@*insg(Z4zUG_&*_pf|ms-df`-=5>PG-L)t;(nAL@UewL|C(>|u{){`Q
z3THf9Til0&K%=OHhd84&Wosdjhe}h+TSO@s0jHN1Q{6QUKRSl}S)QS#;Jbn^zwSV7
zeGot%bxe7c640_<7zJogEqqYO&DkTjwy}K#%yh?e
z4dgXV&z6Dw+GMaPaBOT|-wSCE-kJRwry`@giv(t|m4mt{3mUPyW&l3jmkNryFfW4`
zEKD8Mpu+-H<^N&sO0l3^2k{>>2HKjWo^QUt6&G9?YX*di+n)wI&-3$SZAR*yrZjem+fJJii6Z5EyU6;qg8YVpHTI?Wl8YF|5}f)22QPtgskd@fU5R
z|807BS>Y<+;p&&6f{mNUdjUFP8|1Y~pvI{?1#A`*_4$|4iiPJ72Fphp@>3#Dek&O9
zxzL+uAA{(jGs5)3@i}nED$QJN*a!z!|MHVAzuQo#_Qx&Z16Uql05HJ{Nd}>wmGSX7
zJsOy-h&1|F#Q@+k1|*L~{x@w`NlbVW`1S=jTri&BR#B@;ZTa*iF}(1hfE#B@(D2mw
z_Bm%BfBv0JE8Y#`)>lC%F91q1f%He34!l>TFDU~NfB~y=4{!Imq{`D0fSFw4t4F`B
zYZGFaee-cx^M2J&aPJCVEm?ksd0-vj5e_l|rC&7YMjuAyk}F518jqQhsB7EBs5X@n
z17yF#WwfxMmF|DrPWVvSd4Gb2HI!?{jtPBN4g!INduh`Mx6V!kP*qsMmZ-O69h|%QZ(qWS@(Ab|twZR`sObZ2A6yrWtapHc
z=~WF21#t58H}iLg171@sUljY%8ip!T4xTt2M!#7MRZ183Jb28x!&4h@Q(9OYGU@Un
zMov;>mQL$NB32S-i{Q=2U?l;mBeM@z2q~OVJ@(Lw#blFQX2wpBWw&M6;C*%rIg$--
zkG#u+v~Y3h&~Q0cCp2FB?KE>lfX{*%5mq#P?0%rS6}E>56vRL01!b?{rQJNzOMm}{
zX;&S-tvVg-b5Pt+IY7QKZ5#}Ooy{JgiDLBpHUf<_e)YQ{9g#~tV0_?gJGoXF+OUl8
zUge5JJMqb|Z81pnNr9;?*i-@3S4%T^XTfC%rBzj)B!9n6hv0hlqeZvnp!tPF-+~O=
z#o7*hUVWozyves0oS(+!7jNNl`H=yBJ^ej{8{=BWCoPc6ToKGU1X`C~lOsO0!Mi_X
z!36bZ{!Yt|#_!cUNfR5fUV;NEGyYY#PhGcb%I@6>gCUuWN4Z}&!^Hp%%mpeSp#h4u
zAoJ5c@y!tE#w!pu-OU~!)gIMPt
z$X(sj&nbn$QblFzKQFA0dc%x)F3G1ujq&Q31Y%c7Vb|Zng7LlbYUGscw9)CH1-B@x
zrj9B|QJ}(CNKGNaHRLlOlYm*?D^r6rO%xtZlLy@Z*4q^c!aXpgP`D=E1}q7eEN-hh
z&4N_{xf~Xl>;eP$C&03w2L+P`gk{BjK5^mt8~FA|HmB?xe$j<_!fDNH`mMZLqp$d=
z3k#dzO5tTu9;MnONjB`}at}>){wZhNns(kMKIXMg$||;^vI%zks3%7Lx$jp6C{aU<
z@wjE6xiij~2~*!XFPt)~BS=%89*+%}9*cb$jw3jYEdnjlUE^F^eA5&8nj?1Nrf<9s
z8{7g{sn2E~lt1}vAX({ln~!s?RHZz>ZQHmdi}HnnD&LlEhou{ooM54*r22%8Bd^SB
z_qwC*hnlEBrPF$Q?6$kv4^ugM9;wuPrc7hZMUXGr|NgV6iWJ06?yX}}s@KAY?Fnef
z=r(gqmbWGU_G3*V(CDD1y*V#bQc;m-qi&@-=^zUvm;rUU4lxOFUew;lGsJfaY7az7
z?v5EBi$QLt%kziQTul^rFP(Au+IJt&Y@75suYP-~9+Yb%>o{AHe3NUFZx%08yI@Fo
z&s22BqI3r=r{R6-Fv1dQ^h91erS)-umUJygtC_OA9ErQ$#g8&+Zf~6>2M56A|V>a=KO97X)4$%w+g&`PtlC7
z>~w!GB!8x?-o43h6-*`$q-^WH9|Dl0*hR4Ntrcs>6zot7>&U;XoAs3N|9+P`Z_qpN
z)0|DRwcqjf>nLi&(6_rasiz4QRWwv$JPswT-C0sd03r
zBd0GZ*fCQgY6&O9uOddjOi$Eb3SJMh;6K1~YjzLp*)FW2nv|*(SdhXG(Ssl5%QLaC
z*jiXv*xr`5rY93Y-NzRH?w^7D@SH#93xOQoL@;CAEVjxr$NM7YIxPj))Nq2q87J-^
zLERX?{8FYt#|VPLqkL}sk7(_PQOT}%Zx7&olGm%A#y$Ma+0DhO>2Rtd5gP}`>B)&v
z<&^9#IU^w@sw|8w3=WdWx0k>5BXNgGky{vIDutFX5wS*IKWOXVNB_(T9p1nH92{)1
zb=~=s*}x3$!CZgeQ{@^^@v)s*zfJ$I2~pb-{emR_Op8AVl`ht*;1@qaLS>i1PlQQ?
zp+yhS7x~tXpIdxzLyAiI0Uq%`7Z9ST27qUC=uZ1f(_x|eP#@8xYZ}~-bZ
z#E^o#ycm5cmNj%%yB5e%aPd4QFKU1;Zo<@vdwjcSA}S@_Ak(1c2;nxXA-{GaA0_`)
zSJ=H&JRx?5{4#?c{X}}dD3l_`E3S?gVecmqn+BU4