summaryrefslogtreecommitdiff
path: root/libs/freeimage/src/Metadata
diff options
context:
space:
mode:
Diffstat (limited to 'libs/freeimage/src/Metadata')
-rw-r--r--libs/freeimage/src/Metadata/Exif.cpp66
-rw-r--r--libs/freeimage/src/Metadata/FIRational.cpp2
-rw-r--r--libs/freeimage/src/Metadata/FreeImageTag.cpp14
-rw-r--r--libs/freeimage/src/Metadata/IPTC.cpp16
-rw-r--r--libs/freeimage/src/Metadata/TagConversion.cpp18
5 files changed, 58 insertions, 58 deletions
diff --git a/libs/freeimage/src/Metadata/Exif.cpp b/libs/freeimage/src/Metadata/Exif.cpp
index 1b7dad3916..49a20c75d2 100644
--- a/libs/freeimage/src/Metadata/Exif.cpp
+++ b/libs/freeimage/src/Metadata/Exif.cpp
@@ -133,9 +133,9 @@ ReadUint16(BOOL msb_order, const void *buffer) {
return value;
}
-static DWORD
+static uint32_t
ReadUint32(BOOL msb_order, const void *buffer) {
- return ((DWORD) ReadInt32(msb_order, buffer) & 0xFFFFFFFF);
+ return ((uint32_t) ReadInt32(msb_order, buffer) & 0xFFFFFFFF);
}
// ----------------------------------------------------------
@@ -147,7 +147,7 @@ Process a IFD offset
Returns the offset and the metadata model for this tag
*/
static void
-processIFDOffset(FITAG *tag, const char *pval, BOOL msb_order, DWORD *subdirOffset, TagLib::MDMODEL *md_model) {
+processIFDOffset(FITAG *tag, const char *pval, BOOL msb_order, uint32_t *subdirOffset, TagLib::MDMODEL *md_model) {
// get the IFD offset
*subdirOffset = ReadUint32(msb_order, pval);
@@ -170,7 +170,7 @@ Process a maker note IFD offset
Returns the offset and the metadata model for this tag
*/
static void
-processMakerNote(FIBITMAP *dib, const char *pval, BOOL msb_order, DWORD *subdirOffset, TagLib::MDMODEL *md_model) {
+processMakerNote(FIBITMAP *dib, const char *pval, BOOL msb_order, uint32_t *subdirOffset, TagLib::MDMODEL *md_model) {
FITAG *tagMake = NULL;
*subdirOffset = 0;
@@ -243,7 +243,7 @@ processMakerNote(FIBITMAP *dib, const char *pval, BOOL msb_order, DWORD *subdirO
// the value of ifdStart will be 0x0c000000 instead of 0x0000000c and the MakerNote section will be discarded later
// in jpeg_read_exif_dir because the IFD is too high
*md_model = TagLib::EXIF_MAKERNOTE_FUJIFILM;
- DWORD ifdStart = ReadUint32(msb_order, pval + 8);
+ uint32_t ifdStart = ReadUint32(msb_order, pval + 8);
*subdirOffset = ifdStart;
}
else if(memcmp("KYOCERA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x00\x00\x00", pval, 22) == 0) {
@@ -307,7 +307,7 @@ A single Canon tag may contain many other tags within.
static BOOL
processCanonMakerNoteTag(FIBITMAP *dib, FITAG *tag) {
char defaultKey[16];
- DWORD startIndex = 0;
+ uint32_t startIndex = 0;
TagLib& s = TagLib::instance();
uint16_t tag_id = FreeImage_GetTagID(tag);
@@ -368,7 +368,7 @@ processCanonMakerNoteTag(FIBITMAP *dib, FITAG *tag) {
if(!canonTag) return FALSE;
// we intentionally skip the first array member (if needed)
- for (DWORD i = startIndex; i < FreeImage_GetTagCount(tag); i++) {
+ for (uint32_t i = startIndex; i < FreeImage_GetTagCount(tag); i++) {
tag_id = (uint16_t)(subTagTypeBase + i);
@@ -403,7 +403,7 @@ static void
processExifTag(FIBITMAP *dib, FITAG *tag, char *pval, BOOL msb_order, TagLib::MDMODEL md_model) {
char defaultKey[16];
int n;
- DWORD i;
+ uint32_t i;
// allocate a buffer to store the tag value
uint8_t *exif_value = (uint8_t*)malloc(FreeImage_GetTagLength(tag) * sizeof(uint8_t));
@@ -436,9 +436,9 @@ processExifTag(FIBITMAP *dib, FITAG *tag, char *pval, BOOL msb_order, TagLib::MD
}
case FIDT_LONG:
{
- DWORD *value = (DWORD*)&exif_value[0];
+ uint32_t *value = (uint32_t*)&exif_value[0];
for(i = 0; i < FreeImage_GetTagCount(tag); i++) {
- value[i] = ReadUint32(msb_order, pval + i * sizeof(DWORD));
+ value[i] = ReadUint32(msb_order, pval + i * sizeof(uint32_t));
}
FreeImage_SetTagValue(tag, value);
break;
@@ -454,9 +454,9 @@ processExifTag(FIBITMAP *dib, FITAG *tag, char *pval, BOOL msb_order, TagLib::MD
}
case FIDT_RATIONAL:
{
- n = sizeof(DWORD);
+ n = sizeof(uint32_t);
- DWORD *value = (DWORD*)&exif_value[0];
+ uint32_t *value = (uint32_t*)&exif_value[0];
for(i = 0; i < 2 * FreeImage_GetTagCount(tag); i++) {
// read a sequence of (numerator, denominator)
value[i] = ReadUint32(msb_order, n*i + (char*)pval);
@@ -527,7 +527,7 @@ Process Exif directory
@return Returns TRUE if sucessful, returns FALSE otherwise
*/
static BOOL
-jpeg_read_exif_dir(FIBITMAP *dib, const uint8_t *tiffp, DWORD dwOffsetIfd0, DWORD dwLength, DWORD dwProfileOffset, BOOL msb_order, TagLib::MDMODEL starting_md_model) {
+jpeg_read_exif_dir(FIBITMAP *dib, const uint8_t *tiffp, uint32_t dwOffsetIfd0, uint32_t dwLength, uint32_t dwProfileOffset, BOOL msb_order, TagLib::MDMODEL starting_md_model) {
uint16_t de, nde;
std::stack<uint16_t> destack; // directory entries stack
@@ -538,7 +538,7 @@ jpeg_read_exif_dir(FIBITMAP *dib, const uint8_t *tiffp, DWORD dwOffsetIfd0, DWOR
// when recursive/cyclic directory structures exist.
// This kind of recursive Exif file was encountered with Kodak images coming from
// KODAK PROFESSIONAL DCS Photo Desk JPEG Export v3.2 W
- std::map<DWORD, int> visitedIFD;
+ std::map<uint32_t, int> visitedIFD;
/*
"An Image File Directory (IFD) consists of a 2-byte count of the number of directory
@@ -569,7 +569,7 @@ jpeg_read_exif_dir(FIBITMAP *dib, const uint8_t *tiffp, DWORD dwOffsetIfd0, DWOR
}
// remember that we've visited this directory and entry so that we don't visit it again later
- DWORD visited = (DWORD)( (((size_t)ifdp & 0xFFFF) << 16) | (size_t)de );
+ uint32_t visited = (uint32_t)( (((size_t)ifdp & 0xFFFF) << 16) | (size_t)de );
if(visitedIFD.find(visited) != visitedIFD.end()) {
continue;
} else {
@@ -609,12 +609,12 @@ jpeg_read_exif_dir(FIBITMAP *dib, const uint8_t *tiffp, DWORD dwOffsetIfd0, DWOR
FreeImage_SetTagType(tag, (FREE_IMAGE_MDTYPE)tag_type);
// get number of components
- DWORD tag_count = ReadUint32(msb_order, pde + 4);
+ uint32_t tag_count = ReadUint32(msb_order, pde + 4);
FreeImage_SetTagCount(tag, tag_count);
- // check that tag length (size of the tag value in bytes) will fit in a DWORD
+ // check that tag length (size of the tag value in bytes) will fit in a uint32_t
unsigned tag_data_width = FreeImage_TagDataWidth(FreeImage_GetTagType(tag));
- if (tag_data_width != 0 && FreeImage_GetTagCount(tag) > ~(DWORD)0 / tag_data_width) {
+ if (tag_data_width != 0 && FreeImage_GetTagCount(tag) > ~(uint32_t)0 / tag_data_width) {
FreeImage_DeleteTag(tag);
// jump to next entry
continue;
@@ -626,7 +626,7 @@ jpeg_read_exif_dir(FIBITMAP *dib, const uint8_t *tiffp, DWORD dwOffsetIfd0, DWOR
pval = pde + 8;
} else {
// if its bigger than 4 bytes, the directory entry contains an offset
- DWORD offset_value = ReadUint32(msb_order, pde + 8);
+ uint32_t offset_value = ReadUint32(msb_order, pde + 8);
// the offset can be relative to tiffp or to an external reference (see JPEG-XR)
if(dwProfileOffset) {
offset_value -= dwProfileOffset;
@@ -659,7 +659,7 @@ jpeg_read_exif_dir(FIBITMAP *dib, const uint8_t *tiffp, DWORD dwOffsetIfd0, DWOR
break;
}
if(isIFDOffset) {
- DWORD sub_offset = 0;
+ uint32_t sub_offset = 0;
TagLib::MDMODEL next_mdmodel = md_model;
const uint8_t *next_ifd = ifdp;
@@ -720,7 +720,7 @@ jpeg_read_exif_dir(FIBITMAP *dib, const uint8_t *tiffp, DWORD dwOffsetIfd0, DWOR
const uint16_t entriesCount0th = ReadUint16(msb_order, ifd0th);
- DWORD next_offset = ReadUint32(msb_order, DIR_ENTRY_ADDR(ifd0th, entriesCount0th));
+ uint32_t next_offset = ReadUint32(msb_order, DIR_ENTRY_ADDR(ifd0th, entriesCount0th));
if((next_offset == 0) || (next_offset >= dwLength)) {
return TRUE; //< no thumbnail
}
@@ -749,9 +749,9 @@ jpeg_read_exif_dir(FIBITMAP *dib, const uint8_t *tiffp, DWORD dwOffsetIfd0, DWOR
// get the tag type
/*uint16_t type = */ReadUint16(msb_order, base + sizeof(uint16_t));
// get number of components
- /*DWORD count = */ReadUint32(msb_order, base + sizeof(uint16_t) + sizeof(uint16_t));
+ /*uint32_t count = */ReadUint32(msb_order, base + sizeof(uint16_t) + sizeof(uint16_t));
// get the tag value
- DWORD offset = ReadUint32(msb_order, base + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(DWORD));
+ uint32_t offset = ReadUint32(msb_order, base + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint32_t));
switch(tag) {
case TAG_COMPRESSION:
@@ -818,7 +818,7 @@ jpeg_read_exif_profile(FIBITMAP *dib, const uint8_t *data, unsigned length) {
uint8_t msb_first[4] = { 0x4D, 0x4D, 0x00, 0x2A }; // Classic TIFF signature - big-endian order
// profile size is up to 32-bit
- DWORD dwProfileLength = (DWORD)length;
+ uint32_t dwProfileLength = (uint32_t)length;
uint8_t *pbProfile = (uint8_t*)data;
// verify the identifying string
@@ -850,7 +850,7 @@ jpeg_read_exif_profile(FIBITMAP *dib, const uint8_t *data, unsigned length) {
}
// this is the offset to the first IFD (Image File Directory)
- DWORD dwFirstOffset = ReadUint32(bBigEndian, pbProfile + 4);
+ uint32_t dwFirstOffset = ReadUint32(bBigEndian, pbProfile + 4);
if (dwFirstOffset > dwProfileLength) {
// bad Exif data
return FALSE;
@@ -900,8 +900,8 @@ jpeg_read_exif_profile_raw(FIBITMAP *dib, const uint8_t *profile, unsigned lengt
FITAG *tag = FreeImage_CreateTag();
if(tag) {
FreeImage_SetTagKey(tag, g_TagLib_ExifRawFieldName);
- FreeImage_SetTagLength(tag, (DWORD)length);
- FreeImage_SetTagCount(tag, (DWORD)length);
+ FreeImage_SetTagLength(tag, (uint32_t)length);
+ FreeImage_SetTagCount(tag, (uint32_t)length);
FreeImage_SetTagType(tag, FIDT_BYTE);
FreeImage_SetTagValue(tag, profile);
@@ -1056,7 +1056,7 @@ tiff_write_ifd(FIBITMAP *dib, FREE_IMAGE_MDMODEL md_model, FIMEMORY *hmem) {
std::vector<FITAG*> vTagList;
TagLib::MDMODEL internal_md_model;
- DWORD ifd_offset = 0; // uint16_t-aligned IFD value offset
+ uint32_t ifd_offset = 0; // uint16_t-aligned IFD value offset
const uint8_t empty_byte = 0;
@@ -1158,7 +1158,7 @@ tiff_write_ifd(FIBITMAP *dib, FREE_IMAGE_MDMODEL md_model, FIMEMORY *hmem) {
uint16_t tag_type = (uint16_t)FreeImage_GetTagType(tag);
FreeImage_WriteMemory(&tag_type, 1, 2, hmem);
// tag count
- DWORD tag_count = FreeImage_GetTagCount(tag);
+ uint32_t tag_count = FreeImage_GetTagCount(tag);
FreeImage_WriteMemory(&tag_count, 1, 4, hmem);
// tag value or offset (results are in uint8_t's units)
unsigned tag_length = FreeImage_GetTagLength(tag);
@@ -1224,7 +1224,7 @@ tiff_get_ifd_profile(FIBITMAP *dib, FREE_IMAGE_MDMODEL md_model, uint8_t **ppbPr
if(bResult) {
uint8_t *data = NULL;
- DWORD size_in_bytes = 0;
+ uint32_t size_in_bytes = 0;
// get a pointer to the stream buffer
FreeImage_AcquireMemory(hmem, &data, &size_in_bytes);
@@ -1270,7 +1270,7 @@ psd_read_exif_profile(FIBITMAP *dib, const uint8_t *data, unsigned int length) {
uint8_t msb_first[4] = { 0x4D, 0x4D, 0x00, 0x2A }; // Classic TIFF signature - big-endian order
// profile size is up to 32-bit
- DWORD dwProfileLength = (DWORD)length;
+ uint32_t dwProfileLength = (uint32_t)length;
uint8_t *pbProfile = (uint8_t*)data;
// This is an Exif profile
@@ -1297,7 +1297,7 @@ psd_read_exif_profile(FIBITMAP *dib, const uint8_t *data, unsigned int length) {
}
// this is the offset to the first IFD (Image File Directory)
- DWORD dwFirstOffset = ReadUint32(bBigEndian, pbProfile + 4);
+ uint32_t dwFirstOffset = ReadUint32(bBigEndian, pbProfile + 4);
if (dwFirstOffset > dwProfileLength) {
// bad Exif data
return FALSE;
@@ -1324,7 +1324,7 @@ psd_read_exif_profile_raw(FIBITMAP *dib, const uint8_t *profile, unsigned length
return FALSE;
}
- DWORD dwProfileLength = (DWORD)length + sizeof(exif_signature);
+ uint32_t dwProfileLength = (uint32_t)length + sizeof(exif_signature);
uint8_t *pbProfile = (uint8_t*)malloc(dwProfileLength);
if(NULL == pbProfile) {
// out of memory ...
diff --git a/libs/freeimage/src/Metadata/FIRational.cpp b/libs/freeimage/src/Metadata/FIRational.cpp
index 367b6c8f60..19e8a87f7c 100644
--- a/libs/freeimage/src/Metadata/FIRational.cpp
+++ b/libs/freeimage/src/Metadata/FIRational.cpp
@@ -52,7 +52,7 @@ FIRational::FIRational(const FITAG *tag) {
switch(FreeImage_GetTagType((FITAG*)tag)) {
case FIDT_RATIONAL: // 64-bit unsigned fraction
{
- DWORD *pvalue = (DWORD*)FreeImage_GetTagValue((FITAG*)tag);
+ uint32_t *pvalue = (uint32_t*)FreeImage_GetTagValue((FITAG*)tag);
initialize((LONG)pvalue[0], (LONG)pvalue[1]);
break;
}
diff --git a/libs/freeimage/src/Metadata/FreeImageTag.cpp b/libs/freeimage/src/Metadata/FreeImageTag.cpp
index ceaec666f1..7ee55e50f2 100644
--- a/libs/freeimage/src/Metadata/FreeImageTag.cpp
+++ b/libs/freeimage/src/Metadata/FreeImageTag.cpp
@@ -36,8 +36,8 @@ FI_STRUCT (FITAGHEADER) {
char *description; // tag description
uint16_t id; // tag ID
uint16_t type; // tag data type (see FREE_IMAGE_MDTYPE)
- DWORD count; // number of components (in 'tag data types' units)
- DWORD length; // value length in bytes
+ uint32_t count; // number of components (in 'tag data types' units)
+ uint32_t length; // value length in bytes
void *value; // tag value
};
@@ -168,12 +168,12 @@ FreeImage_GetTagType(FITAG *tag) {
return tag ? (FREE_IMAGE_MDTYPE)(((FITAGHEADER *)tag->data)->type) : FIDT_NOTYPE;
}
-DWORD DLL_CALLCONV
+uint32_t DLL_CALLCONV
FreeImage_GetTagCount(FITAG *tag) {
return tag ? ((FITAGHEADER *)tag->data)->count : 0;
}
-DWORD DLL_CALLCONV
+uint32_t DLL_CALLCONV
FreeImage_GetTagLength(FITAG *tag) {
return tag ? ((FITAGHEADER *)tag->data)->length : 0;
}
@@ -228,7 +228,7 @@ FreeImage_SetTagType(FITAG *tag, FREE_IMAGE_MDTYPE type) {
}
BOOL DLL_CALLCONV
-FreeImage_SetTagCount(FITAG *tag, DWORD count) {
+FreeImage_SetTagCount(FITAG *tag, uint32_t count) {
if(tag) {
FITAGHEADER *tag_header = (FITAGHEADER *)tag->data;
tag_header->count = count;
@@ -238,7 +238,7 @@ FreeImage_SetTagCount(FITAG *tag, DWORD count) {
}
BOOL DLL_CALLCONV
-FreeImage_SetTagLength(FITAG *tag, DWORD length) {
+FreeImage_SetTagLength(FITAG *tag, uint32_t length) {
if(tag) {
FITAGHEADER *tag_header = (FITAGHEADER *)tag->data;
tag_header->length = length;
@@ -270,7 +270,7 @@ FreeImage_SetTagValue(FITAG *tag, const void *value) {
}
char *src_data = (char*)value;
char *dst_data = (char*)tag_header->value;
- for(DWORD i = 0; i < tag_header->length; i++) {
+ for(uint32_t i = 0; i < tag_header->length; i++) {
dst_data[i] = src_data[i];
}
dst_data[tag_header->length] = '\0';
diff --git a/libs/freeimage/src/Metadata/IPTC.cpp b/libs/freeimage/src/Metadata/IPTC.cpp
index 149ecc9b33..92bc2e6a26 100644
--- a/libs/freeimage/src/Metadata/IPTC.cpp
+++ b/libs/freeimage/src/Metadata/IPTC.cpp
@@ -194,8 +194,8 @@ read_iptc_profile(FIBITMAP *dib, const uint8_t *dataptr, unsigned int datalen) {
FreeImage_SetTagID(tag, TAG_KEYWORDS);
FreeImage_SetTagKey(tag, tag_lib.getTagFieldName(TagLib::IPTC, TAG_KEYWORDS, defaultKey));
FreeImage_SetTagDescription(tag, tag_lib.getTagDescription(TagLib::IPTC, TAG_KEYWORDS));
- FreeImage_SetTagLength(tag, (DWORD)Keywords.length());
- FreeImage_SetTagCount(tag, (DWORD)Keywords.length());
+ FreeImage_SetTagLength(tag, (uint32_t)Keywords.length());
+ FreeImage_SetTagCount(tag, (uint32_t)Keywords.length());
FreeImage_SetTagValue(tag, (char*)Keywords.c_str());
FreeImage_SetMetadata(FIMD_IPTC, dib, FreeImage_GetTagKey(tag), tag);
}
@@ -206,8 +206,8 @@ read_iptc_profile(FIBITMAP *dib, const uint8_t *dataptr, unsigned int datalen) {
FreeImage_SetTagID(tag, TAG_SUPPLEMENTAL_CATEGORIES);
FreeImage_SetTagKey(tag, tag_lib.getTagFieldName(TagLib::IPTC, TAG_SUPPLEMENTAL_CATEGORIES, defaultKey));
FreeImage_SetTagDescription(tag, tag_lib.getTagDescription(TagLib::IPTC, TAG_SUPPLEMENTAL_CATEGORIES));
- FreeImage_SetTagLength(tag, (DWORD)SupplementalCategory.length());
- FreeImage_SetTagCount(tag, (DWORD)SupplementalCategory.length());
+ FreeImage_SetTagLength(tag, (uint32_t)SupplementalCategory.length());
+ FreeImage_SetTagCount(tag, (uint32_t)SupplementalCategory.length());
FreeImage_SetTagValue(tag, (char*)SupplementalCategory.c_str());
FreeImage_SetMetadata(FIMD_IPTC, dib, FreeImage_GetTagKey(tag), tag);
}
@@ -222,7 +222,7 @@ read_iptc_profile(FIBITMAP *dib, const uint8_t *dataptr, unsigned int datalen) {
// --------------------------------------------------------------------------
static uint8_t*
-append_iptc_tag(uint8_t *profile, unsigned *profile_size, uint16_t id, DWORD length, const void *value) {
+append_iptc_tag(uint8_t *profile, unsigned *profile_size, uint16_t id, uint32_t length, const void *value) {
uint8_t *buffer = NULL;
// calculate the new buffer size
@@ -303,7 +303,7 @@ write_iptc_profile(FIBITMAP *dib, uint8_t **profile, unsigned *profile_size) {
// add as many tags as there are comma separated strings
for(int i = 0; i < (int)output.size(); i++) {
std::string& tag_value = output[i];
- buffer = append_iptc_tag(buffer, &buffer_size, tag_id, (DWORD)tag_value.length(), tag_value.c_str());
+ buffer = append_iptc_tag(buffer, &buffer_size, tag_id, (uint32_t)tag_value.length(), tag_value.c_str());
}
}
@@ -311,14 +311,14 @@ write_iptc_profile(FIBITMAP *dib, uint8_t **profile, unsigned *profile_size) {
case TAG_URGENCY:
if(FreeImage_GetTagType(tag) == FIDT_ASCII) {
- DWORD length = 1; // keep the first octet only
+ uint32_t length = 1; // keep the first octet only
buffer = append_iptc_tag(buffer, &buffer_size, tag_id, length, FreeImage_GetTagValue(tag));
}
break;
default:
if(FreeImage_GetTagType(tag) == FIDT_ASCII) {
- DWORD length = FreeImage_GetTagLength(tag);
+ uint32_t length = FreeImage_GetTagLength(tag);
buffer = append_iptc_tag(buffer, &buffer_size, tag_id, length, FreeImage_GetTagValue(tag));
}
break;
diff --git a/libs/freeimage/src/Metadata/TagConversion.cpp b/libs/freeimage/src/Metadata/TagConversion.cpp
index 6d2ca14e2d..b87ae06dc9 100644
--- a/libs/freeimage/src/Metadata/TagConversion.cpp
+++ b/libs/freeimage/src/Metadata/TagConversion.cpp
@@ -37,7 +37,7 @@ static const char*
ConvertAnyTag(FITAG *tag) {
char format[MAX_TEXT_EXTENT];
static std::string buffer;
- DWORD i;
+ uint32_t i;
if(!tag)
return NULL;
@@ -47,7 +47,7 @@ ConvertAnyTag(FITAG *tag) {
// convert the tag value to a string buffer
FREE_IMAGE_MDTYPE tag_type = FreeImage_GetTagType(tag);
- DWORD tag_count = FreeImage_GetTagCount(tag);
+ uint32_t tag_count = FreeImage_GetTagCount(tag);
switch(tag_type) {
case FIDT_BYTE: // N x 8-bit unsigned integer
@@ -76,7 +76,7 @@ ConvertAnyTag(FITAG *tag) {
}
case FIDT_LONG: // N x 32-bit unsigned integer
{
- DWORD *pvalue = (DWORD *)FreeImage_GetTagValue(tag);
+ uint32_t *pvalue = (uint32_t *)FreeImage_GetTagValue(tag);
sprintf(format, "%lu", pvalue[0]);
buffer += format;
@@ -88,7 +88,7 @@ ConvertAnyTag(FITAG *tag) {
}
case FIDT_RATIONAL: // N x 64-bit unsigned fraction
{
- DWORD *pvalue = (DWORD*)FreeImage_GetTagValue(tag);
+ uint32_t *pvalue = (uint32_t*)FreeImage_GetTagValue(tag);
sprintf(format, "%ld/%ld", pvalue[0], pvalue[1]);
buffer += format;
@@ -172,7 +172,7 @@ ConvertAnyTag(FITAG *tag) {
}
case FIDT_IFD: // N x 32-bit unsigned integer (offset)
{
- DWORD *pvalue = (DWORD *)FreeImage_GetTagValue(tag);
+ uint32_t *pvalue = (uint32_t *)FreeImage_GetTagValue(tag);
sprintf(format, "%X", pvalue[0]);
buffer += format;
@@ -295,7 +295,7 @@ ConvertExifTag(FITAG *tag) {
case TAG_REFERENCE_BLACK_WHITE:
{
- DWORD *pvalue = (DWORD*)FreeImage_GetTagValue(tag);
+ uint32_t *pvalue = (uint32_t*)FreeImage_GetTagValue(tag);
if(FreeImage_GetTagLength(tag) == 48) {
// reference black point value and reference white point value (ReferenceBlackWhite)
int blackR = 0, whiteR = 0, blackG = 0, whiteG = 0, blackB = 0, whiteB = 0;
@@ -337,7 +337,7 @@ ConvertExifTag(FITAG *tag) {
{
const char *componentStrings[7] = {"", "Y", "Cb", "Cr", "R", "G", "B"};
uint8_t *pvalue = (uint8_t*)FreeImage_GetTagValue(tag);
- for(DWORD i = 0; i < MIN((DWORD)4, FreeImage_GetTagCount(tag)); i++) {
+ for(uint32_t i = 0; i < MIN((uint32_t)4, FreeImage_GetTagCount(tag)); i++) {
int j = pvalue[i];
if(j > 0 && j < 7)
buffer += componentStrings[j];
@@ -886,7 +886,7 @@ ConvertExifTag(FITAG *tag) {
// first 8 bytes are used to define an ID code
// we assume this is an ASCII string
const uint8_t *userComment = (uint8_t*)FreeImage_GetTagValue(tag);
- for(DWORD i = 8; i < FreeImage_GetTagLength(tag); i++) {
+ for(uint32_t i = 8; i < FreeImage_GetTagLength(tag); i++) {
buffer += userComment[i];
}
buffer += '\0';
@@ -1005,7 +1005,7 @@ ConvertExifGPSTag(FITAG *tag) {
case TAG_GPS_LONGITUDE:
case TAG_GPS_TIME_STAMP:
{
- DWORD *pvalue = (DWORD*)FreeImage_GetTagValue(tag);
+ uint32_t *pvalue = (uint32_t*)FreeImage_GetTagValue(tag);
if(FreeImage_GetTagLength(tag) == 24) {
// dd:mm:ss or hh:mm:ss
int dd = 0, mm = 0;