Quantcast
Channel: magick Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1011

Commented Unassigned: Canon specific EXIF values [1424]

$
0
0
When i use comand line exiftool to dump all of the metadata from this JPG i see two specific fields i really want to get. They are in a profile listed by exiftool as "Canon"

Time Zone : -05:00
Time Zone City : New York

When i'm using Magic.net if i get all of the available profiles for the JPG which i'm told are "exif" and "xmp" and loop through all available tags of both i don't see these tags or values and i've got no other tags that will give me the timezone. I'm attaching the JPG and the exiftool's dump file. I'd really love a way to be able to get those two values out otherwise i have no way to know which timezone the date/time fields i'm pulling from EXIF are in.


Comments: The Canon specific information is stored inside the ExifTag.MakerNote. I might be able to add something for that in the future but it's going to be a lot of work. For now you will need to parse that yourself. I tried to parse the data but I am getting an incorrect offset at some point and I will let you figure out how to resolve that. I hope you will come back here with the answer though :) Here is my code sample: ```C# using (MagickImage image = new MagickImage("1MR1215.jpg")) { ExifProfile profile = image.GetExifProfile(); ExifValue markerNote = profile.GetValue(ExifTag.MakerNote); byte[] data = (byte[])markerNote.Value; ushort count = BitConverter.ToUInt16(data, 0); int offset = 2; int start = offset + (count * 12); for (ushort i = 0; i < count; i++) { ushort id = BitConverter.ToUInt16(data, offset); offset += 8; // ID list at: http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Canon.html if (id == 0x0035) // TimeInfo { int dataOffset = (int)BitConverter.ToUInt32(data, offset); // dataOffset = 3892 but should be 2850 ??? dataOffset = 2850; // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Canon.html#TimeInfo int timeZone = BitConverter.ToInt32(data, dataOffset); // -300 => -300 / 60 = -5 int timeZoneCity = BitConverter.ToInt32(data, dataOffset + 4); // 27 = New York int daylightSavings = BitConverter.ToInt32(data, dataOffset + 8); // 0 = Off } offset += 4; } } ```

Viewing all articles
Browse latest Browse all 1011

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>