Skip to content

Commit

Permalink
Merge pull request #52 from Urmel/development
Browse files Browse the repository at this point in the history
Use ExifToolWrapper with stayopen for parsing DirContents
  • Loading branch information
nemethviktor authored Jan 21, 2023
2 parents cc22f80 + 6ab27b1 commit 5cde6c4
Show file tree
Hide file tree
Showing 14 changed files with 1,849 additions and 587 deletions.
48 changes: 48 additions & 0 deletions AncillaryListsArrays.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Windows.Forms;

namespace GeoTagNinja;

Expand Down Expand Up @@ -763,6 +765,52 @@ internal static string[] AllCompatibleExtensions()
return result;
}

/// <summary>
/// Extracts only the file name extensions from the list of
/// AllCompatibleExtensions. The returned array is a copy and
/// can be used freely.
/// </summary>
/// <returns>An array of file extensions supported</returns>
internal static string[] AllCompatibleExtensionsExt()
{
string[] allowedExtensions = AllCompatibleExtensions();

// List contains the extension at then beginning and
// after white space more description --> loop
// to get only the extensions
for (int i = 0; i < allowedExtensions.Length; i++)
allowedExtensions[i] = allowedExtensions[i].Split('\t').FirstOrDefault();
return allowedExtensions;
}


/// <summary>
/// List of supported side car file extensions.
///
/// The extension must be in lower case due to its use in comparisons!
///
/// Dictionary Extension -> Description
/// </summary>
internal static IDictionary<string,string> SideCarExtensions()
{
IDictionary<string, string> result = new Dictionary<string, string>()
{
{ "xmp", "XMP SideCar File" }
};
return result;
}


/// <summary>
/// Returns an array of extensions (string) of compatible side car files.
///
/// The returned array is a copy and can be used freely.
/// </summary>
internal static string[] GetSideCarExtensionsArray()
{
return SideCarExtensions().Keys.ToArray();
}

internal static string[] GpxExtensions()
{
string[] result =
Expand Down
Loading

0 comments on commit 5cde6c4

Please sign in to comment.