PhotosGetExif() public method

Gets the EXIF data for a given Photo ID.
public PhotosGetExif ( string photoId ) : ExifPhoto
photoId string The Photo ID of the photo to return the EXIF data for.
return ExifPhoto
コード例 #1
0
        public async Task <string> GetMetadata(string path)
        {
            string photoId = path.Split('/')[1];

            var info     = _flickr.PhotosGetInfo(photoId);
            var exif     = _flickr.PhotosGetExif(photoId);
            var contexts = _flickr.PhotosGetAllContexts(photoId);

            JObject j = new JObject();

            j.Add("DateLastUpdated", info.DateLastUpdated);
            j.Add("DatePosted", info.DatePosted);
            j.Add("DateTaken", info.DateTaken);
            j.Add("DateUploaded", info.DateUploaded);
            j.Add("Description", info.Description);
            j.Add("HasPeople", info.HasPeople);
            j.Add("IsPublic", info.IsPublic);
            j.Add("License", info.License.ToString());
            j.Add("Latitude", info.Location?.Latitude);
            j.Add("Longitude", info.Location?.Longitude);
            j.Add("Title", info.Title);
            j.Add("IsFamily", info.IsFamily);
            j.Add("IsFavorite", info.IsFavorite);
            j.Add("IsFriend", info.IsFriend);
            j.Add("Rotation", info.Rotation);
            j.Add("WebUrl", info.WebUrl);
            j.Add("Media", Enum.GetName(typeof(MediaType), info.Media));
            j.Add("SafetyLevel", Enum.GetName(typeof(SafetyLevel), info.SafetyLevel));
            j.Add("Tags", new JArray(info.Tags.Select(t => t.TagText).ToArray()));
            j.Add("Urls", new JArray(info.Urls.Select(t => t.Url).ToArray()));
            j.Add("Notes", new JArray(info.Notes.Select(t => t.NoteText).ToArray()));
            j.Add("ViewCount", info.ViewCount);

            j.Add("Groups", new JArray(contexts.Groups.Select(t => t.Title).ToArray()));
            j.Add("Sets", new JArray(contexts.Sets.Select(t => t.Title).ToArray()));


            exif.ToList().ForEach(e =>
            {
                j.Add(e.TagSpace + "." + e.Tag, e.CleanOrRaw);
            });

            return(await Task.FromResult(j.ToString()));
        }