private async Task AddGeneratedTagsToPhoto(StorageFile photo) { JpgMetadataAdapter jpeg = new JpgMetadataAdapter(photo); using (FileStream stream = new FileStream(photo.Path, FileMode.Open, FileAccess.Read, FileShare.None, bufferSize: 4096, useAsync: true)) { IEnumerable <string> tags = await visionService.GenerateTagsAsync(stream); await jpeg.SaveTags(tags); } }
private async Task AddGeneratedTitleToPhoto(StorageFile photo) { JpgMetadataAdapter jpeg = new JpgMetadataAdapter(photo); using (FileStream stream = new FileStream(photo.Path, FileMode.Open, FileAccess.Read, FileShare.None, bufferSize: 4096, useAsync: true)) { jpeg.MetaData.Title = await visionService.GenerateDescriptionAsnyc(stream); await jpeg.SaveAsync(); } }