#define IFD_SIZE 12
#define OFFSET_SIZE 4
-#define NUM_0TH_IFD_TIFF 10
-#define NUM_0TH_IFD_EXIF 22
+/* Add any additional writeExifIfd() in sections, increase buffer size */
+#define NUM_0TH_IFD_TIFF 11
+#define NUM_0TH_IFD_EXIF 24
#define NUM_0TH_IFD_GPS 10
#define NUM_1TH_IFD_TIFF 9
#define EXIF_TAG_ORIENTATION 0x0112
#define EXIF_TAG_SOFTWARE 0x0131
#define EXIF_TAG_DATE_TIME 0x0132
+#define EXIF_TAG_SUBSEC_TIME 0x9290
#define EXIF_TAG_YCBCR_POSITIONING 0x0213
#define EXIF_TAG_EXIF_IFD_POINTER 0x8769
#define EXIF_TAG_GPS_IFD_POINTER 0x8825
#define EXIF_TAG_ISO_SPEED_RATING 0x8827
#define EXIF_TAG_EXIF_VERSION 0x9000
#define EXIF_TAG_DATE_TIME_ORG 0x9003
+#define EXIF_TAG_SUBSEC_TIME_ORG 0x9291
#define EXIF_TAG_DATE_TIME_DIGITIZE 0x9004
+#define EXIF_TAG_SUBSEC_TIME_DIGITIZE 0x9292
#define EXIF_TAG_SHUTTER_SPEED 0x9201
#define EXIF_TAG_APERTURE 0x9202
#define EXIF_TAG_BRIGHTNESS 0x9203
unsigned char software[32];
unsigned char exif_version[4];
unsigned char date_time[20];
+ unsigned char sub_sec[4];
unsigned char user_comment[150];
uint32_t width;
* limitations under the License.
*/
+#define LOG_TAG "ExynosJpegForCamera"
#include <utils/Log.h>
#include "ExynosJpegEncoderForCamera.h"
static const char ExifAsciiPrefix[] = { 0x41, 0x53, 0x43, 0x49, 0x49, 0x0, 0x0, 0x0 };
#define JPEG_ERROR_LOG ALOGE
-#define LOG_TAG "ExynosJpegForCamera"
#define JPEG_THUMBNAIL_QUALITY (60)
#define EXIF_LIMIT_SIZE (64*1024)
return ERROR_NOT_YET_CREATED;
}
- if (buf == NULL) {
+ if (!buf) {
return ERROR_BUFFR_IS_NULL;
}
int iJpegBuffer = m_stMainOutBuf.ionBuffer[0];
char *pcJpegBuffer = m_stMainOutBuf.pcBuf[0];
- if (pcJpegBuffer[0] == NULL) {
+ if (!pcJpegBuffer[0]) {
JPEG_ERROR_LOG("%s::pcJpegBuffer[0] is null!!\n", __func__);
return ERROR_OUT_BUFFER_CREATE_FAIL;
}
strlen((char *)exifInfo->software) + 1, exifInfo->software, &LongerTagOffest, pIfdStart);
writeExifIfd(&pCur, EXIF_TAG_DATE_TIME, EXIF_TYPE_ASCII,
20, exifInfo->date_time, &LongerTagOffest, pIfdStart);
+ writeExifIfd(&pCur, EXIF_TAG_SUBSEC_TIME, EXIF_TYPE_ASCII,
+ sizeof(exifInfo->sub_sec), exifInfo->sub_sec);
writeExifIfd(&pCur, EXIF_TAG_YCBCR_POSITIONING, EXIF_TYPE_SHORT,
1, exifInfo->ycbcr_positioning);
writeExifIfd(&pCur, EXIF_TAG_EXIF_IFD_POINTER, EXIF_TYPE_LONG,
4, exifInfo->exif_version);
writeExifIfd(&pCur, EXIF_TAG_DATE_TIME_ORG, EXIF_TYPE_ASCII,
20, exifInfo->date_time, &LongerTagOffest, pIfdStart);
+ writeExifIfd(&pCur, EXIF_TAG_SUBSEC_TIME_ORG, EXIF_TYPE_ASCII,
+ sizeof(exifInfo->sub_sec), exifInfo->sub_sec);
writeExifIfd(&pCur, EXIF_TAG_DATE_TIME_DIGITIZE, EXIF_TYPE_ASCII,
20, exifInfo->date_time, &LongerTagOffest, pIfdStart);
+ writeExifIfd(&pCur, EXIF_TAG_SUBSEC_TIME_DIGITIZE, EXIF_TYPE_ASCII,
+ sizeof(exifInfo->sub_sec), exifInfo->sub_sec);
writeExifIfd(&pCur, EXIF_TAG_SHUTTER_SPEED, EXIF_TYPE_SRATIONAL,
1, (rational_t *)&exifInfo->shutter_speed, &LongerTagOffest, pIfdStart);
writeExifIfd(&pCur, EXIF_TAG_APERTURE, EXIF_TYPE_RATIONAL,
memcpy(pNextIfdOffset, &tmp, OFFSET_SIZE); // NEXT IFD offset skipped on 0th IFD
}
- unsigned char App1Marker[2] = { 0xff, 0xe1 };
- memcpy(pApp1Start, App1Marker, 2);
- pApp1Start += 2;
+ *(pApp1Start++) = 0xff;
+ *(pApp1Start++) = 0xe1;
*size = 10 + LongerTagOffest;
tmp = *size - 2; // APP1 Maker isn't counted
- unsigned char size_mm[2] = {(tmp >> 8) & 0xFF, tmp & 0xFF};
- memcpy(pApp1Start, size_mm, 2);
+ *(pApp1Start++) = (tmp >> 8) & 0xFF;
+ *(pApp1Start++) = tmp & 0xFF;
return ERROR_NONE;
}