I used https://www.nuget.org/packages/ExifLib.PCL/ library, before update.
I'm not able to use this library now :
Could not install package 'ExifLib.PCL 1.0.1'. You are trying to install this package into a project that targets 'Xamarin.Mac,Version=v2.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Any alternative ?
I use Exif library to get image taken date:
using (var stream = File.Open (filePath, FileMode.Open)) {
var ein=new CGImagePropertiesExif ();
var jpegInfo = ExifReader.ReadJpeg (stream);
if (jpegInfo.DateTimeOriginal != null) {
takenDate = DateTime.ParseExact (jpegInfo.DateTimeOriginal, "yyyy:MM:dd HH:mm:ss", null);
}
}
this code terminates application , also can't seen any exceptions :(
if I just mock datetime , like this:
static DateTime GetMyImageTakenDate (NSUrl url)
{
DateTime takenDate = DateTime.Today;
using (var stream = File.Open (url.Path, FileMode.Open)) {
takenDate = DateTime.ParseExact (DateTime.Now.ToString ("yyyy:MM:dd HH:mm:ss"), "yyyy:MM:dd HH:mm:ss", null);
}
return takenDate;
}
application works fine :/