Commit a3eb9430 authored by Mikhail Karpenko's avatar Mikhail Karpenko

Edit two Exif fields

HostComputer exif field containing serial number was replaced with more
suitable CameraSerialNumber. IPTCNAA field containing frame number was
replaced with ImageNumber.
parent 6393936e
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
dlen: length of a variable data field, stored in frame buffer dlen: length of a variable data field, stored in frame buffer
ltag: Exif_tag+(group<<16). If specified, is used by the software, while the Exif output will still have tag ltag: Exif_tag+(group<<16). If specified, is used by the software, while the Exif output will still have tag
SubSecTimeOriginal should go immediately after DateTimeOriginal (in the sequence numbers, not in the Exif templete) SubSecTimeOriginal should go immediately after DateTimeOriginal (in the sequence numbers, not in the Exif templete)
Update, June 2016: PageNumber field is used as sensor port number, HostComputer field is replaced with CameraSerialNumber and
FrameNumber field (which actually was IPTCNAA field) is replaced with standart ImageNumber field.
--> -->
<Exif> <Exif>
<Image> <Image>
...@@ -22,8 +25,8 @@ ...@@ -22,8 +25,8 @@
<DateTime tag="0x0132" format="ASCII" count="20" seq="1" dlen="20"> <DateTime tag="0x0132" format="ASCII" count="20" seq="1" dlen="20">
<value>2001:06:21 12:00:00</value> <value>2001:06:21 12:00:00</value>
</DateTime> </DateTime>
<HostComputer tag="0x013c" format="ASCII" function="SERIAL"/> <CameraSerialNumber tag="0xc62f" format="ASCII" function="SERIAL"/>
<FrameNumber tag="0x83bb" format="LONG" count="1" seq="25" dlen="4"/> <ImageNumber tag="0x9211" format="LONG" count="1" seq="25" dlen="4"/>
<Orientation tag="0x112" format="SHORT" count="1" seq="27" dlen="2"/> <Orientation tag="0x112" format="SHORT" count="1" seq="27" dlen="2"/>
<PageNumber tag="0x129" format="SHORT" count="1" seq="28" dlen="2"/> <PageNumber tag="0x129" format="SHORT" count="1" seq="28" dlen="2"/>
<ExifTag tag="0x8769" format="LONG" function="EXIFTAG"/> <ExifTag tag="0x8769" format="LONG" function="EXIFTAG"/>
......
This diff is collapsed.
...@@ -289,7 +289,7 @@ int printExifXML(int exif_page, struct file_set *fset) ...@@ -289,7 +289,7 @@ int printExifXML(int exif_page, struct file_set *fset)
while (read(fd_exifdir, &dir_table_entry, sizeof(dir_table_entry)) > 0) { while (read(fd_exifdir, &dir_table_entry, sizeof(dir_table_entry)) > 0) {
switch (dir_table_entry.ltag) { switch (dir_table_entry.ltag) {
case Exif_Image_ImageDescription: indx = Exif_Image_ImageDescription_Index; break; case Exif_Image_ImageDescription: indx = Exif_Image_ImageDescription_Index; break;
case Exif_Image_FrameNumber: indx = Exif_Image_FrameNumber_Index; break; case Exif_Image_ImageNumber: indx = Exif_Image_ImageNumber_Index; break;
case Exif_Photo_DateTimeOriginal: indx = Exif_Photo_DateTimeOriginal_Index; break; case Exif_Photo_DateTimeOriginal: indx = Exif_Photo_DateTimeOriginal_Index; break;
case Exif_Photo_SubSecTimeOriginal: indx = Exif_Photo_SubSecTimeOriginal_Index; break; case Exif_Photo_SubSecTimeOriginal: indx = Exif_Photo_SubSecTimeOriginal_Index; break;
case Exif_Photo_ExposureTime: indx = Exif_Photo_ExposureTime_Index; break; case Exif_Photo_ExposureTime: indx = Exif_Photo_ExposureTime_Index; break;
...@@ -349,14 +349,14 @@ int printExifXML(int exif_page, struct file_set *fset) ...@@ -349,14 +349,14 @@ int printExifXML(int exif_page, struct file_set *fset)
saferead255(fd_exif, val, exif_dir[Exif_Image_ImageDescription_Index].len); saferead255(fd_exif, val, exif_dir[Exif_Image_ImageDescription_Index].len);
printf("<ImageDescription>\"%s\"</ImageDescription>\n", val); printf("<ImageDescription>\"%s\"</ImageDescription>\n", val);
} }
///Exif_Image_FrameNumber_Index 0x13 ///Exif_Image_ImageNumber_Index 0x13
if (exif_dir[Exif_Image_FrameNumber_Index].ltag == Exif_Image_FrameNumber) { // Exif_Image_FrameNumber_Index is present in template if (exif_dir[Exif_Image_ImageNumber_Index].ltag == Exif_Image_ImageNumber) { // Exif_Image_ImageNumber_Index is present in template
lseek(fd_exif, lseek(fd_exif,
exif_page_start + exif_dir[Exif_Image_FrameNumber_Index].dst, exif_page_start + exif_dir[Exif_Image_ImageNumber_Index].dst,
SEEK_SET); SEEK_SET);
read(fd_exif, rational3, 4); read(fd_exif, rational3, 4);
sprintf(val, "%ld", (long)__cpu_to_be32( rational3[0])); sprintf(val, "%ld", (long)__cpu_to_be32( rational3[0]));
printf("<FrameNumber>\"%s\"</FrameNumber>\n", val); printf("<ImageNumber>\"%s\"</ImageNumber>\n", val);
} }
///Exif_Image_Orientation_Index 0x14 ///Exif_Image_Orientation_Index 0x14
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment