exif copy, global tag lists
This commit is contained in:
Binary file not shown.
@@ -188,12 +188,13 @@ public:
|
||||
class cEXIFTag
|
||||
{
|
||||
public:
|
||||
cEXIFTag(const qint32& iTAGID, const QString& szTAGName, const qint32& iIFDID, const qint32& iTypeID, const QString& szDescription);
|
||||
cEXIFTag(const qint32& iTAGID, const QString& szTAGName, const QString& szIFD, const QString& szKey, const QString& szType, const QString& szDescription);
|
||||
|
||||
qint32 m_iTAGID; /*!< TODO: describe */
|
||||
QString m_szTAGName; /*!< TODO: describe */
|
||||
qint32 m_iIFDID; /*!< TODO: describe */
|
||||
qint32 m_iTypeID; /*!< TODO: describe */
|
||||
QString m_szIFD; /*!< TODO: describe */
|
||||
QString m_szKey; /*!< TODO: describe */
|
||||
QString m_szType; /*!< TODO: describe */
|
||||
QString m_szDescription; /*!< TODO: describe */
|
||||
};
|
||||
|
||||
@@ -215,21 +216,38 @@ public:
|
||||
\fn add
|
||||
\param iTAGID
|
||||
\param szTAGName
|
||||
\param iIFDID
|
||||
\param iTypeID
|
||||
\param szIFD
|
||||
\param szType
|
||||
\param szDescription
|
||||
\return cEXIFTag
|
||||
*/
|
||||
cEXIFTag* add(const qint32& iTAGID, const QString& szTAGName, const qint32& iIFDID, const qint32& iTypeID, const QString& szDescription);
|
||||
cEXIFTag* add(const qint32& iTAGID, const QString& szTAGName, const QString& szIFD, const QString& szKey, const QString& szType, const QString& szDescription);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn find
|
||||
\param szKey
|
||||
\return cEXIFTag
|
||||
*/
|
||||
cEXIFTag* find(const QString& szKey);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn find
|
||||
\param iTAGID
|
||||
\param iIFDID
|
||||
\param szIFD
|
||||
\return cEXIFTag
|
||||
*/
|
||||
cEXIFTag* find(const qint32& iTAGID, const qint32& iIFDID);
|
||||
cEXIFTag* find(const qint32& iTAGID, const QString& szIFD);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn find
|
||||
\param szTAG
|
||||
\param szIFD
|
||||
\return cEXIFTag
|
||||
*/
|
||||
cEXIFTag* find(const QString& szTAG, const QString& szIFD);
|
||||
};
|
||||
|
||||
/*!
|
||||
@@ -589,7 +607,7 @@ public:
|
||||
class cEXIF
|
||||
{
|
||||
public:
|
||||
cEXIF();
|
||||
cEXIF(cEXIFTagList* lpEXIFTagList, cEXIFCompressionList* lpEXIFCompressionList, cEXIFLightSourceList* lpEXIFLightSourceList, cEXIFFlashList* lpEXIFFlashList, cIPTCTagList* lpIPTCTagList, cXMPTagList* lpXMPTagList);
|
||||
|
||||
/*!
|
||||
\brief
|
||||
@@ -783,6 +801,14 @@ public:
|
||||
*/
|
||||
QImage thumbnail();
|
||||
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn copyTo
|
||||
\param fileName
|
||||
*/
|
||||
bool copyTo(const QString& fileName);
|
||||
|
||||
private:
|
||||
cEXIFValueList m_exifValueList; /*!< TODO: describe */
|
||||
cIPTCValueList m_iptcValueList; /*!< TODO: describe */
|
||||
@@ -794,24 +820,24 @@ private:
|
||||
QList<QImage> m_previewList; /*!< TODO: describe */
|
||||
QImage m_thumbnail; /*!< TODO: describe */
|
||||
|
||||
cEXIFCompressionList m_exifCompressionList; /*!< TODO: describe */
|
||||
cEXIFLightSourceList m_exifLightSourceList; /*!< TODO: describe */
|
||||
cEXIFFlashList m_exifFlashList; /*!< TODO: describe */
|
||||
cEXIFTagList m_exifTagList; /*!< TODO: describe */
|
||||
cEXIFTagList* m_lpEXIFTagList; /*!< TODO: describe */
|
||||
cEXIFCompressionList* m_lpEXIFCompressionList; /*!< TODO: describe */
|
||||
cEXIFLightSourceList* m_lpEXIFLightSourceList; /*!< TODO: describe */
|
||||
cEXIFFlashList* m_lpEXIFFlashList; /*!< TODO: describe */
|
||||
|
||||
cIPTCTagList m_iptcTagList; /*!< TODO: describe */
|
||||
cIPTCTagList* m_lpIPTCTagList; /*!< TODO: describe */
|
||||
|
||||
cXMPTagList m_xmpTagList; /*!< TODO: describe */
|
||||
cXMPTagList* m_lpXMPTagList; /*!< TODO: describe */
|
||||
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn getEXIFTag
|
||||
\param iTAGID
|
||||
\param iIFDID
|
||||
\param szIFD
|
||||
\return QVariant
|
||||
*/
|
||||
QVariant getEXIFTag(qint32 iTAGID, qint32 iIFDID);
|
||||
QVariant getEXIFTag(qint32 iTAGID, const QString& szIFD);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
@@ -836,7 +862,7 @@ private:
|
||||
\param iIFDID
|
||||
\return QList<QVariant>
|
||||
*/
|
||||
QList<QVariant> getTagList(qint32 iTAGID, qint32 iIFDID);
|
||||
QList<QVariant> getTagList(qint32 iTAGID, const QString& szIFD);
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(cEXIF*)
|
||||
|
||||
@@ -77,6 +77,7 @@ void cExportDialog::saveSettings()
|
||||
else
|
||||
settings.setValue("export/overwrite", QVariant::fromValue(QString("ask")));
|
||||
|
||||
settings.setValue("export/copyEXIF", QVariant::fromValue(ui->m_lpCopyEXIF->isChecked()));
|
||||
settings.setValue("export/fileFormat", QVariant::fromValue(ui->m_lpFileFormat->currentText()));
|
||||
settings.setValue("export/quality", QVariant::fromValue(ui->m_lpQuality->value()));
|
||||
}
|
||||
@@ -200,6 +201,7 @@ void cExportDialog::initUI(const QList<IMAGEFORMAT>& imageFormats)
|
||||
ui->m_lpFileFormat->addItem(i.description + " (" + i.extension + ")");
|
||||
}
|
||||
ui->m_lpFileFormat->setCurrentText(settings.value("export/fileFormat").toString());
|
||||
(ui->m_lpCopyEXIF->setChecked(settings.value("export/copyEXIF", QVariant::fromValue(true)).toBool()));
|
||||
ui->m_lpQuality->setValue(settings.value("export/quality", QVariant::fromValue(50)).toInt());
|
||||
ui->m_lpQualityValue->setText(QString::number(ui->m_lpQuality->value()));
|
||||
|
||||
|
||||
+37
-30
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>554</width>
|
||||
<height>466</height>
|
||||
<height>489</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -94,16 +94,6 @@
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="7" column="0" colspan="3">
|
||||
<widget class="QRadioButton" name="m_lpFileOverwrite">
|
||||
<property name="text">
|
||||
<string>overwrite existing file</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">m_lpFileOverwriteMethod</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QRadioButton" name="m_lpFilenameTag">
|
||||
<property name="text">
|
||||
@@ -114,13 +104,33 @@
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QRadioButton" name="m_lpFilenamePlusConverted">
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="m_lpNewFilename">
|
||||
<property name="text">
|
||||
<string>old filename + _converted</string>
|
||||
<string>rename</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">m_lpFilenameAdd</string>
|
||||
<string notr="true">m_lpFilenameMethod</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="3">
|
||||
<widget class="QRadioButton" name="m_lpFileOverwrite">
|
||||
<property name="text">
|
||||
<string>overwrite existing file</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">m_lpFileOverwriteMethod</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="3">
|
||||
<widget class="QRadioButton" name="m_lpFileRename">
|
||||
<property name="text">
|
||||
<string>auto rename existing file</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">m_lpFileOverwriteMethod</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -134,16 +144,13 @@
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QLineEdit" name="m_lpFileTag"/>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="3">
|
||||
<widget class="QRadioButton" name="m_lpFileRename">
|
||||
<item row="1" column="1">
|
||||
<widget class="QRadioButton" name="m_lpFilenamePlusConverted">
|
||||
<property name="text">
|
||||
<string>auto rename existing file</string>
|
||||
<string>old filename + _converted</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">m_lpFileOverwriteMethod</string>
|
||||
<string notr="true">m_lpFilenameAdd</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -157,6 +164,9 @@
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QLineEdit" name="m_lpFileTag"/>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QLabel" name="m_lpFileTagHelp">
|
||||
<property name="text">
|
||||
@@ -164,14 +174,11 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="m_lpNewFilename">
|
||||
<item row="8" column="0" colspan="3">
|
||||
<widget class="QCheckBox" name="m_lpCopyEXIF">
|
||||
<property name="text">
|
||||
<string>rename</string>
|
||||
<string>copy EXIF data</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">m_lpFilenameMethod</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -289,9 +296,9 @@
|
||||
</connection>
|
||||
</connections>
|
||||
<buttongroups>
|
||||
<buttongroup name="m_lpDirectoryMethod"/>
|
||||
<buttongroup name="m_lpFilenameAdd"/>
|
||||
<buttongroup name="m_lpFileOverwriteMethod"/>
|
||||
<buttongroup name="m_lpFilenameAdd"/>
|
||||
<buttongroup name="m_lpDirectoryMethod"/>
|
||||
<buttongroup name="m_lpFilenameMethod"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
||||
+12
-1
@@ -361,7 +361,7 @@ void cMainWindow::addFile(const QString& file)
|
||||
return;
|
||||
|
||||
QFileInfo info(file);
|
||||
cEXIF* lpExif = new cEXIF;
|
||||
cEXIF* lpExif = new cEXIF(&m_exifTAGList, &m_exifCompressionList, &m_exifLightSourceList, &m_exifFlashList, &m_iptcTagList, &m_xmpTagList);
|
||||
|
||||
if(!lpExif->fromFile(file))
|
||||
{
|
||||
@@ -577,6 +577,7 @@ void cMainWindow::getExportSettings(EXPORTSETTINGS& exportSettings)
|
||||
addToExportLog(m_exportLog, "Existing File Overwrite Mode: <span class='option'>FILE_OVERWRITE_ASK</span>");
|
||||
}
|
||||
|
||||
exportSettings.copyEXIF = settings.value("export/copyEXIF", QVariant::fromValue(true)).toBool();
|
||||
exportSettings.fileFormat = settings.value("export/fileFormat").toString();
|
||||
exportSettings.quality = settings.value("export/quality", QVariant::fromValue(50)).toInt();
|
||||
|
||||
@@ -726,7 +727,17 @@ OVERWRITE cMainWindow::exportFile(const EXPORTSETTINGS& exportSettings, cEXIF* l
|
||||
addToExportLog(m_exportLog, "Writing file: <span class='option'>" + destFile + "</span>");
|
||||
writer.setQuality(exportSettings.quality);
|
||||
if(writer.write(image))
|
||||
{
|
||||
addToExportLog(m_exportLog, "Writing file: <span class='optionok'>successful</span>");
|
||||
|
||||
if(exportSettings.copyEXIF)
|
||||
{
|
||||
if(lpExif->copyTo(destFile))
|
||||
addToExportLog(m_exportLog, "Copy EXIF: <span class='optionok'>successful</span>");
|
||||
else
|
||||
addToExportLog(m_exportLog, "Copy EXIF: <span class='optionnok'>error</span>");
|
||||
}
|
||||
}
|
||||
else
|
||||
addToExportLog(m_exportLog, "Writing file: <span class='optionnok'>error: " + writer.errorString() + "</span>");
|
||||
}
|
||||
|
||||
@@ -86,6 +86,7 @@ typedef struct tagEXPORTSETTINGS
|
||||
FILE_ADD fileAdd; /*!< TODO: describe */
|
||||
QString fileTag; /*!< TODO: describe */
|
||||
FILE_OVERWRITE fileOverwrite; /*!< TODO: describe */
|
||||
bool copyEXIF; /*!< TODO: describe */
|
||||
QString fileFormat; /*!< TODO: describe */
|
||||
int quality; /*!< TODO: describe */
|
||||
/*!
|
||||
@@ -137,6 +138,15 @@ private:
|
||||
|
||||
QString m_exportLog; /*!< TODO: describe */
|
||||
|
||||
cEXIFTagList m_exifTAGList; /*!< TODO: describe */
|
||||
cEXIFCompressionList m_exifCompressionList; /*!< TODO: describe */
|
||||
cEXIFLightSourceList m_exifLightSourceList; /*!< TODO: describe */
|
||||
cEXIFFlashList m_exifFlashList; /*!< TODO: describe */
|
||||
|
||||
cIPTCTagList m_iptcTagList; /*!< TODO: describe */
|
||||
|
||||
cXMPTagList m_xmpTagList; /*!< TODO: describe */
|
||||
|
||||
/*!
|
||||
\brief
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@ RESOURCES += \
|
||||
|
||||
DISTFILES += \
|
||||
Doxyfile \
|
||||
EFIFTags.xlsx \
|
||||
README.md \
|
||||
LICENSE \
|
||||
fileFormats.xlsx \
|
||||
|
||||
Reference in New Issue
Block a user