Compare type ExifTag accepts against ExifDataType #2575
Replies: 1 comment 4 replies
-
Type tagType = ExifTag.{tag}.GetType();
// switch (tagType)
case Type t when t == typeof(ExifTag<byte>): // change `byte` to any other type |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
prabhavmehra
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to compare the type ExifTag accepts against an ExifDataType?
The main workflow I am looking into -
A custom
IDictionary<ExifTag, object>
which the app can use to set the values.For example,
CustomDict[ExifTag.GPSLatitude] = 144
. And then in my custom implementation I want to check which type does GPSLatitude accepts (Rational[]) in this case and then convert the object to that type and set the exif tag.This mainly simplifies the code the app has where it doesn't has to bother about types that much and the custom implementation does everything.
One thing I thought was to have a dictionary or similar to hold the tag and what type it accepts but that is difficult to manage based on the number of tag,
Beta Was this translation helpful? Give feedback.
All reactions