From: Jan P. <pa...@pi...> - 2006-09-06 14:26:01
|
Apparently the data associated to tag MNOTE_CANON_TAG_FOCAL_LENGTH have four short int values (because entry->components is 4). The first value is 2 (you get 1 after dividing by 2). Is this what you expect? Are you familiar with the format of the data of this tag (I am not)? -- Jan Apparent > Jan Patera wrote: >>> case MNOTE_CANON_TAG_FOCAL_LENGTH: >>> CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen); >>> n = exif_get_short (data, entry->order) / 2; >>> if (t >= n) return NULL; >>> CC (entry->components, n, val, maxlen); >>> vs = exif_get_short (entry->data + 2 + t * 2, entry->order); >>> snprintf (buf, sizeof (buf), "0x%04x", vs); >>> strncpy (val, buf, maxlen - strlen (val)); >>> break; >>> >>> But when I run the exif commandline utility, an error is reported for >>> the new tag: >>> >>> Focal type |Invalid number of components (4, expected 1). >>> >>> What am I doing wrong here? >> >> >> this message is printed by the CC macro. It checks whether >> 1st & 2nd arguments are equal. apparently entry->components is 4, but >> n is only 1. > > I knew it was reported by the CC macro, but I don't understand why it is > happening. It is exactly the same code as is used for > MNOTE_CANON_TAG_SETTINGS_1 (which also has multiple components), but no > error there! Probably I forgot to add some code somewhere else, but I > don't see it. |