DateTakenExtractor 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package DateTakenExtractor --version 1.0.2                
NuGet\Install-Package DateTakenExtractor -Version 1.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DateTakenExtractor" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DateTakenExtractor --version 1.0.2                
#r "nuget: DateTakenExtractor, 1.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DateTakenExtractor as a Cake Addin
#addin nuget:?package=DateTakenExtractor&version=1.0.2

// Install DateTakenExtractor as a Cake Tool
#tool nuget:?package=DateTakenExtractor&version=1.0.2                

DateTakenExtractor

DateTakenExtractor NuGet version DateTakenExtractor Nuget download count

DateTakenExtractor (DTE) is a small, fast, simple library for extracting Date Taken metadata from photos and videos, with the library consisting of only a single static C# class.

This library came into existence because two separate projects of mine used the same classes/packages for finding this data, and trying to keep those two files the same was annoying and difficult. I also wanted to redo the class used in those two projects to be smaller, simpler, and better.

This library uses MetadataExtractor for reading metadata from files, and is essentially a greatly simplified wrapper around it meant for reading exclusively Date Taken metadata.

Installing DateTakenExtractor

The easiest way to use this library is via its NuGet package.

Either add this to your project file

<ItemGroup>
    <PackageReference Include="DateTakenExtractor" Version="1.0.0"/>
</ItemGroup>

Or type this in Visual Studio's Package Manager Console:

PM> Install-Package DateTakenExtractor

Or search for DateTakenExtractor in the NuGet Package Manager in Visual Studio or JetBrains Rider.

Using DateTakenExtractor

DateTakenExtractor is very simple to use. The class contains four public methods for your use.

//First checks the metadata, then the filename, for the Date Taken (DT) data.
DateTime? autoResult = DateTakenExtractor.GetDateTakenAuto("C:/yourfilehere.jpg", out DateTakenSrc dateTakenSrc);

//Checks only the metadata of the file for DT data.
DateTime? metadataResult = DateTakenExtractor.GetDateTakenFromMetadata("C:/yourfilehere.jpg");

//Checks only the filename of the file for DT data. Notice the timestamp pattern ↓ in the filename
DateTime? filenameResult = DateTakenExtractor.GetDateTakenFromFilename("C:/IMG_20210320_175909.jpg");

//Attempt to get DT data from both the metadata AND the filename.
DateTakenExtractor.GetDateTakenFromBoth("C:/IMG_20210320_175909.jpg", out DateTime? metadataDT, out DateTime? filenameDT);

Date Taken metadata can come from two locations: the file's actual internal metadata, or its filename. If a DTE method can't find metadata in the metadata or the filename, the return value/out parameter is set to null.

Contributing to DateTakenExtractor

To contribute to DateTakenExtractor, follow these steps:

  1. Fork this repository.
  2. Create a branch: git checkout -b <branch_name>.
  3. Make your changes and commit them: git commit -m '<commit_message>'
  4. Push to the original branch: git push origin DateTakenExtractor/<location>
  5. Create the pull request.

Alternatively see the GitHub documentation on creating a pull request.

Feel free to either email me or contribute if you spot a bug 🐛 or have a feature idea 💡.

Contact

If you want to contact me you can reach me at ellduc4@gmail.com

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.1 127 9/4/2024
1.2.0 509 7/14/2023
1.1.4 606 1/5/2023
1.1.3 699 7/12/2022
1.1.2 630 6/10/2022
1.1.1 649 6/5/2022
1.1.0 634 6/5/2022
1.0.2 623 5/24/2022
1.0.1 631 5/23/2022
1.0.0 696 5/23/2022

Method to get metadata for some reason had the potential to analyze a filename if it deemed necessary. Removed this as it caused problems and that method is meant only for analyzing internal metadata.