Added text edit field to edit gps data. Works.

This commit is contained in:
Austen Adler 2014-06-25 19:58:22 -04:00
parent ab3fe277b5
commit ad161bdb70
4 changed files with 26 additions and 15 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.0.1, 2014-06-23T22:55:24. -->
<!-- Written by QtCreator 3.0.1, 2014-06-25T16:15:57. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>

View File

@ -132,3 +132,22 @@ void Picture::on_processButton_clicked(){
ui->log->append("Done processing metadata");
}
//}}}
void Picture::on_fileList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous) {
ui->gpsData->clear();
QString tmp=current->text();
std::string tmp2=tmp.toStdString();
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(tmp2);
assert(image.get()!=0);
image->readMetadata();
Exiv2::ExifData &exifData=image->exifData();
std::string arrStr[7]={"GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp"};
for(int i=0;i<7;i++){
Exiv2::Exifdatum gps=exifData["Exif.GPSInfo."+arrStr[i]];
std::string a;
a=gps.toString();
ui->gpsData->append(QString::fromStdString(a));
//qDebug()<<arrStr[i];
}
/* ui->gpsData->append(GPSLatitudeRef.toString()); */
}

View File

@ -37,6 +37,8 @@ class Picture : public QMainWindow {
void on_clearLog_clicked();
void on_processButton_clicked();
void on_processButton_pressed();
void on_fileList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
private:
Ui::Picture *ui;
QDir directory;

View File

@ -59,17 +59,7 @@
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
<widget class="QTextEdit" name="gpsData"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
@ -112,7 +102,7 @@
<item>
<widget class="QCheckBox" name="eraseGpsData">
<property name="text">
<string>Erase GPS Data</string>
<string>Set GPS Data From Above</string>
</property>
</widget>
</item>