@@ -136,9 +136,9 @@ ExifFormat::print_buff(const char* buf, int sz, const char* cmt)
136
136
{
137
137
int i;
138
138
139
- printf (" %s: " , cmt);
139
+ db. log (" %s: " , cmt);
140
140
for (i = 0 ; i < sz; i++) {
141
- printf (" %02x " , buf[i] & 0xFF );
141
+ db. log (" %02x " , buf[i] & 0xFF );
142
142
}
143
143
for (i = 0 ; i < sz; i++) {
144
144
char c = buf[i];
@@ -147,7 +147,7 @@ ExifFormat::print_buff(const char* buf, int sz, const char* cmt)
147
147
} else if (! isprint (c)) {
148
148
c = ' .' ;
149
149
}
150
- printf (" %c" , c);
150
+ db. log (" %c" , c);
151
151
}
152
152
}
153
153
@@ -320,12 +320,12 @@ ExifFormat::exif_load_apps()
320
320
app->marker = gbfgetuint16 (fin_);
321
321
app->len = gbfgetuint16 (fin_);
322
322
if (global_opts.debug_level >= 3 ) {
323
- printf (" api = %02X, len = %u (0x%04x), offs = 0x%08X\n " , app->marker & 0xFF , app->len , app->len , gbftell (fin_));
323
+ db. log (" api = %02X, len = %u (0x%04x), offs = 0x%08X\n " , app->marker & 0xFF , app->len , app->len , gbftell (fin_));
324
324
}
325
325
if (exif_app_ || (app->marker == 0xFFDA )) { /* compressed data */
326
326
gbfcopyfrom (app->fcache , fin_, 0x7FFFFFFF );
327
327
if (global_opts.debug_level >= 3 ) {
328
- printf (" compressed data size = %u\n " , gbftell (app->fcache ));
328
+ db. log (" compressed data size = %u\n " , gbftell (app->fcache ));
329
329
}
330
330
} else {
331
331
gbfcopyfrom (app->fcache , fin_, app->len - 2 );
@@ -401,7 +401,7 @@ ExifFormat::exif_read_ifd(ExifApp* app, const uint16_t ifd_nr, const gbsize_t of
401
401
name = " private" ;
402
402
break ;
403
403
}
404
- printf (" offs 0x%08X: Number of items in IFD%d \" %s\" = %d (0x%04x)\n " ,
404
+ db. log (" offs 0x%08X: Number of items in IFD%d \" %s\" = %d (0x%04x)\n " ,
405
405
offs, ifd_nr, name, ifd->count , ifd->count );
406
406
}
407
407
if (ifd->count == 0 ) {
@@ -520,57 +520,57 @@ ExifFormat::exif_read_ifd(ExifApp* app, const uint16_t ifd_nr, const gbsize_t of
520
520
}
521
521
}
522
522
if (global_opts.debug_level >= 3 ) {
523
- printf (" offs 0x%08X: ifd=%d id=0x%04X t=0x%04X c=%4u s=%4u" ,
523
+ db. log (" offs 0x%08X: ifd=%d id=0x%04X t=0x%04X c=%4u s=%4u" ,
524
524
tag->tag_offset , ifd->nr , tag->id , tag->type , tag->count , tag->size );
525
525
if (tag->size > 4 ) {
526
- printf (" o=0x%08X" , tag->offset );
526
+ db. log (" o=0x%08X" , tag->offset );
527
527
} else {
528
- printf (" v=0x%02X%02X%02X%02X" , tag->raw [0 ], tag->raw [1 ], tag->raw [2 ], tag->raw [3 ]);
528
+ db. log (" v=0x%02X%02X%02X%02X" , tag->raw [0 ], tag->raw [1 ], tag->raw [2 ], tag->raw [3 ]);
529
529
}
530
530
if (tag->type == EXIF_TYPE_ASCII) {
531
531
QByteArray str = exif_read_str (tag);
532
- printf (" \" %s\" " , str.constData ());
532
+ db. log (" \" %s\" " , str.constData ());
533
533
} else {
534
534
for (unsigned idx = 0 ; idx < std::min (tag->count , 4u ); ++idx) {
535
535
if (tag->type == EXIF_TYPE_BYTE) {
536
- printf (" %u" , tag->data .at (0 ).toByteArray ().at (idx));
536
+ db. log (" %u" , tag->data .at (0 ).toByteArray ().at (idx));
537
537
} else if (tag->type == EXIF_TYPE_SBYTE) {
538
- printf (" %d" , tag->data .at (0 ).toByteArray ().at (idx));
538
+ db. log (" %d" , tag->data .at (0 ).toByteArray ().at (idx));
539
539
} else if (tag->type == EXIF_TYPE_UNK) {
540
- printf (" 0x%02X" , tag->data .at (0 ).toByteArray ().at (idx));
540
+ db. log (" 0x%02X" , tag->data .at (0 ).toByteArray ().at (idx));
541
541
} else if (tag->type == EXIF_TYPE_RAT) {
542
- printf (" %+#g(%u/%u)" , exif_read_double (tag, idx), tag->data .at (idx * 2 ).value <uint32_t >(), tag->data .at ((idx * 2 ) + 1 ).value <uint32_t >());
542
+ db. log (" %+#g(%u/%u)" , exif_read_double (tag, idx), tag->data .at (idx * 2 ).value <uint32_t >(), tag->data .at ((idx * 2 ) + 1 ).value <uint32_t >());
543
543
} else if (tag->type == EXIF_TYPE_SRAT) {
544
- printf (" %+#g(%d/%d)" , exif_read_double (tag, idx), tag->data .at (idx * 2 ).value <int32_t >(), tag->data .at ((idx * 2 ) + 1 ).value <int32_t >());
544
+ db. log (" %+#g(%d/%d)" , exif_read_double (tag, idx), tag->data .at (idx * 2 ).value <int32_t >(), tag->data .at ((idx * 2 ) + 1 ).value <int32_t >());
545
545
} else if (tag->type == EXIF_TYPE_SHORT) {
546
- printf (" %u" , tag->data .at (idx).value <uint16_t >());
546
+ db. log (" %u" , tag->data .at (idx).value <uint16_t >());
547
547
} else if (tag->type == EXIF_TYPE_SSHORT) {
548
- printf (" %d" , tag->data .at (idx).value <int16_t >());
548
+ db. log (" %d" , tag->data .at (idx).value <int16_t >());
549
549
} else if (tag->type == EXIF_TYPE_LONG) {
550
- printf (" %u" , tag->data .at (idx).value <uint32_t >());
550
+ db. log (" %u" , tag->data .at (idx).value <uint32_t >());
551
551
} else if (tag->type == EXIF_TYPE_SLONG) {
552
- printf (" %d" , tag->data .at (idx).value <int32_t >());
552
+ db. log (" %d" , tag->data .at (idx).value <int32_t >());
553
553
} else if (tag->type == EXIF_TYPE_FLOAT) {
554
- printf (" %+#g" , tag->data .at (idx).value <float >());
554
+ db. log (" %+#g" , tag->data .at (idx).value <float >());
555
555
} else if (tag->type == EXIF_TYPE_DOUBLE) {
556
- printf (" %+#g" , tag->data .at (idx).value <double >());
556
+ db. log (" %+#g" , tag->data .at (idx).value <double >());
557
557
} else {
558
- printf (" 0x%0*X" , 2 * exif_type_size (tag->type ), tag->data .at (idx).value <uint32_t >());
558
+ db. log (" 0x%0*X" , 2 * exif_type_size (tag->type ), tag->data .at (idx).value <uint32_t >());
559
559
}
560
560
}
561
561
if (tag->count > 4 ) {
562
- printf (" ..." );
562
+ db. log (" ..." );
563
563
}
564
564
}
565
- printf (" \n " );
565
+ db. log (" \n " );
566
566
}
567
567
#ifndef NDEBUG
568
568
exif_validate_tag_structure (tag);
569
569
#endif
570
570
}
571
571
572
572
if (global_opts.debug_level >= 3 ) {
573
- printf (" offs 0x%08X: Next IFD=0x%08X\n " , next_ifd_offs, ifd->next_ifd );
573
+ db. log (" offs 0x%08X: Next IFD=0x%08X\n " , next_ifd_offs, ifd->next_ifd );
574
574
}
575
575
576
576
return ifd;
@@ -587,9 +587,9 @@ ExifFormat::exif_read_app(ExifApp* app)
587
587
gbfile* fin = app->fexif ;
588
588
589
589
if (global_opts.debug_level >= 3 ) {
590
- printf (" read_app...\n " );
590
+ db. log (" read_app...\n " );
591
591
print_buff ((const char *)fin->handle .mem , 8 , " offs 0x00000000: Image File Header" );
592
- printf (" \n " );
592
+ db. log (" \n " );
593
593
}
594
594
exif_ifd_ofs = gps_ifd_ofs = inter_ifd_ofs = 0 ;
595
595
@@ -633,7 +633,7 @@ ExifFormat::exif_examine_app(ExifApp* app)
633
633
uint16_t endianness = gbfgetint16 (ftmp);
634
634
635
635
if (global_opts.debug_level >= 3 ) {
636
- printf (" endianness = 0x%04X\n " , endianness);
636
+ db. log (" endianness = 0x%04X\n " , endianness);
637
637
}
638
638
if (endianness == 0x4949 ) {
639
639
ftmp->big_endian = 0 ;
@@ -680,7 +680,7 @@ ExifFormat::exif_find_tag(ExifApp* app, const uint16_t ifd_nr, const uint16_t ta
680
680
}
681
681
682
682
QDateTime
683
- ExifFormat::exif_get_exif_time (ExifApp* app) const
683
+ ExifFormat::exif_get_exif_time (ExifApp* app)
684
684
{
685
685
QDateTime res;
686
686
@@ -755,7 +755,7 @@ ExifFormat::exif_get_exif_time(ExifApp* app) const
755
755
}
756
756
757
757
Waypoint*
758
- ExifFormat::exif_waypt_from_exif_app (ExifApp* app) const
758
+ ExifFormat::exif_waypt_from_exif_app (ExifApp* app)
759
759
{
760
760
ExifTag* tag;
761
761
char lat_ref = ' \0 ' ;
@@ -848,8 +848,8 @@ ExifFormat::exif_waypt_from_exif_app(ExifApp* app) const
848
848
}
849
849
850
850
if (global_opts.debug_level >= 3 ) {
851
- printf (" GPSLatitude = %12.7f\n " , wpt->latitude );
852
- printf (" GPSLongitude = %12.7f\n " , wpt->longitude );
851
+ db. log (" GPSLatitude = %12.7f\n " , wpt->latitude );
852
+ db. log (" GPSLongitude = %12.7f\n " , wpt->longitude );
853
853
}
854
854
if (!datum.isEmpty ()) {
855
855
int idatum = gt_lookup_datum_index (datum);
@@ -879,7 +879,7 @@ ExifFormat::exif_waypt_from_exif_app(ExifApp* app) const
879
879
}
880
880
wpt->altitude = sign * alt;
881
881
if (global_opts.debug_level >= 3 ) {
882
- printf (" GPSAltitude = %12.7f m\n " , wpt->altitude );
882
+ db. log (" GPSAltitude = %12.7f m\n " , wpt->altitude );
883
883
}
884
884
}
885
885
@@ -900,7 +900,7 @@ ExifFormat::exif_waypt_from_exif_app(ExifApp* app) const
900
900
}
901
901
if (global_opts.debug_level >= 3 ) {
902
902
if (wpt->speed_has_value ()) {
903
- printf (" GPSSpeed = %12.2f m/s\n " , wpt->speed_value ());
903
+ db. log (" GPSSpeed = %12.2f m/s\n " , wpt->speed_value ());
904
904
}
905
905
}
906
906
}
@@ -920,7 +920,7 @@ ExifFormat::exif_waypt_from_exif_app(ExifApp* app) const
920
920
gps_datetime = QDateTime (datestamp, timestamp, QtUTC);
921
921
if (gps_datetime.isValid ()) {
922
922
if (global_opts.debug_level >= 3 ) {
923
- printf (" GPSTimeStamp = %s\n " , qPrintable (gps_datetime.toString (Qt::ISODateWithMs)));
923
+ db. log (" GPSTimeStamp = %s\n " , qPrintable (gps_datetime.toString (Qt::ISODateWithMs)));
924
924
}
925
925
wpt->SetCreationTime (gps_datetime);
926
926
} else {
@@ -1005,7 +1005,7 @@ ExifFormat::Rational<int32_t> ExifFormat::exif_dec2frac(double val, double toler
1005
1005
}
1006
1006
1007
1007
ExifFormat::ExifTag*
1008
- ExifFormat::exif_put_value (const int ifd_nr, const uint16_t tag_id, const uint16_t type, const int count, const int index, const void * data) const
1008
+ ExifFormat::exif_put_value (const int ifd_nr, const uint16_t tag_id, const uint16_t type, const int count, const int index, const void * data)
1009
1009
{
1010
1010
ExifTag* tag = nullptr ;
1011
1011
uint16_t size;
@@ -1108,7 +1108,7 @@ ExifFormat::exif_put_value(const int ifd_nr, const uint16_t tag_id, const uint16
1108
1108
1109
1109
1110
1110
void
1111
- ExifFormat::exif_put_double (const int ifd_nr, const int tag_id, const int index, const double val) const
1111
+ ExifFormat::exif_put_double (const int ifd_nr, const int tag_id, const int index, const double val)
1112
1112
{
1113
1113
// TODO: It seems wrong to throw away the sign.
1114
1114
double d = fabs (val);
@@ -1117,14 +1117,14 @@ ExifFormat::exif_put_double(const int ifd_nr, const int tag_id, const int index,
1117
1117
1118
1118
1119
1119
void
1120
- ExifFormat::exif_put_str (const int ifd_nr, const int tag_id, const char * val) const
1120
+ ExifFormat::exif_put_str (const int ifd_nr, const int tag_id, const char * val)
1121
1121
{
1122
1122
int len = (val) ? strlen (val) + 1 : 0 ;
1123
1123
exif_put_value (ifd_nr, tag_id, EXIF_TYPE_ASCII, len, 0 , val);
1124
1124
}
1125
1125
1126
1126
void
1127
- ExifFormat::exif_put_coord (const int ifd_nr, const int tag_id, const double val) const
1127
+ ExifFormat::exif_put_coord (const int ifd_nr, const int tag_id, const double val)
1128
1128
{
1129
1129
double vdeg;
1130
1130
double vmin;
@@ -1140,19 +1140,19 @@ ExifFormat::exif_put_coord(const int ifd_nr, const int tag_id, const double val)
1140
1140
}
1141
1141
1142
1142
void
1143
- ExifFormat::exif_put_long (const int ifd_nr, const int tag_id, const int index, const int32_t val) const
1143
+ ExifFormat::exif_put_long (const int ifd_nr, const int tag_id, const int index, const int32_t val)
1144
1144
{
1145
1145
exif_put_value (ifd_nr, tag_id, EXIF_TYPE_LONG, 1 , index, &val);
1146
1146
}
1147
1147
1148
1148
void
1149
- ExifFormat::exif_put_short (const int ifd_nr, const int tag_id, const int index, const int16_t val) const
1149
+ ExifFormat::exif_put_short (const int ifd_nr, const int tag_id, const int index, const int16_t val)
1150
1150
{
1151
1151
exif_put_value (ifd_nr, tag_id, EXIF_TYPE_SHORT, 1 , index, &val);
1152
1152
}
1153
1153
1154
1154
void
1155
- ExifFormat::exif_remove_tag (const int ifd_nr, const int tag_id) const
1155
+ ExifFormat::exif_remove_tag (const int ifd_nr, const int tag_id)
1156
1156
{
1157
1157
exif_put_value (ifd_nr, tag_id, EXIF_TYPE_BYTE, 0 , 0 , nullptr );
1158
1158
}
@@ -1307,7 +1307,7 @@ ExifFormat::exif_write_ifd(ExifIfd* ifd, const char next, gbfile* fout)
1307
1307
}
1308
1308
1309
1309
void
1310
- ExifFormat::exif_write_apps () const
1310
+ ExifFormat::exif_write_apps ()
1311
1311
{
1312
1312
gbfputuint16 (0xFFD8 , fout_);
1313
1313
0 commit comments