return;
}
- std::pair<std::string, std::string> pair;
+ std::pair<std::string, JsonValue> pair;
switch (static_cast<unsigned int>(entry->tag)) {
case EXIF_TAG_IMAGE_WIDTH: {
exif_entry_get_value(entry, buf, sizeof(buf));
LoggerD("Setting ExifInformation width to: [%s]", buf);
- pair = std::make_pair("width", std::string(buf));
+ pair = std::make_pair("width", picojson::value(std::string(buf)));
result_obj->insert(pair);
break;
}
case EXIF_TAG_IMAGE_LENGTH: {
exif_entry_get_value(entry, buf, sizeof(buf));
LoggerD("Setting ExifInformation height to: [%s]", buf);
- pair = std::make_pair("height", std::string(buf));
+ pair = std::make_pair("height", picojson::value(std::string(buf)));
result_obj->insert(pair);
break;
}
case EXIF_TAG_MAKE: {
exif_entry_get_value(entry, buf, sizeof(buf));
LoggerD("Setting ExifInformation maker to: [%s]", buf);
- pair = std::make_pair("deviceMaker", std::string(buf));
+ pair = std::make_pair("deviceMaker", picojson::value(std::string(buf)));
result_obj->insert(pair);
break;
}
case EXIF_TAG_MODEL: {
exif_entry_get_value(entry, buf, sizeof(buf));
LoggerD("Setting ExifInformation model to: [%s]", buf);
- pair = std::make_pair("deviceModel", std::string(buf));
+ pair = std::make_pair("deviceModel", picojson::value(std::string(buf)));
result_obj->insert(pair);
break;
}
static_cast<int>(time));
// convert time_t (number of seconds) to string
pair = std::make_pair("originalTimeSeconds",
- std::to_string(static_cast<int>(time)));
+ picojson::value(static_cast<double>(time)));
result_obj->insert(pair);
break;
}
std::string orientation = ExifUtil::orientationToString(
static_cast<ImageOrientation>(orient));
- pair = std::make_pair("orientation", orientation);
+ pair = std::make_pair("orientation", picojson::value(orientation));
result_obj->insert(pair);
if (orient < EXIF_ORIENTATION_NORMAL || orient >= EXIF_ORIENTATION_NOT_VALID) {
if (fnumber.isValid()) {
LoggerD("Setting ExifInformation fnumber to: %f (%s)", fnumber.toDouble(),
fnumber.toString().c_str());
- pair = std::make_pair("fNumber", std::to_string(fnumber.toDouble()));
+ pair = std::make_pair("fNumber", picojson::value(fnumber.toDouble()));
result_obj->insert(pair);
} else {
LoggerW("Couldn't set ExifInformation - fnumber is not valid: %s",
read_ptr += size_per_member;
}
- std::pair<std::string, JsonArray> pair_array;
- pair_array = std::make_pair("isoSpeedRatings", array);
- result_obj->insert(pair_array);
+ pair = std::make_pair("isoSpeedRatings", picojson::value(array));
+ result_obj->insert(pair);
} else {
LoggerE("iso speed ratings: format or components count is invalid!");
throw common::TypeMismatchException("iso speed ratings: format or"
LoggerD("Setting ExifInformation exposure time to: %s (%s)",
exp_time.toString().c_str(),
exp_time.toExposureTimeString().c_str());
- pair = std::make_pair("exposureTime", std::to_string(exp_time.toDouble()));
+ pair = std::make_pair("exposureTime", picojson::value(exp_time.toDouble()));
result_obj->insert(pair);
} else {
LoggerD("Couldn't set ExifInformation - exposure time is not valid: %s",
exp_program, buf);
std::string exp_program_string =
ExifUtil::exposureProgramToString(static_cast<ExposureProgram>(exp_program));
- pair = std::make_pair("exposureProgram", exp_program_string);
+ pair = std::make_pair("exposureProgram", picojson::value(exp_program_string));
result_obj->insert(pair);
}
break;
const ExifShort flash = exif_get_short(entry->data, order);
LoggerD("Setting ExifInformation flash to: [%s] flash=%d", buf, flash);
- pair = std::make_pair("flash", (flash != 0) ? std::string("true") : std::string("false"));
+ pair = std::make_pair("flash", picojson::value((flash != 0) ? "true" : "false"));
result_obj->insert(pair);
break;
}
if (flength.isValid()) {
LoggerD("Setting ExifInformation focal length to: %f (%s)",
flength.toDouble(), flength.toString().c_str());
- pair = std::make_pair("focalLength", std::to_string(flength.toDouble()));
+ pair = std::make_pair("focalLength", picojson::value(flength.toDouble()));
result_obj->insert(pair);
} else {
LoggerW("Couldn't set ExifInformation - focal length is not valid: %s",
exif_entry_get_value(entry, buf, sizeof(buf));
LoggerD("Setting ExifInformation white balance to: [%s]", buf);
pair = std::make_pair("whiteBalanceValue",
- std::to_string(static_cast<int>(entry->data[0])));
+ picojson::value(static_cast<double>(entry->data[0])));
result_obj->insert(pair);
break;
}
// RATIONAL - 3
GCSPosition longitude;
if (GetGCSPositionFromEntry(entry, exif_data, longitude)) {
- pair = std::make_pair("gpsLongitudeDegrees", std::to_string(longitude.degrees.toDouble()));
+ pair = std::make_pair("gpsLongitudeDegrees", picojson::value(longitude.degrees.toDouble()));
result_obj->insert(pair);
- pair = std::make_pair("gpsLongitudeMinutes", std::to_string(longitude.minutes.toDouble()));
+ pair = std::make_pair("gpsLongitudeMinutes", picojson::value(longitude.minutes.toDouble()));
result_obj->insert(pair);
- pair = std::make_pair("gpsLongitudeSeconds", std::to_string(longitude.seconds.toDouble()));
+ pair = std::make_pair("gpsLongitudeSeconds", picojson::value(longitude.seconds.toDouble()));
result_obj->insert(pair);
LoggerD("Setting ExifInformation gps longitude to: %s; %s; %s valid:%d",
longitude.degrees.toString().c_str(),
const char ref = static_cast<char>(entry->data[0]);
if ('E' == ref || 'e' == ref) { // East
- pair = std::make_pair("gpsLongitudeRef", std::string("EAST"));
+ pair = std::make_pair("gpsLongitudeRef", picojson::value("EAST"));
result_obj->insert(pair);
LoggerD("Setting ExifInformation gps longitude REF to: EAST");
} else if ('W' == ref || 'w' == ref) { // West
- pair = std::make_pair("gpsLongitudeRef", std::string("WEST"));
+ pair = std::make_pair("gpsLongitudeRef", picojson::value("WEST"));
result_obj->insert(pair);
LoggerD("Setting ExifInformation gps longitude REF to: WEST");
} else {
GCSPosition latitude;
if (GetGCSPositionFromEntry(entry, exif_data, latitude)) {
- pair = std::make_pair("gpsLatitudeDegrees", std::to_string(latitude.degrees.toDouble()));
+ pair = std::make_pair("gpsLatitudeDegrees", picojson::value(latitude.degrees.toDouble()));
result_obj->insert(pair);
- pair = std::make_pair("gpsLatitudeMinutes", std::to_string(latitude.minutes.toDouble()));
+ pair = std::make_pair("gpsLatitudeMinutes", picojson::value(latitude.minutes.toDouble()));
result_obj->insert(pair);
- pair = std::make_pair("gpsLatitudeSeconds", std::to_string(latitude.seconds.toDouble()));
+ pair = std::make_pair("gpsLatitudeSeconds", picojson::value(latitude.seconds.toDouble()));
result_obj->insert(pair);
LoggerD("Setting ExifInformation gps latitude to: %s; %s; %s valid:%d",
const char ref = static_cast<char>(entry->data[0]);
if ('N' == ref || 'n' == ref) { // North
- pair = std::make_pair("gpsLatitudeRef", std::string("NORTH"));
+ pair = std::make_pair("gpsLatitudeRef", picojson::value("NORTH"));
result_obj->insert(pair);
LoggerD("Setting ExifInformation gps latitude REF to: NORTH");
} else if ('S' == ref || 's' == ref) { // South
- pair = std::make_pair("gpsLatitudeRef", std::string("SOUTH"));
+ pair = std::make_pair("gpsLatitudeRef", picojson::value("SOUTH"));
+ result_obj->insert(pair);
LoggerD("Setting ExifInformation gps latitude REF to: SOUTH");
} else {
LoggerW("Unknown latitude ref: %c (0x%x)", ref, static_cast<int>(ref));
if (gps_altitude.isValid()) {
LoggerD("Setting ExifInformation gps altitude to: %f (%s)",
gps_altitude.toDouble(), gps_altitude.toString().c_str());
- pair = std::make_pair("gpsAltitude", std::to_string(gps_altitude.toDouble()));
+ pair = std::make_pair("gpsAltitude", picojson::value(gps_altitude.toDouble()));
result_obj->insert(pair);
} else {
LoggerW("Couldn't set ExifInformation - gps altitude is not valid: %s",
case EXIF_TAG_GPS_ALTITUDE_REF: {
// BYTE - 1
const ExifByte altitude_ref = static_cast<ExifByte>(entry->data[0]);
- pair = std::make_pair("gpsAltitudeRef", std::to_string(static_cast<int>(altitude_ref)));
+ pair = std::make_pair("gpsAltitudeRef", picojson::value(static_cast<double>(altitude_ref)));
+ result_obj->insert(pair);
LoggerD("Setting ExifInformation gps altitude ref to: %d (%s)",
static_cast<int>(altitude_ref),
(altitude_ref > 0) ? "below sea level" : "above sea level");
if (DecomposeExifUndefined(entry, type, value)) {
LoggerD("Extracted GPSProcessingMethod: [%s], len:%d, type:%s",
value.c_str(), value.length(), type.c_str());
- pair = std::make_pair("gpsProcessingMethod", value);
+ pair = std::make_pair("gpsProcessingMethod", picojson::value(value));
result_obj->insert(pair);
} else {
LoggerW("GPSProcessingMethod tag contains invalid values!");
}
case EXIF_TAG_GPS_DATE_STAMP: {
// ASCII - 11
- pair = std::make_pair("gpsExifDate", std::string(buf));
+ pair = std::make_pair("gpsExifDate", picojson::value(std::string(buf)));
result_obj->insert(pair);
- LoggerD("Setting ExifInformation gps date stamp to %s", pair.second.c_str());
+ LoggerD("Setting ExifInformation gps date stamp to %s", std::string(buf).c_str());
break;
}
case EXIF_TAG_GPS_TIME_STAMP: {
Rationals time;
if (GetRationalsFromEntry(entry, exif_data, 3, time)) {
- pair = std::make_pair("gpsExifTimeHours", std::to_string(time[0].toDouble()));
+ pair = std::make_pair("gpsExifTimeHours", picojson::value(time[0].toDouble()));
result_obj->insert(pair);
- pair = std::make_pair("gpsExifTimeMinutes", std::to_string(time[1].toDouble()));
+ pair = std::make_pair("gpsExifTimeMinutes", picojson::value(time[1].toDouble()));
result_obj->insert(pair);
- pair = std::make_pair("gpsExifTimeSeconds", std::to_string(time[2].toDouble()));
+ pair = std::make_pair("gpsExifTimeSeconds", picojson::value(time[2].toDouble()));
result_obj->insert(pair);
}
break;
LoggerD("Extracted UserComment: [%s], len:%d, type:%s",
value.c_str(), value.length(), type.c_str());
- pair = std::make_pair("userComment", value);
+ pair = std::make_pair("userComment", picojson::value(value));
result_obj->insert(pair);
} else {
LoggerW("UserComment tag contains invalid values!");
ed = NULL;
// uri is not taken from jgp Exif, so we add it here
- holder.result_obj_ptr->insert(std::make_pair("uri", uri));
+ holder.result_obj_ptr->insert(std::make_pair("uri", picojson::value(uri)));
return result;
}