diff options
author | Tyler Luu <tluu@ti.com> | 2011-10-19 01:36:15 -0500 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-10-19 10:12:29 -0700 |
commit | 754078052c687f6721536009c816644c73e4f145 (patch) | |
tree | bab85785f724a4e299c6a43afbb26d070e6ad02b | |
parent | bd90094d709a579d8d74c326269e492627be9daa (diff) | |
download | jhead-ics-factoryrom-2-release.tar.gz |
Fixes for exif tag insertionandroid-sdk-adt_r16.0.1android-sdk-4.0.3_r1android-sdk-4.0.3-tools_r1android-cts-verifier-4.0_r1android-cts-verifier-4.0.3_r1android-cts-4.0_r1android-cts-4.0.3_r2android-cts-4.0.3_r1android-4.0.4_r2.1android-4.0.4_r2android-4.0.4_r1.2android-4.0.4_r1.1android-4.0.4_r1android-4.0.3_r1.1android-4.0.3_r1android-4.0.2_r1android-4.0.1_r1.2android-4.0.1_r1.1android-4.0.1_r1ics-mr1-releaseics-mr1ics-mr0-releaseics-mr0ics-factoryrom-2-release
1. Change ExposureTime tag to rational format as defined by
Exif2.2 standard
2. Update # of components for types with unknown length of -1
after parsing through list
Change-Id: Ib1f65f677b2d8acad310ba8cba46efb3e21920a4
Signed-off-by: Tyler Luu <tluu@ti.com>
-rw-r--r-- | exif.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -231,7 +231,7 @@ static const TagTable_t TagTable[] = { { TAG_CFA_PATTERN1, "CFAPattern", 0, 0}, { TAG_BATTERY_LEVEL, "BatteryLevel", 0, 0}, { TAG_COPYRIGHT, "Copyright", FMT_STRING, -1}, - { TAG_EXPOSURETIME, "ExposureTime", FMT_USHORT, 1}, + { TAG_EXPOSURETIME, "ExposureTime", FMT_SRATIONAL, 1}, { TAG_FNUMBER, "FNumber", FMT_SRATIONAL, 1}, { TAG_IPTC_NAA, "IPTC/NAA", 0, 0}, { TAG_EXIF_OFFSET, "ExifOffset", 0, 0}, @@ -1085,6 +1085,8 @@ static void writeExifTagAndData(int tag, char* Buffer, int* DirIndex, int* DataWriteIndex) { + void* componentsPosition = NULL; // for saving component position + Put16u(Buffer+ (*DirIndex), tag); // Tag Put16u(Buffer+(*DirIndex) + 2, format); // Format if (format == FMT_STRING && components == -1) { @@ -1101,6 +1103,7 @@ static void writeExifTagAndData(int tag, } } Put32u(Buffer+(*DirIndex) + 4, components); // Components + componentsPosition = Buffer+(*DirIndex) + 4; // components # can change for lists printf("# components: %ld", components); if (format == FMT_STRING) { // short strings can fit right in the long, otherwise have to @@ -1161,6 +1164,7 @@ static void writeExifTagAndData(int tag, } curElement = strtok(NULL, ","); } + if (components == -1) Put32u(componentsPosition, i); // update component # for unknowns } (*DirIndex) += 12; } |