Mediaplugin: Missing image metadata(EXIF, TIFF, GPS ) when trying to pick multiple photos on IOS

Created on 2 Oct 2019  路  7Comments  路  Source: jamesmontemagno/MediaPlugin

Metadata is missing when trying to pick multiple photos on IOS. For multiple photos I saw that you are using GetPictureMediaFile from ELCImagePickerViewController but GetPictureMediaFile doesn't import MetaData from the original photo

Most helpful comment

@jamesmontemagno and @clintonrocksmith -> @jamesmontemagno I have found the solution for this. I have provided part of my test program where I have used CiContext

using (var ciImage = CIImage.FromData(UIImage.FromFile(newFilePath).AsJPEG())) {
using (var newImageSource = ciImage.CreateBySettingProperties(originalMetaData.Dictionary)) {
             using (var ciContext = new CIContext()) {
                        var saveSuccessful = ciContext.WriteJpegRepresentation(newImageSource, NSUrl.FromFilename(newFilePath),
                            CGColorSpace.CreateSrgb(),
                            new NSDictionary(), out var error);
                    }
}
}

@jamesmontemagno If you can fix the metadata issue for iOS 13.2 using above method or any better method, that will be good.

Maybe try using ciContext for saving metadata copied from the original photos. CiContext has capability to save all types of image formats.

We really need iOS 13.2 images alongwith MetaData.

Can you fix meta data for me? This is effecting my clients.``

All 7 comments

@jamesmontemagno
We are experiencing this issue also.

This is happening with iOS13.2 for us

@jamesmontemagno and @clintonrocksmith -> @jamesmontemagno I have found the solution for this. I have provided part of my test program where I have used CiContext

using (var ciImage = CIImage.FromData(UIImage.FromFile(newFilePath).AsJPEG())) {
using (var newImageSource = ciImage.CreateBySettingProperties(originalMetaData.Dictionary)) {
             using (var ciContext = new CIContext()) {
                        var saveSuccessful = ciContext.WriteJpegRepresentation(newImageSource, NSUrl.FromFilename(newFilePath),
                            CGColorSpace.CreateSrgb(),
                            new NSDictionary(), out var error);
                    }
}
}

@jamesmontemagno If you can fix the metadata issue for iOS 13.2 using above method or any better method, that will be good.

Maybe try using ciContext for saving metadata copied from the original photos. CiContext has capability to save all types of image formats.

We really need iOS 13.2 images alongwith MetaData.

Can you fix meta data for me? This is effecting my clients.``

Same thing happening with iOS 13.2 in our app. No EXIF data saved.

Similar problem here with iOS 13.2 and plugin version 4.0.1.5
EXIF Data is missing on images saved using the plugin.

@ManbirSinghRakhra you're a lifesaver, your code fixes this issue

https://github.com/jamesmontemagno/MediaPlugin/issues/760

@ManbirSinghRakhra and @MatthewKapteyn I owe you both some $$$ for the bounty can you email me?

Was this page helpful?
0 / 5 - 0 ratings