-
Notifications
You must be signed in to change notification settings - Fork 15
Niche feature request: "Serializable" tag class? #11
Comments
I am not too crazy about the idea of adding the attributes for this. I think it would be a better approach to copy the exif data to your own class and then serialize how you wish. With that said, depending on what you are trying to do, there might be ways to further expose exiftool functionality to achieve a similar result. There is an ability of exiftool to dump json (and other formats too) to files. For example, try running the following commands:
If either the first or second option are useful to you to have in NExifTool, I would be happy to consider adding that to the library. |
I'd not considered that exiftool might have the function built in, I'll look into those options and let you know how it goes. |
I'm happy to report that the first option Having either as part of the library would be very helpful - as would the ability to then read the resulting JSON information into a |
Thanks for getting back to me, glad to hear that worked for you. I have a lot going on at the moment, but once I have some time I will take a look at adding this to the library. If you have interest in implementing such a feature, I'd be happy to accept a PR. |
I was hoping to read the tags out of a collection of images once, and save the information to a companion file to speed things up the next time I read the tags. When I try to do this with a JSON Serializer I get the below error:
System.Runtime.Serialization.InvalidDataContractException
HResult=0x80131500
Message=Type 'NExifTool.Tag' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types. Source=System.Runtime.Serialization
It's probably not that common an operation, so I understand if this isn't something you can fix. If it's something you can look into there's more information on the whole process here: https://www.newtonsoft.com/json/help/html/SerializingJSON.htm
The text was updated successfully, but these errors were encountered: