namespace exif {
GCSPosition::GCSPosition() {
+ LoggerD("Enter");
}
GCSPosition::GCSPosition(Rational _degrees, Rational _minutes,
degrees(_degrees),
minutes(_minutes),
seconds(_seconds) {
+ LoggerD("Enter");
}
bool GCSPosition::isValid() const {
+ LoggerD("Enter");
if (!(degrees.isValid() && minutes.isValid() && seconds.isValid())) {
return false;
}
}
double GCSPosition::toDouble() const {
+ LoggerD("Enter");
const double degrees_value = degrees.toDouble();
const double minutes_value = minutes.toDouble();
const double seconds_value = seconds.toDouble();
}
Rationals GCSPosition::toRationalsVector() const {
+ LoggerD("Enter");
Rationals vec;
vec.push_back(degrees);
vec.push_back(minutes);
}
std::string GCSPosition::toDebugString() const {
+ LoggerD("Enter");
std::stringstream ss;
ss << degrees.toString() << "d ";
ss << minutes.toString() << "m ";
m_longitude_ref(GPS_LOCATION_WEST),
m_latitude_ref(GPS_LOCATION_NORTH) {
for (int i = 0; i < EXIF_GPS_LOCATION_ATTRIBUTE_NUMBER_OF_ATTRIBUTES; ++i) {
+ LoggerD("Enter");
m_is_set[i] = false;
}
LoggerE("ExifGPSLocation::ExifGPSLocation()");
}
ExifGPSLocation::ExifGPSLocation(double longitude, double latitude) {
+ LoggerD("Enter");
for (int i = 0; i < EXIF_GPS_LOCATION_ATTRIBUTE_NUMBER_OF_ATTRIBUTES; ++i) {
m_is_set[i] = false;
}
}
void ExifGPSLocation::setLongitude(const GCSPosition& longitude) {
+ LoggerD("Enter");
if (!longitude.isValid()) {
LoggerW("longitude is not valid!");
return;
}
const GCSPosition& ExifGPSLocation::getLongitude() const {
+ LoggerD("Enter");
return m_longitude;
}
void ExifGPSLocation::setLongitudeRef(GPSLocationDirectionLongitude ref) {
+ LoggerD("Enter");
m_is_set[EXIF_GPS_LOCATION_ATTRIBUTE_LONGITUDE_REF] = true;
m_longitude_ref = ref;
}
GPSLocationDirectionLongitude ExifGPSLocation::getLongitudeRef() const {
+ LoggerD("Enter");
return m_longitude_ref;
}
void ExifGPSLocation::setLatitude(const GCSPosition& latitude) {
+ LoggerD("Enter");
if (!latitude.isValid()) {
LoggerW("latitude is not valid!");
return;
}
const GCSPosition& ExifGPSLocation::getLatitude() const {
+ LoggerD("Enter");
return m_latitude;
}
void ExifGPSLocation::setLatitudeRef(GPSLocationDirectionLatitude ref) {
+ LoggerD("Enter");
m_is_set[EXIF_GPS_LOCATION_ATTRIBUTE_LATITUDE_REF] = true;
m_latitude_ref = ref;
}
GPSLocationDirectionLatitude ExifGPSLocation::getLatitudeRef() const {
+ LoggerD("Enter");
return m_latitude_ref;
}
bool ExifGPSLocation::isSet(ExifGPSLocationAttributes attribute) const {
+ LoggerD("Enter");
return m_is_set[attribute];
}
void ExifGPSLocation::unset(ExifGPSLocationAttributes attribute) {
+ LoggerD("Enter");
m_is_set[attribute] = false;
}
void ExifGPSLocation::unsetAll() {
+ LoggerD("Enter");
m_is_set[EXIF_GPS_LOCATION_ATTRIBUTE_LONGITUDE] = false;
m_is_set[EXIF_GPS_LOCATION_ATTRIBUTE_LONGITUDE_REF] = false;
m_longitude = GCSPosition();
}
bool ExifGPSLocation::isComplete() const {
+ LoggerD("Enter");
return m_is_set[EXIF_GPS_LOCATION_ATTRIBUTE_LONGITUDE] &&
m_is_set[EXIF_GPS_LOCATION_ATTRIBUTE_LONGITUDE_REF] &&
m_is_set[EXIF_GPS_LOCATION_ATTRIBUTE_LATITUDE] &&
bool ExifGPSLocation::isValid() const {
+ LoggerD("Enter");
return isComplete() && m_latitude.isValid() && m_longitude.isValid();
}
double ExifGPSLocation::getLongitudeValue() const {
+ LoggerD("Enter");
const double longitude_dir =
(m_longitude_ref == GPS_LOCATION_WEST) ? -1.0f : 1.0f;
const double longitude = m_longitude.toDouble() * longitude_dir;
}
double ExifGPSLocation::getLatitudeValue() const {
+ LoggerD("Enter");
const double latitude_dir =
(m_latitude_ref == GPS_LOCATION_SOUTH) ? -1.0f : 1.0f;
const double latitude = m_latitude.toDouble() * latitude_dir;
}
IsoSpeedRatingsVector jsonArray2vector(const picojson::value& a) {
+ LoggerD("Enter");
if (!a.is<picojson::array>()) {
return IsoSpeedRatingsVector();
}
} // namespace
ExifInformation::ExifInformation() {
+ LoggerD("Enter");
for (int attr = 0;
attr < EXIF_INFORMATION_ATTRIBUTE_NUMBER_OF_ATTRIBUTES; attr++) {
unset(static_cast<ExifInformationAttribute>(attr));
}
ExifInformation::ExifInformation(const picojson::value& args) {
+ LoggerD("Enter");
for (int attr = 0;
attr < EXIF_INFORMATION_ATTRIBUTE_NUMBER_OF_ATTRIBUTES; attr++) {
unset(static_cast<ExifInformationAttribute>(attr));
}
}
-ExifInformation::~ExifInformation() { }
+ExifInformation::~ExifInformation() {
+ LoggerD("Enter");
+ }
const std::string& ExifInformation::getUri() {
LoggerD("Entered");
void ExifTagSaver::saveToExif(long int value, ExifTag tag,
ExifData* exif_data) {
+ LoggerD("Entered");
ExifEntry* entry = prepareEntry(exif_data, tag);
if (!entry) {
// TODO return PlatformResult and handle error
void ExifTagSaver::saveToExif(const std::string& value, ExifTag tag,
ExifData* exif_data, ExifFormat format,
bool add_zero_character) {
+ LoggerD("Entered");
ExifEntry* entry = prepareEntry(exif_data, tag);
if (!entry) {
// TODO return PlatformResult and handle error
void ExifTagSaver::saveToExif(const Rational& value, ExifTag tag,
ExifData* exif_data) {
+ LoggerD("Entered");
ExifEntry* entry = prepareEntry(exif_data, tag);
if (!entry) {
// TODO return PlatformResult and handle error
void ExifTagSaver::saveToExif(const Rationals& value, ExifTag tag,
ExifData* exif_data) {
+ LoggerD("Entered");
ExifEntry* entry = prepareEntry(exif_data, tag);
if (!entry) {
// TODO return PlatformResult and handle error
void ExifTagSaver::saveToExif(std::vector<long long int>& value,
ExifFormat store_as,
ExifTag tag, ExifData* exif_data) {
+ LoggerD("Entered");
ExifEntry* entry = prepareEntry(exif_data, tag);
if (!entry) {
// TODO return PlatformResult and handle error
void ExifTagSaver::saveGpsLocationToExif(const ExifGPSLocation& gps_info,
ExifData* exif_data) {
+ LoggerD("Entered");
if (gps_info.isSet(EXIF_GPS_LOCATION_ATTRIBUTE_LATITUDE)) {
auto latitude = gps_info.getLatitude();
LoggerD("Saving latitude: %s", latitude.toDebugString().c_str());
}
ExifIfd ExifTagSaver::deduceIfdSection(ExifTag tag) {
+ LoggerD("Entered");
// TODO EXIF_TAG_* and EXIF_TAG_GPS_* are sharing same values,
// they shouldn't be used in one switch statement.
}
ExifFormat ExifTagSaver::deduceDataFormat(ExifTag tag) {
+ LoggerD("Entered");
// TODO EXIF_TAG_* and EXIF_TAG_GPS_* are sharing same values,
// they shouldn't be used in one switch statement.
};
Rational GetRationalFromEntry(ExifEntry *entry, ExifData* exif_data) {
+ LoggerD("Entered");
if (EXIF_FORMAT_RATIONAL == entry->format
&& entry->components >= 1
&& entry->data) {
bool GetRationalsFromEntry(ExifEntry* entry, ExifData* exif_data,
unsigned long required_count,
Rationals& out_rationals) {
+ LoggerD("Entered");
if (EXIF_FORMAT_RATIONAL == entry->format &&
entry->components >= required_count &&
entry->data) {
bool GetGCSPositionFromEntry(ExifEntry* entry, ExifData* exif_data,
GCSPosition& out_pos) {
// RATIONAL - 3
+ LoggerD("Entered");
if (EXIF_FORMAT_RATIONAL == entry->format &&
entry->components >= 3 &&
entry->data) {
}
bool DecomposeExifUndefined(ExifEntry* entry, std::string& type, std::string& value) {
+ LoggerD("Entered");
if (!entry || !entry->data) {
LoggerW("exif entry is NULL/empty");
return false;
PlatformResult GetExifInfo::ProcessEntry(ExifEntry* entry,
ExifData* exif_data,
JsonObject* result_obj) {
+ LoggerD("Entered");
char buf[2000];
exif_entry_get_value(entry, buf, sizeof(buf));
ExifUtil::printExifEntryInfo(entry, exif_data);
}
void GetExifInfo::ContentForeachFunctionProxy(ExifEntry *entry, void *user_data) {
+ LoggerD("Entered");
ExifDataHolder* holder = static_cast<ExifDataHolder*>(user_data);
if (!holder) {
LoggerE("holder is NULL");
PlatformResult GetExifInfo::LoadFromURI(const std::string& uri,
JsonValue* result) {
+ LoggerD("Entered");
// TODO(r.galka) it can be done on JS side
const std::string& file_path = ExifUtil::convertUriToPath(uri);
ExifData* ed = exif_data_new_from_file(file_path.c_str());
}
PlatformResult JpegFile::loadFile(const std::string& path, JpegFilePtr* jpg_ptr) {
+ LoggerD("Entered");
JpegFile* new_jpg = new (std::nothrow) JpegFile();
if (!new_jpg) {
LoggerE("Couldn't allocate Jpegfile!");
std::string JpegFile::getPartOfFile(const std::size_t offset,
const std::size_t num_bytes_before,
const std::size_t num_bytes_after) {
+ LoggerD("Entered");
long long int start = static_cast<long long int>(offset) - num_bytes_before;
if (start < 0) {
start = 0;
}
PlatformResult JpegFile::setNewExifData(ExifData* new_exif_data) {
+ LoggerD("Entered");
AssertMsg(new_exif_data, "Trying to set NULL exif_data!");
JpegFileSectionPtr exif = getExifSection();
}
ExifData* JpegFile::getExifData() {
+ LoggerD("Entered");
JpegFileSectionPtr exif = getExifSection();
if (!exif) {
return NULL;
}
JpegFileSectionPtr JpegFile::getExifSection() {
+ LoggerD("Entered");
std::size_t num_exif_sections = 0;
JpegFileSectionPtr first_exif_section;