diff -Nru easyimagesizer-3.0.2/CMakeLists.txt easyimagesizer-3.0.5/CMakeLists.txt --- easyimagesizer-3.0.2/CMakeLists.txt 2011-06-23 15:45:17.000000000 +0000 +++ easyimagesizer-3.0.5/CMakeLists.txt 2012-06-16 07:45:19.000000000 +0000 @@ -1,10 +1,10 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.1) - ########### Project name ########### + ########### Project name ########### PROJECT(EasyImageSizer3) SET(EASYIMAGESIZER_MAJOR "3") SET(EASYIMAGESIZER_MINOR "0") - SET(EASYIMAGESIZER_PATCH "2") + SET(EASYIMAGESIZER_PATCH "4") SET(VERSION "${EASYIMAGESIZER_MAJOR}.${EASYIMAGESIZER_MINOR}.${EASYIMAGESIZER_PATCH}") SET(PACKAGE easyimagesizer3) @@ -46,7 +46,7 @@ install(DIRECTORY "easyimagesizer3/include/easyimagesizer3" DESTINATION "include" FILES_MATCHING PATTERN "*.h") - install (FILES "data/easyimagesizer3.xpm" + install(FILES "data/easyimagesizer3.xpm" DESTINATION "share/pixmaps") - install (FILES "data/easyimagesizer3.desktop" - DESTINATION "share/applications") \ No newline at end of file + install(FILES "data/easyimagesizer3.desktop" + DESTINATION "share/applications") diff -Nru easyimagesizer-3.0.2/debian/changelog easyimagesizer-3.0.5/debian/changelog --- easyimagesizer-3.0.2/debian/changelog 2012-04-19 08:20:58.000000000 +0000 +++ easyimagesizer-3.0.5/debian/changelog 2012-06-16 14:43:26.000000000 +0000 @@ -1,3 +1,9 @@ +easyimagesizer (3.0.5-1dhor~precise) precise; urgency=low + + * 3.0.5 + + -- Dariusz Duma Sat, 16 Jun 2012 16:43:05 +0200 + easyimagesizer (3.0.2-4dhor~precise) precise; urgency=low * Rebuild diff -Nru easyimagesizer-3.0.2/debian/patches/debian-changes-3.0.2-1dhor~lucid easyimagesizer-3.0.5/debian/patches/debian-changes-3.0.2-1dhor~lucid --- easyimagesizer-3.0.2/debian/patches/debian-changes-3.0.2-1dhor~lucid 2011-07-01 03:42:18.000000000 +0000 +++ easyimagesizer-3.0.5/debian/patches/debian-changes-3.0.2-1dhor~lucid 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -Description: Upstream changes introduced in version 3.0.2-1dhor~lucid - This patch has been created by dpkg-source during the package build. - Here's the last changelog entry, hopefully it gives details on why - those changes were made: - . - easyimagesizer (3.0.2-1dhor~lucid) lucid; urgency=low - . - * Initial release - . - The person named in the Author field signed this changelog entry. -Author: Dariusz Duma - ---- -The information above should follow the Patch Tagging Guidelines, please -checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here -are templates for supplementary fields that you might want to add: - -Origin: , -Bug: -Bug-Debian: http://bugs.debian.org/ -Bug-Ubuntu: https://launchpad.net/bugs/ -Forwarded: -Reviewed-By: -Last-Update: - ---- easyimagesizer-3.0.2.orig/easyimagesizer3.spec -+++ easyimagesizer-3.0.2/easyimagesizer3.spec -@@ -16,7 +16,7 @@ BuildRoot: %{_tmppath}/%{name} - BuildRequires: gcc-c++ - BuildRequires: libqt4-devel >= 4.5 - BuildRequires: desktop-file-utils --BuildRequires: cmake >= 2.8.1 -+BuildRequires: cmake >= 2.8.0 - BuildRequires: libexiv2-devel >= 0.1 - %if 0%{?suse_version} - BuildRequires: update-desktop-files diff -Nru easyimagesizer-3.0.2/debian/patches/debian-changes-3.0.2-1dhor~maverick easyimagesizer-3.0.5/debian/patches/debian-changes-3.0.2-1dhor~maverick --- easyimagesizer-3.0.2/debian/patches/debian-changes-3.0.2-1dhor~maverick 2011-06-30 16:07:10.000000000 +0000 +++ easyimagesizer-3.0.5/debian/patches/debian-changes-3.0.2-1dhor~maverick 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -Description: Upstream changes introduced in version 3.0.2-1dhor~maverick - This patch has been created by dpkg-source during the package build. - Here's the last changelog entry, hopefully it gives details on why - those changes were made: - . - easyimagesizer (3.0.2-1dhor~maverick) maverick; urgency=low - . - * Initial release - . - The person named in the Author field signed this changelog entry. -Author: Dariusz Duma - ---- -The information above should follow the Patch Tagging Guidelines, please -checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here -are templates for supplementary fields that you might want to add: - -Origin: , -Bug: -Bug-Debian: http://bugs.debian.org/ -Bug-Ubuntu: https://launchpad.net/bugs/ -Forwarded: -Reviewed-By: -Last-Update: - ---- easyimagesizer-3.0.2.orig/easyimagesizer3.spec -+++ easyimagesizer-3.0.2/easyimagesizer3.spec -@@ -17,7 +17,7 @@ BuildRequires: gcc-c++ - BuildRequires: libqt4-devel >= 4.5 - BuildRequires: desktop-file-utils - BuildRequires: cmake >= 2.8.1 --BuildRequires: libexiv2-devel >= 0.21 -+BuildRequires: libexiv2-devel >= 0.1 - %if 0%{?suse_version} - BuildRequires: update-desktop-files - %endif -@@ -67,7 +67,7 @@ Authors: - License: LGPLv3+ - Summary: Library to batch convert images - Group: Development/Libraries/C and C++ --Requires: libexiv2-10 -+Requires: libexiv2-devel - - %description -n lib%{name} - %{name} is a library to batch convert image files. diff -Nru easyimagesizer-3.0.2/debian/patches/debian-changes-3.0.2-2dhor~lucid easyimagesizer-3.0.5/debian/patches/debian-changes-3.0.2-2dhor~lucid --- easyimagesizer-3.0.2/debian/patches/debian-changes-3.0.2-2dhor~lucid 2011-07-01 09:29:01.000000000 +0000 +++ easyimagesizer-3.0.5/debian/patches/debian-changes-3.0.2-2dhor~lucid 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -Description: Upstream changes introduced in version 3.0.2-2dhor~lucid - This patch has been created by dpkg-source during the package build. - Here's the last changelog entry, hopefully it gives details on why - those changes were made: - . - easyimagesizer (3.0.2-2dhor~lucid) lucid; urgency=low - . - * Initial release - . - The person named in the Author field signed this changelog entry. -Author: Dariusz Duma - ---- -The information above should follow the Patch Tagging Guidelines, please -checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here -are templates for supplementary fields that you might want to add: - -Origin: , -Bug: -Bug-Debian: http://bugs.debian.org/ -Bug-Ubuntu: https://launchpad.net/bugs/ -Forwarded: -Reviewed-By: -Last-Update: - ---- easyimagesizer-3.0.2.orig/CMakeLists.txt -+++ easyimagesizer-3.0.2/CMakeLists.txt -@@ -1,4 +1,4 @@ -- CMAKE_MINIMUM_REQUIRED(VERSION 2.8.1) -+ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) - - ########### Project name ########### - PROJECT(EasyImageSizer3) ---- easyimagesizer-3.0.2.orig/easyimagesizer3/CMakeLists.txt -+++ easyimagesizer-3.0.2/easyimagesizer3/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 2.8.1) -+cmake_minimum_required(VERSION 2.8.0) - - project(EASYIMAGESIZER3_LIB) - ---- easyimagesizer-3.0.2.orig/plugins/overlay-text/CMakeLists.txt -+++ easyimagesizer-3.0.2/plugins/overlay-text/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 2.8.1) -+cmake_minimum_required(VERSION 2.8.0) - - project(OVERLAY_TEXT) - ---- easyimagesizer-3.0.2.orig/plugins/overlay/CMakeLists.txt -+++ easyimagesizer-3.0.2/plugins/overlay/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 2.8.1) -+cmake_minimum_required(VERSION 2.8.0) - - project(OVERLAY) - ---- easyimagesizer-3.0.2.orig/plugins/exif/CMakeLists.txt -+++ easyimagesizer-3.0.2/plugins/exif/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 2.8.1) -+cmake_minimum_required(VERSION 2.8.0) - - project(EXIF) - ---- easyimagesizer-3.0.2.orig/plugins/rename/CMakeLists.txt -+++ easyimagesizer-3.0.2/plugins/rename/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 2.8.1) -+cmake_minimum_required(VERSION 2.8.0) - - project(RENAME) - ---- easyimagesizer-3.0.2.orig/plugins/resize/CMakeLists.txt -+++ easyimagesizer-3.0.2/plugins/resize/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 2.8.1) -+cmake_minimum_required(VERSION 2.8.0) - - project(RESIZE) - ---- easyimagesizer-3.0.2.orig/plugins/rotate/CMakeLists.txt -+++ easyimagesizer-3.0.2/plugins/rotate/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 2.8.1) -+cmake_minimum_required(VERSION 2.8.0) - - project(ROTATE) - ---- easyimagesizer-3.0.2.orig/easyimagesizer3_gui/CMakeLists.txt -+++ easyimagesizer-3.0.2/easyimagesizer3_gui/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 2.8.1) -+cmake_minimum_required(VERSION 2.8.0) - - project(EASYIMAGESIZER3_GUI) - diff -Nru easyimagesizer-3.0.2/debian/patches/series easyimagesizer-3.0.5/debian/patches/series --- easyimagesizer-3.0.2/debian/patches/series 2011-07-01 09:29:01.000000000 +0000 +++ easyimagesizer-3.0.5/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -debian-changes-3.0.2-1dhor~maverick -debian-changes-3.0.2-1dhor~lucid -debian-changes-3.0.2-2dhor~lucid diff -Nru easyimagesizer-3.0.2/easyimagesizer3/CMakeLists.txt easyimagesizer-3.0.5/easyimagesizer3/CMakeLists.txt --- easyimagesizer-3.0.2/easyimagesizer3/CMakeLists.txt 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/easyimagesizer3/CMakeLists.txt 2012-06-16 07:45:19.000000000 +0000 @@ -12,10 +12,10 @@ # enable warnings add_definitions( -Wall ) -file(GLOB EASYIMAGESIZER3_LIB_SRCS "src/*.cpp") +file(GLOB EASYIMAGESIZER3_LIB_SRCS "src/*.cpp" "include/easyimagesizer3/*.h") file(GLOB EASYIMAGESIZER3_LIB_HEADERS "include/easyimagesizer3/*.h") -set(EASYIMAGESIZER3_LIB_UIS +set( EASYIMAGESIZER3_LIB_UIS pluginsdialog.ui ) diff -Nru easyimagesizer-3.0.2/easyimagesizer3/include/easyimagesizer3/easyimagesizer3.h easyimagesizer-3.0.5/easyimagesizer3/include/easyimagesizer3/easyimagesizer3.h --- easyimagesizer-3.0.2/easyimagesizer3/include/easyimagesizer3/easyimagesizer3.h 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/easyimagesizer3/include/easyimagesizer3/easyimagesizer3.h 2012-06-16 07:45:19.000000000 +0000 @@ -19,6 +19,7 @@ #define EASYIMAGESIZER_H #include +#include #include #include #include @@ -26,7 +27,7 @@ #include "easyimagesizer3/easyimagesizer3_global.h" #include "easyimagesizer3/easyimagesizer3plugin.h" -class EASYIMAGESIZER3SHARED_EXPORT EasyImageSizer3: public QObject { +class EASYIMAGESIZER3SHARED_EXPORT EasyImageSizer3: public QThread { Q_OBJECT public: EasyImageSizer3(); @@ -40,7 +41,7 @@ return QString("http://easyimagesizer.sourceforge.net/"); } static QString applicationVersion() { - return QString("3.0.2"); + return QString("3.0.5"); } static QIcon applicationIcon() { return QIcon(":/icon/eis"); @@ -55,18 +56,33 @@ return QString("FalseCAM"); } + void run(); void configPlugins(QWidget* parent); - QList getPlugins(); + static QList getPlugins(); QStringList convert(QStringList images, QString folder, QString format, - int quality); + int quality, bool copyMetaData); static void about(QWidget* parent); - +signals: + void progress(int); private: + int progressPos; + int progressMax; + static void convert(QStringList images, int index, QString folder, QString format, int quality, bool copyMetaData); + static void convertMeta(QStringList images, int index, QString folder, QString format, int quality); + static void convertNoMeta(QStringList images, int index, QString folder, QString format, int quality); + // + QStringList images; + QString folder; + QString format; + int quality; + bool copyMetaData; + + -signals: - void progress(int); public slots: + void progressChanged(int); + void progressChanged(); }; #endif // EASYIMAGESIZER_H diff -Nru easyimagesizer-3.0.2/easyimagesizer3/include/easyimagesizer3/easyimagesizer3plugin.h easyimagesizer-3.0.5/easyimagesizer3/include/easyimagesizer3/easyimagesizer3plugin.h --- easyimagesizer-3.0.2/easyimagesizer3/include/easyimagesizer3/easyimagesizer3plugin.h 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/easyimagesizer3/include/easyimagesizer3/easyimagesizer3plugin.h 2012-06-16 07:45:19.000000000 +0000 @@ -23,7 +23,7 @@ #include #include "easyimagesizer3/eisimage.h" -class EasyImageSizer3Plugin: virtual public QWidget { +class EasyImageSizer3Plugin{ public: virtual ~EasyImageSizer3Plugin() { } @@ -33,12 +33,13 @@ virtual QString getAuthor() = 0; virtual QString getDescription() = 0; virtual QIcon getIcon() = 0; - virtual void convert(EisImage *image) = 0; - // signals: void progress(int); + virtual QWidget* createWidget() = 0; + virtual QObject* getObject() = 0; + virtual void convert(EisImage *image) = 0; }; Q_DECLARE_INTERFACE(EasyImageSizer3Plugin, - "EasyImageSizer3.EasyImageSizer3Plugin/0.1") + "EasyImageSizer3.EasyImageSizer3Plugin/0.1") ; #endif // PLUGIN_H diff -Nru easyimagesizer-3.0.2/easyimagesizer3/include/easyimagesizer3/eisimage.h easyimagesizer-3.0.5/easyimagesizer3/include/easyimagesizer3/eisimage.h --- easyimagesizer-3.0.2/easyimagesizer3/include/easyimagesizer3/eisimage.h 2011-06-30 11:51:23.000000000 +0000 +++ easyimagesizer-3.0.5/easyimagesizer3/include/easyimagesizer3/eisimage.h 2012-06-16 07:45:19.000000000 +0000 @@ -37,6 +37,7 @@ QImage *getImage(); void setName(QString name); QString getName(); + void setCopyMetaData(bool copy); int getIndex(); QString getOriginalFile(); QString save(QString folder, QString format, int quality); @@ -46,6 +47,7 @@ QString file; QString name; QImage *image; + bool copyMetaData; Exiv2::ExifData exifData; int index; diff -Nru easyimagesizer-3.0.2/easyimagesizer3/src/easyimagesizer3.cpp easyimagesizer-3.0.5/easyimagesizer3/src/easyimagesizer3.cpp --- easyimagesizer-3.0.2/easyimagesizer3/src/easyimagesizer3.cpp 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/easyimagesizer3/src/easyimagesizer3.cpp 2012-06-16 07:45:19.000000000 +0000 @@ -20,11 +20,17 @@ #include #include #include +#include +#include +#include +#include #include #include "easyimagesizer3/pluginsdialog.h" #include "easyimagesizer3/pluginloader.h" EasyImageSizer3::EasyImageSizer3() { + progressPos = 0; + progressMax = 0; } EasyImageSizer3::~EasyImageSizer3() { @@ -32,7 +38,7 @@ } /* - About box to show information about PhotosDD library + About box to show information about EasyImageSizer library */ void EasyImageSizer3::about(QWidget* parent = 0) { QMessageBox aboutBox; @@ -44,7 +50,7 @@ + ("

") + ("

Version ") + EasyImageSizer3::applicationVersion() + ("") - + ("

(C) 2011 ") + + ("

(C) 2012 ") + EasyImageSizer3::organizationName() + ("

") + ("

") + ("Homepage

") + ("

") @@ -63,25 +69,81 @@ return PluginLoader::getInstance().getActivatedPlugins(); } +void EasyImageSizer3::progressChanged(int state){ + qDebug("[EasyImageSizer3] progress: %s", qPrintable(QString().number(state))); + emit progress(state); +} + +void EasyImageSizer3::progressChanged(){ + progressPos ++; + progressChanged(progressPos*100 / progressMax); +} + /* Converts given images and returns a list of converted images. */ QStringList EasyImageSizer3::convert(QStringList images, QString folder, - QString format, int quality) { - - for (int i = 0; i < images.size(); i++) { - qDebug("[EasyImageSizer] converts %s, format: %s", - qPrintable(images.at(i)), qPrintable(format)); - EisImage *img = new EisImage(images.at(i), i); - QList plugins = getPlugins(); - for (int i = 0; i < plugins.count(); i++) { - plugins.at(i)->convert(img); - } - if (folder.isEmpty()) - img->save(format, quality); - else - img->save(folder, format, quality); - delete img; + QString format, int quality, bool copyMetaData) { + this->images = images; + this->folder = folder; + this->format = format; + this->quality = quality; + this->copyMetaData = copyMetaData; + progressPos = 0; + progressMax = images.size(); + return images; +} + +void EasyImageSizer3::run(){ +#ifndef QT_NO_CONCURRENT + QFutureSynchronizer synchronizer; +#endif + for (int i = 0; i < images.size(); i++) { + + // Parallel convertion with some threads +#ifndef QT_NO_CONCURRENT + QFuture future; + if(copyMetaData){ + future = QtConcurrent::run(convertMeta, images, i, folder, format, quality); + }else{ + future = QtConcurrent::run(convertNoMeta, images, i, folder, format, quality); + } + synchronizer.addFuture(future); + if(synchronizer.futures().size() > QThread::idealThreadCount()*3){ + synchronizer.waitForFinished(); + synchronizer.clearFutures(); + } +#else + convert(images, i , folder, format, quality, copyMetaData); +#endif + progressChanged(); } - return images; +#ifndef QT_NO_CONCURRENT + synchronizer.waitForFinished(); +#endif +} + +void EasyImageSizer3::convert(QStringList images, int index, QString folder, QString format, int quality, bool copyMetaData){ + qDebug("[EasyImageSizer] converts %s, format: %s", + qPrintable(images.at(index)), qPrintable(format)); + EisImage *img = new EisImage(images.at(index), index); + QList plugins = EasyImageSizer3::getPlugins(); + for (int i = 0; i < plugins.count(); i++) { + qDebug("[EasyImageSizer] converts plugin %s", qPrintable(plugins.at(i)->getName())); + plugins.at(i)->convert(img); + } + img->setCopyMetaData(copyMetaData); + if (folder.isEmpty()) + img->save(format, quality); + else + img->save(folder, format, quality); + delete img; +} + +void EasyImageSizer3::convertMeta(QStringList images, int index, QString folder, QString format, int quality){ + convert(images, index, folder, format, quality, true); +} + +void EasyImageSizer3::convertNoMeta(QStringList images, int index, QString folder, QString format, int quality){ + convert(images, index, folder, format, quality, false); } diff -Nru easyimagesizer-3.0.2/easyimagesizer3/src/eisimage.cpp easyimagesizer-3.0.5/easyimagesizer3/src/eisimage.cpp --- easyimagesizer-3.0.2/easyimagesizer3/src/eisimage.cpp 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/easyimagesizer3/src/eisimage.cpp 2012-06-16 07:45:19.000000000 +0000 @@ -22,6 +22,7 @@ #include EisImage::EisImage() { + this->copyMetaData = true; } EisImage::EisImage(QString file, int index = 0) { @@ -29,7 +30,7 @@ this->name = QFileInfo(file).baseName(); this->image = new QImage(file); this->index = index; - readMetadata(); + readMetadata(); } EisImage::~EisImage() { @@ -38,11 +39,15 @@ } void EisImage::readMetadata() { + try{ Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open( this->file.toStdString().c_str()); image->readMetadata(); - this->exifData = image->exifData(); + this->exifData = image->exifData(); + } catch (Exiv2::Error& e) { + qCritical("[EisImage] %s", e.what()); + } } void EisImage::setImage(QImage *img) { @@ -63,6 +68,10 @@ return name; } +void EisImage::setCopyMetaData(bool copy) { + this->copyMetaData = copy; +} + int EisImage::getIndex() { return index; } @@ -81,7 +90,8 @@ if (!this->image->save(filename, qPrintable(format), quality)) { qDebug("[EisImage] %s could not been saved.", qPrintable(filename)); } else { - copyExifData(this->file, filename); + if (this->copyMetaData) + copyExifData(this->file, filename); } return filename; } @@ -98,22 +108,18 @@ // Copy exif Data from one file to another void EisImage::copyExifData(QString srcFile, QString destFile) { - // Start new Process that copies exif data - //QProcess process; - //process.start( - // QString("exiftool -all= -overwrite_original -tagsfromfile \"").append( - // srcFile) .append("\" -exif:all \"").append(destFile).append( - // "\"").replace("/", QDir::separator())); - // Wait until process finished - //process.waitForFinished(); - Exiv2::Image::AutoPtr srcImage = Exiv2::ImageFactory::open( - srcFile.toStdString().c_str()); - srcImage->readMetadata(); - - Exiv2::ExifData& exifData = srcImage->exifData(); - Exiv2::Image::AutoPtr destImage = Exiv2::ImageFactory::open( - destFile.toStdString().c_str()); - destImage->setExifData(exifData); - destImage->writeMetadata(); + try { + Exiv2::Image::AutoPtr srcImage = Exiv2::ImageFactory::open( + srcFile.toStdString().c_str()); + srcImage->readMetadata(); + + Exiv2::ExifData& exifData = srcImage->exifData(); + Exiv2::Image::AutoPtr destImage = Exiv2::ImageFactory::open( + destFile.toStdString().c_str()); + destImage->setExifData(exifData); + destImage->writeMetadata(); + } catch (Exiv2::Error& e) { + qCritical("[EisImage] %s", e.what()); + } } diff -Nru easyimagesizer-3.0.2/easyimagesizer3/src/pluginloader.cpp easyimagesizer-3.0.5/easyimagesizer3/src/pluginloader.cpp --- easyimagesizer-3.0.2/easyimagesizer3/src/pluginloader.cpp 2011-06-23 18:54:25.000000000 +0000 +++ easyimagesizer-3.0.5/easyimagesizer3/src/pluginloader.cpp 2012-06-16 07:45:19.000000000 +0000 @@ -35,7 +35,7 @@ PluginLoader::~PluginLoader() { saveConfig(); - unloadPlugins(); + unloadPlugins(); } PluginLoader& PluginLoader::getInstance() { @@ -232,6 +232,7 @@ qDebug("[PluginLoader] unloads Plugins"); foreach(EasyImageSizer3Plugin * plugin, pluginList) { + qDebug("[PluginLoader] unloading Plugin %s", qPrintable(plugin->getName())); activatedPluginList.removeOne(plugin); pluginList.removeOne(plugin); delete plugin; diff -Nru easyimagesizer-3.0.2/easyimagesizer3_gui/form.cpp easyimagesizer-3.0.5/easyimagesizer3_gui/form.cpp --- easyimagesizer-3.0.2/easyimagesizer3_gui/form.cpp 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/easyimagesizer3_gui/form.cpp 2012-06-16 07:45:19.000000000 +0000 @@ -63,6 +63,10 @@ return -1; } +bool Form::getCopyMetaData(){ + return ui->copyMetadataCheckBox->isChecked(); +} + // set Save Dir void Form::setSaveToDir() { diff -Nru easyimagesizer-3.0.2/easyimagesizer3_gui/form.h easyimagesizer-3.0.5/easyimagesizer3_gui/form.h --- easyimagesizer-3.0.2/easyimagesizer3_gui/form.h 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/easyimagesizer3_gui/form.h 2012-06-16 07:45:19.000000000 +0000 @@ -35,6 +35,7 @@ QString getImageFormat(); int getImageQuality(); QString getSaveFolder(); + bool getCopyMetaData(); bool getSaveTo(); diff -Nru easyimagesizer-3.0.2/easyimagesizer3_gui/form.ui easyimagesizer-3.0.5/easyimagesizer3_gui/form.ui --- easyimagesizer-3.0.2/easyimagesizer3_gui/form.ui 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/easyimagesizer3_gui/form.ui 2012-06-16 07:45:19.000000000 +0000 @@ -40,35 +40,35 @@ - + Save to - + false - + Dir ... - + Select image format - + @@ -136,7 +136,7 @@ - + Qt::Vertical @@ -150,20 +150,20 @@ - + Qt::Vertical 20 - 125 + 40 - - + + Qt::Vertical @@ -175,8 +175,8 @@ - - + + Qt::Vertical @@ -189,7 +189,30 @@ - + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Copy Metadata + + + true + + + + + Qt::Vertical diff -Nru easyimagesizer-3.0.2/easyimagesizer3_gui/main.cpp easyimagesizer-3.0.5/easyimagesizer3_gui/main.cpp --- easyimagesizer-3.0.2/easyimagesizer3_gui/main.cpp 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/easyimagesizer3_gui/main.cpp 2012-06-16 07:45:19.000000000 +0000 @@ -22,11 +22,10 @@ { QApplication a(argc, argv); QCoreApplication::setApplicationName("EasyImageSizer3"); - QCoreApplication::setApplicationVersion("3.0.2"); + QCoreApplication::setApplicationVersion("3.0.5"); QCoreApplication::setOrganizationName("FalseCAM"); QCoreApplication::setOrganizationDomain("www.falsecam.net"); MainWindow w; w.show(); - return a.exec(); } diff -Nru easyimagesizer-3.0.2/easyimagesizer3_gui/mainwindow.cpp easyimagesizer-3.0.5/easyimagesizer3_gui/mainwindow.cpp --- easyimagesizer-3.0.2/easyimagesizer3_gui/mainwindow.cpp 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/easyimagesizer3_gui/mainwindow.cpp 2012-06-16 07:45:19.000000000 +0000 @@ -29,10 +29,11 @@ #include #include #include +#include #include "tipdialog.h" MainWindow::MainWindow(QWidget *parent) : - QMainWindow(parent), ui(new Ui::MainWindow) { + QMainWindow(parent), ui(new Ui::MainWindow) { /* Splash screen on starting. */ @@ -42,8 +43,8 @@ splash->showMessage("Starting EasyImageSizer ...", Qt::AlignTop | Qt::AlignRight, Qt::white); easyImageSizer = new EasyImageSizer3(); - splash->showMessage("Loading gui ...", Qt::AlignTop | Qt::AlignRight, - Qt::white); + splash->showMessage("Loading gui ...", Qt::AlignTop | Qt::AlignRight, + Qt::white); form = new Form(); ui->setupUi(this); QApplication::setWindowIcon(easyImageSizer->applicationIcon()); @@ -77,7 +78,7 @@ QList plugins = easyImageSizer->getPlugins(); for (int i = 0; i < plugins.count(); i++) { - connect(easyImageSizer->getPlugins().at(i), SIGNAL(progress(int)), + connect(easyImageSizer->getPlugins().at(i)->getObject(), SIGNAL(progress(int)), ui->taskProgressBar, SLOT(setValue(int))); } } @@ -86,7 +87,8 @@ saveConfig(); delete easyImageSizer; delete form; - delete ui; + delete ui; + qDebug("[MainWindow] destructor finished"); } void MainWindow::loadPluginWidgets() { @@ -98,10 +100,10 @@ ui->tabWidget->addTab(form, form->getTitle()); foreach (EasyImageSizer3Plugin *plugin, easyImageSizer->getPlugins()) - { - if (plugin) - ui->tabWidget->addTab(plugin, plugin->getTitle()); - } + { + if (plugin) + ui->tabWidget->addTab(plugin->createWidget(), plugin->getTitle()); + } } /* @@ -134,21 +136,21 @@ // supported image formats QString supportedFormats; foreach(QByteArray format, QImageReader::supportedImageFormats()) - { - supportedFormats.append(QString(" *.").append(format)); - } + { + supportedFormats.append(QString(" *.").append(format)); + } // Create File Dialog and open selected Files QStringList files = QFileDialog::getOpenFileNames(this, tr("Please select a file"), this->lastOpenFileDir, "All Supported Image Files (" + supportedFormats + ");;" - "Joint Photographic Experts Group File (*.jpg *.jpeg);;" - "All Files (*.*)"); + "Joint Photographic Experts Group File (*.jpg *.jpeg);;" + "All Files (*.*)"); if (files.isEmpty()) return; // checks for existing dir and saves last dialog opened dir if (QDir(QFileInfo(files.at(0)).absoluteDir()).exists()) - this->lastOpenFileDir - = QFileInfo(files.at(0)).absoluteDir().absolutePath(); + this->lastOpenFileDir = + QFileInfo(files.at(0)).absoluteDir().absolutePath(); addImages(files); } @@ -193,7 +195,8 @@ if (!files.isEmpty()) { for (int i = 0; i < files.count(); i++) { //foreach(QString file, files){ - ui->overallProgressBar->setValue(int((i + 1) * 100 / files.count())); + ui->overallProgressBar->setValue( + int((i + 1) * 100 / files.count())); if (QFile().exists(files.at(i)) && !fileAlreadyAdded(files.at(i))) { imagesList.append(files.at(i)); emit image_list_Changed(this->imagesList.count() - 1); @@ -209,9 +212,9 @@ // supported image formats QStringList supportedFormats; foreach(QByteArray format, QImageReader::supportedImageFormats()) - { - supportedFormats << QString("*.").append(format); - } + { + supportedFormats << QString("*.").append(format); + } // Set Filter to only load Image Files dir.setNameFilters(supportedFormats); @@ -331,8 +334,8 @@ QIcon icon; QPixmap pixmap; // make copy of scaled image - pixmap - = QPixmap(this->ui->FilesList->item(i)->text()).scaledToHeight( + pixmap = + QPixmap(this->ui->FilesList->item(i)->text()).scaledToHeight( 48); ui->overallProgressBar->setValue(66); // open Image to use it as Icon @@ -402,12 +405,12 @@ + ("

") + ("

") + tr("Version ") + QCoreApplication::applicationVersion() - + ("") + ("

(C) 2011 ") + ("

(C) 2012 ") + QCoreApplication::organizationName() + ("

") + ("

") - + tr("Homepage") + ("

") + ("

") + tr( - "English translation: FalseCAM") + ("

")); + + tr("Homepage") + ("

") + ("

") + + tr("English translation: FalseCAM") + ("

")); } void MainWindow::on_actionAbout_EasyImageSizer_triggered() { @@ -435,13 +438,25 @@ } void MainWindow::on_commandLinkButton_clicked() { + connect(this->easyImageSizer, SIGNAL(progress(int)), this->ui->overallProgressBar, SLOT(setValue(int))); ui->taskProgressBar->setValue(0); ui->overallProgressBar->setValue(0); + QElapsedTimer timer; + timer.start(); if (form->getSaveTo()) { this->easyImageSizer->convert(this->imagesList, form->getSaveFolder(), - this->form->getImageFormat(), this->form->getImageQuality()); + this->form->getImageFormat(), this->form->getImageQuality(), + this->form->getCopyMetaData()); } else { this->easyImageSizer->convert(this->imagesList, "", - this->form->getImageFormat(), this->form->getImageQuality()); + this->form->getImageFormat(), this->form->getImageQuality(), + this->form->getCopyMetaData()); } + this->easyImageSizer->start(); + // hold gui responsive + while(this->easyImageSizer->isRunning()) + QCoreApplication::processEvents(); + + // Shows information MessageBox: Finished in X milliseconds + QMessageBox::information(this, "Finished", tr("EasyImageSizer converted %1 files in %2 milliseconds.").arg(this->imagesList.size()).arg(timer.elapsed())); } diff -Nru easyimagesizer-3.0.2/easyimagesizer3.spec easyimagesizer-3.0.5/easyimagesizer3.spec --- easyimagesizer-3.0.2/easyimagesizer3.spec 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/easyimagesizer3.spec 2012-06-16 07:45:19.000000000 +0000 @@ -14,7 +14,7 @@ Source0: %{name}.tar.gz BuildRoot: %{_tmppath}/%{name} BuildRequires: gcc-c++ -BuildRequires: libqt4-devel >= 4.5 +BuildRequires: libqt4-devel >= 4.7 BuildRequires: desktop-file-utils BuildRequires: cmake >= 2.8.1 BuildRequires: libexiv2-devel >= 0.21 @@ -22,34 +22,32 @@ BuildRequires: update-desktop-files %endif -#Requires: libexiv2 - %if 0%{?fedora_version} -Requires: qt >= 4.5 +Requires: qt >= 4.7 %endif %if 0%{?mandriva_version} %ifarch x86_64 -Requires: lib64qtcore4 >= 4.5 +Requires: lib64qtcore4 >= 4.7 %endif %ifarch i586 -Requires: libqtcore4 >= 4.5 +Requires: libqtcore4 >= 4.7 %endif %endif %if 0%{?suse_version} -Requires: libqt4 >= 4.5 +Requires: libqt4 >= 4.7 %endif %if 0%{?sles_version} -Requires: libqt4 >= 4.5 +Requires: libqt4 >= 4.7 %endif %if 0%{?centos_version} -Requires: libqt4 >= 4.5 +Requires: libqt4 >= 4.7 %endif %if 0%{?rhel_version} -Requires: libqt4 >= 4.5 +Requires: libqt4 >= 4.7 %endif Obsoletes: easyimagesizer3 @@ -67,7 +65,6 @@ License: LGPLv3+ Summary: Library to batch convert images Group: Development/Libraries/C and C++ -Requires: libexiv2-10 %description -n lib%{name} %{name} is a library to batch convert image files. diff -Nru easyimagesizer-3.0.2/EasyImageSizer3.vdproj easyimagesizer-3.0.5/EasyImageSizer3.vdproj --- easyimagesizer-3.0.2/EasyImageSizer3.vdproj 2011-06-23 15:45:17.000000000 +0000 +++ easyimagesizer-3.0.5/EasyImageSizer3.vdproj 2012-06-16 07:45:19.000000000 +0000 @@ -279,7 +279,7 @@ } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_237B3C4693BC46DE9BB794FDF6B8B9F0" { - "SourcePath" = "8:bin\\plugins\\libexiv2.dll" + "SourcePath" = "8:bin\\libexiv2.dll" "TargetName" = "8:libexiv2.dll" "Tag" = "8:" "Folder" = "8:_3BF6FE30B372430CB3E32EB35A9FFC26" diff -Nru easyimagesizer-3.0.2/.git/config easyimagesizer-3.0.5/.git/config --- easyimagesizer-3.0.2/.git/config 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/config 2012-06-16 07:45:22.000000000 +0000 @@ -0,0 +1,15 @@ +[core] + repositoryformatversion = 0 + filemode = false + bare = false + logallrefupdates = true + symlinks = false + ignorecase = true + hideDotFiles = dotGitOnly +[remote "origin"] + fetch = +refs/heads/*:refs/remotes/origin/* + url = git://github.com/FalseCAM/EasyImageSizer3.git + puttykeyfile = +[branch "master"] + remote = origin + merge = refs/heads/master diff -Nru easyimagesizer-3.0.2/.git/description easyimagesizer-3.0.5/.git/description --- easyimagesizer-3.0.2/.git/description 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/description 2012-06-16 07:45:15.000000000 +0000 @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff -Nru easyimagesizer-3.0.2/.git/HEAD easyimagesizer-3.0.5/.git/HEAD --- easyimagesizer-3.0.2/.git/HEAD 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/HEAD 2012-06-16 07:45:19.000000000 +0000 @@ -0,0 +1 @@ +ref: refs/heads/master diff -Nru easyimagesizer-3.0.2/.git/hooks/applypatch-msg.sample easyimagesizer-3.0.5/.git/hooks/applypatch-msg.sample --- easyimagesizer-3.0.2/.git/hooks/applypatch-msg.sample 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/hooks/applypatch-msg.sample 2012-06-16 07:45:15.000000000 +0000 @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +test -x "$GIT_DIR/hooks/commit-msg" && + exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} +: diff -Nru easyimagesizer-3.0.2/.git/hooks/commit-msg.sample easyimagesizer-3.0.5/.git/hooks/commit-msg.sample --- easyimagesizer-3.0.2/.git/hooks/commit-msg.sample 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/hooks/commit-msg.sample 2012-06-16 07:45:15.000000000 +0000 @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff -Nru easyimagesizer-3.0.2/.git/hooks/post-commit.sample easyimagesizer-3.0.5/.git/hooks/post-commit.sample --- easyimagesizer-3.0.2/.git/hooks/post-commit.sample 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/hooks/post-commit.sample 2012-06-16 07:45:15.000000000 +0000 @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script that is called after a successful +# commit is made. +# +# To enable this hook, rename this file to "post-commit". + +: Nothing diff -Nru easyimagesizer-3.0.2/.git/hooks/post-receive.sample easyimagesizer-3.0.5/.git/hooks/post-receive.sample --- easyimagesizer-3.0.2/.git/hooks/post-receive.sample 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/hooks/post-receive.sample 2012-06-16 07:45:15.000000000 +0000 @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script for the "post-receive" event. +# +# The "post-receive" script is run after receive-pack has accepted a pack +# and the repository has been updated. It is passed arguments in through +# stdin in the form +# +# For example: +# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master +# +# see contrib/hooks/ for a sample, or uncomment the next line and +# rename the file to "post-receive". + +#. /usr/share/doc/git-core/contrib/hooks/post-receive-email diff -Nru easyimagesizer-3.0.2/.git/hooks/post-update.sample easyimagesizer-3.0.5/.git/hooks/post-update.sample --- easyimagesizer-3.0.2/.git/hooks/post-update.sample 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/hooks/post-update.sample 2012-06-16 07:45:15.000000000 +0000 @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff -Nru easyimagesizer-3.0.2/.git/hooks/pre-applypatch.sample easyimagesizer-3.0.5/.git/hooks/pre-applypatch.sample --- easyimagesizer-3.0.2/.git/hooks/pre-applypatch.sample 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/hooks/pre-applypatch.sample 2012-06-16 07:45:15.000000000 +0000 @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +test -x "$GIT_DIR/hooks/pre-commit" && + exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} +: diff -Nru easyimagesizer-3.0.2/.git/hooks/pre-commit.sample easyimagesizer-3.0.5/.git/hooks/pre-commit.sample --- easyimagesizer-3.0.2/.git/hooks/pre-commit.sample 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/hooks/pre-commit.sample 2012-06-16 07:45:15.000000000 +0000 @@ -0,0 +1,46 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 +fi + +# If you want to allow non-ascii filenames set this variable to true. +allownonascii=$(git config hooks.allownonascii) + +# Cross platform projects tend to avoid non-ascii filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test "$(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0')" +then + echo "Error: Attempt to add a non-ascii file name." + echo + echo "This can cause problems if you want to work" + echo "with people on other platforms." + echo + echo "To be portable it is advisable to rename the file ..." + echo + echo "If you know what you are doing you can disable this" + echo "check using:" + echo + echo " git config hooks.allownonascii true" + echo + exit 1 +fi + +exec git diff-index --check --cached $against -- diff -Nru easyimagesizer-3.0.2/.git/hooks/prepare-commit-msg.sample easyimagesizer-3.0.5/.git/hooks/prepare-commit-msg.sample --- easyimagesizer-3.0.2/.git/hooks/prepare-commit-msg.sample 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/hooks/prepare-commit-msg.sample 2012-06-16 07:45:15.000000000 +0000 @@ -0,0 +1,36 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first comments out the +# "Conflicts:" part of a merge commit. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +case "$2,$3" in + merge,) + /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; + +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$1" ;; + + *) ;; +esac + +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff -Nru easyimagesizer-3.0.2/.git/hooks/pre-rebase.sample easyimagesizer-3.0.5/.git/hooks/pre-rebase.sample --- easyimagesizer-3.0.2/.git/hooks/pre-rebase.sample 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/hooks/pre-rebase.sample 2012-06-16 07:45:15.000000000 +0000 @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up-to-date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +exit 0 + +################################################################ + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". diff -Nru easyimagesizer-3.0.2/.git/hooks/update.sample easyimagesizer-3.0.5/.git/hooks/update.sample --- easyimagesizer-3.0.2/.git/hooks/update.sample 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/hooks/update.sample 2012-06-16 07:45:15.000000000 +0000 @@ -0,0 +1,128 @@ +#!/bin/sh +# +# An example hook script to blocks unannotated tags from entering. +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new +# +# To enable this hook, rename this file to "update". +# +# Config +# ------ +# hooks.allowunannotated +# This boolean sets whether unannotated tags will be allowed into the +# repository. By default they won't be. +# hooks.allowdeletetag +# This boolean sets whether deleting tags will be allowed in the +# repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. +# hooks.allowdeletebranch +# This boolean sets whether deleting branches will be allowed in the +# repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. +# + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [ -z "$GIT_DIR" ]; then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "Usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --bool hooks.allowunannotated) +allowdeletebranch=$(git config --bool hooks.allowdeletebranch) +denycreatebranch=$(git config --bool hooks.denycreatebranch) +allowdeletetag=$(git config --bool hooks.allowdeletetag) +allowmodifytag=$(git config --bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero="0000000000000000000000000000000000000000" +if [ "$newrev" = "$zero" ]; then + newrev_type=delete +else + newrev_type=$(git cat-file -t $newrev) +fi + +case "$refname","$newrev_type" in + refs/tags/*,commit) + # un-annotated tag + short_refname=${refname##refs/tags/} + if [ "$allowunannotated" != "true" ]; then + echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 Binary files /tmp/vG_xH1wiGt/easyimagesizer-3.0.2/.git/index and /tmp/jx4UFeuvqj/easyimagesizer-3.0.5/.git/index differ diff -Nru easyimagesizer-3.0.2/.git/info/exclude easyimagesizer-3.0.5/.git/info/exclude --- easyimagesizer-3.0.2/.git/info/exclude 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/info/exclude 2012-06-16 07:45:15.000000000 +0000 @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff -Nru easyimagesizer-3.0.2/.git/logs/HEAD easyimagesizer-3.0.5/.git/logs/HEAD --- easyimagesizer-3.0.2/.git/logs/HEAD 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/logs/HEAD 2012-06-16 07:45:19.000000000 +0000 @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 8f165a6ae9286e103d165c9fa3aec68334c66c22 FalseCAM 1339832719 +0200 clone: from git://github.com/FalseCAM/EasyImageSizer3.git diff -Nru easyimagesizer-3.0.2/.git/logs/refs/heads/master easyimagesizer-3.0.5/.git/logs/refs/heads/master --- easyimagesizer-3.0.2/.git/logs/refs/heads/master 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/logs/refs/heads/master 2012-06-16 07:45:19.000000000 +0000 @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 8f165a6ae9286e103d165c9fa3aec68334c66c22 FalseCAM 1339832719 +0200 clone: from git://github.com/FalseCAM/EasyImageSizer3.git Binary files /tmp/vG_xH1wiGt/easyimagesizer-3.0.2/.git/objects/pack/pack-86aa3c55b4a6062941bf94837b547123c28e0372.idx and /tmp/jx4UFeuvqj/easyimagesizer-3.0.5/.git/objects/pack/pack-86aa3c55b4a6062941bf94837b547123c28e0372.idx differ Binary files /tmp/vG_xH1wiGt/easyimagesizer-3.0.2/.git/objects/pack/pack-86aa3c55b4a6062941bf94837b547123c28e0372.pack and /tmp/jx4UFeuvqj/easyimagesizer-3.0.5/.git/objects/pack/pack-86aa3c55b4a6062941bf94837b547123c28e0372.pack differ diff -Nru easyimagesizer-3.0.2/.git/packed-refs easyimagesizer-3.0.5/.git/packed-refs --- easyimagesizer-3.0.2/.git/packed-refs 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/packed-refs 2012-06-16 07:45:19.000000000 +0000 @@ -0,0 +1,2 @@ +# pack-refs with: peeled +8f165a6ae9286e103d165c9fa3aec68334c66c22 refs/remotes/origin/master diff -Nru easyimagesizer-3.0.2/.git/refs/heads/master easyimagesizer-3.0.5/.git/refs/heads/master --- easyimagesizer-3.0.2/.git/refs/heads/master 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/refs/heads/master 2012-06-16 07:45:19.000000000 +0000 @@ -0,0 +1 @@ +8f165a6ae9286e103d165c9fa3aec68334c66c22 diff -Nru easyimagesizer-3.0.2/.git/refs/remotes/origin/HEAD easyimagesizer-3.0.5/.git/refs/remotes/origin/HEAD --- easyimagesizer-3.0.2/.git/refs/remotes/origin/HEAD 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.git/refs/remotes/origin/HEAD 2012-06-16 07:45:19.000000000 +0000 @@ -0,0 +1 @@ +ref: refs/remotes/origin/master diff -Nru easyimagesizer-3.0.2/.gitignore easyimagesizer-3.0.5/.gitignore --- easyimagesizer-3.0.2/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/.gitignore 2012-06-16 07:45:19.000000000 +0000 @@ -0,0 +1,30 @@ + +/.cproject +/.project +/CMakeCache.txt +/CMakeFiles +/bin +/easyimagesizer3/CMakeFiles +/easyimagesizer3-gui/CMakeFiles +/plugins/CMakeFiles +/plugins/exif/CMakeFiles +/plugins/overlay/CMakeFiles +/plugins/overlay-text/CMakeFiles +/plugins/rename/CMakeFiles +/plugins/resize/CMakeFiles +/plugins/rotate/CMakeFiles +/Makefile +/cmake_install.cmake +/cmake_uninstall.cmake +/easyimagesizer3-gui/Makefile +/easyimagesizer3-gui/cmake_install.cmake +*.cmake +*.depends +/easyimagesizer3/Makefile +/plugins/exif/Makefile +/plugins/Makefile +/plugins/overlay-text/Makefile +/plugins/overlay/Makefile +/plugins/rename/Makefile +/plugins/resize/Makefile +/plugins/rotate/Makefile \ No newline at end of file diff -Nru easyimagesizer-3.0.2/LICENSE easyimagesizer-3.0.5/LICENSE --- easyimagesizer-3.0.2/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ easyimagesizer-3.0.5/LICENSE 2012-06-16 07:45:19.000000000 +0000 @@ -0,0 +1,166 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + diff -Nru easyimagesizer-3.0.2/plugins/CMakeLists.txt easyimagesizer-3.0.5/plugins/CMakeLists.txt --- easyimagesizer-3.0.2/plugins/CMakeLists.txt 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/plugins/CMakeLists.txt 2012-06-16 07:45:19.000000000 +0000 @@ -3,6 +3,6 @@ ADD_SUBDIRECTORY( exif ) ADD_SUBDIRECTORY( overlay ) ADD_SUBDIRECTORY( overlay-text ) - ADD_SUBDIRECTORY( rename ) - ADD_SUBDIRECTORY( resize ) - ADD_SUBDIRECTORY( rotate ) \ No newline at end of file + ADD_SUBDIRECTORY( rename ) + ADD_SUBDIRECTORY( resize ) + ADD_SUBDIRECTORY( rotate ) diff -Nru easyimagesizer-3.0.2/plugins/exif/exif.cpp easyimagesizer-3.0.5/plugins/exif/exif.cpp --- easyimagesizer-3.0.2/plugins/exif/exif.cpp 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/plugins/exif/exif.cpp 2012-06-16 07:45:19.000000000 +0000 @@ -25,15 +25,18 @@ #include -Exif::Exif(QWidget *parent) : - QWidget(parent), ui(new Ui::Exif) { - ui->setupUi(this); +Exif::Exif() : + ui(new Ui::Exif) { + widget = new QWidget(); + ui->setupUi(widget); loadState(); } Exif::~Exif() { saveState(); + widget->close(); delete ui; + delete widget; } QString Exif::getName() { @@ -45,7 +48,7 @@ } QString Exif::getVersion() { - return QString("0.4"); + return QString("0.5"); } QString Exif::getAuthor() { @@ -60,6 +63,11 @@ return QIcon(""); } +QWidget * Exif::createWidget() +{ + return widget; +} + void Exif::convert(EisImage *image) { if (ui->prependRadio->isChecked()) { image->setName( @@ -79,18 +87,22 @@ emit progress(1); QDateTime DateTime; - Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open( - file.toStdString().c_str()); - image->readMetadata(); - - Exiv2::ExifData& exifData = image->exifData(); - - Exiv2::ExifData::iterator pos = exifData.findKey( - Exiv2::ExifKey("Exif.Photo.DateTimeOriginal")); - - DateTime = QDateTime::fromString( - QString().fromStdString(pos->value().toString()), - "yyyy:MM:dd hh:mm:ss"); + try{ + Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open( + file.toStdString().c_str()); + image->readMetadata(); + + Exiv2::ExifData& exifData = image->exifData(); + + Exiv2::ExifData::iterator pos = exifData.findKey( + Exiv2::ExifKey("Exif.Photo.DateTimeOriginal")); + + DateTime = QDateTime::fromString( + QString().fromStdString(pos->value().toString()), + "yyyy:MM:dd hh:mm:ss"); + } catch (Exiv2::Error& e) { + qDebug("[Exif-Plugin] %s", e.what()); + } // Check if there is a correct Date if (!DateTime.isValid()) @@ -122,5 +134,4 @@ } -Q_EXPORT_PLUGIN2(exif, Exif) -; +Q_EXPORT_PLUGIN2(exif, Exif); diff -Nru easyimagesizer-3.0.2/plugins/exif/exif.h easyimagesizer-3.0.5/plugins/exif/exif.h --- easyimagesizer-3.0.2/plugins/exif/exif.h 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/plugins/exif/exif.h 2012-06-16 07:45:19.000000000 +0000 @@ -30,12 +30,12 @@ class Exif; } -class Exif: public EasyImageSizer3Plugin { -Q_OBJECT -Q_INTERFACES(EasyImageSizer3Plugin) +class Exif: public QObject, public EasyImageSizer3Plugin { + Q_OBJECT + Q_INTERFACES(EasyImageSizer3Plugin) public: - Exif(QWidget *parent = 0); + Exif(); ~Exif(); QString getName(); QString getTitle(); @@ -43,6 +43,8 @@ QString getAuthor(); QString getDescription(); QIcon getIcon(); + QWidget* createWidget(); + QObject* getObject(){ return this; } void convert(EisImage *image); private slots: @@ -52,7 +54,9 @@ QDateTime getDateTime(QString file); private: - Ui::Exif *ui;signals: + Ui::Exif *ui; + QWidget *widget; +signals: void progress(int); }; diff -Nru easyimagesizer-3.0.2/plugins/overlay/overlay.cpp easyimagesizer-3.0.5/plugins/overlay/overlay.cpp --- easyimagesizer-3.0.2/plugins/overlay/overlay.cpp 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/plugins/overlay/overlay.cpp 2012-06-16 07:45:19.000000000 +0000 @@ -28,9 +28,9 @@ #include #include -Overlay::Overlay(QWidget *parent) : - QWidget(parent), ui(new Ui::Overlay) { - ui->setupUi(this); +Overlay::Overlay() : ui(new Ui::Overlay) { + widget = new QWidget(); + ui->setupUi(widget); // loads last state of gui loadState(); @@ -40,7 +40,9 @@ Overlay::~Overlay() { saveState(); + widget->close(); delete ui; + delete widget; } QString Overlay::getName() { @@ -68,6 +70,10 @@ return QIcon(""); } +QWidget * Overlay::createWidget(){ + return widget; +} + void Overlay::convert(EisImage *image) { if (ui->overlayCheckBox->isChecked()) { emit progress(50); @@ -81,7 +87,7 @@ // Set Overlay Image to data void Overlay::setOverlayImage() { // opens a Dialog to choose save directory - QString file = QFileDialog::getOpenFileName(this, + QString file = QFileDialog::getOpenFileName(widget, tr("Please select a file"), ui->overlayImage->text(), "All Supported Image Files (*.bmp *.png *.tif *.tiff);;" "All Files (*.*)"); @@ -124,5 +130,4 @@ settings.setValue("OverlayImage", ui->overlayImage->text()); } -Q_EXPORT_PLUGIN2(overlay, Overlay) -; +Q_EXPORT_PLUGIN2(overlay, Overlay); diff -Nru easyimagesizer-3.0.2/plugins/overlay/overlay.h easyimagesizer-3.0.5/plugins/overlay/overlay.h --- easyimagesizer-3.0.2/plugins/overlay/overlay.h 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/plugins/overlay/overlay.h 2012-06-16 07:45:19.000000000 +0000 @@ -22,6 +22,7 @@ #ifndef OVERLAY_H #define OVERLAY_H +#include #include "easyimagesizer3/easyimagesizer3plugin.h" #include "easyimagesizer3/eisimage.h" @@ -29,12 +30,12 @@ class Overlay; } -class Overlay: public EasyImageSizer3Plugin { +class Overlay: public QObject, public EasyImageSizer3Plugin { Q_OBJECT Q_INTERFACES( EasyImageSizer3Plugin) public: - Overlay(QWidget *parent = 0); + Overlay(); ~Overlay(); QString getName(); QString getTitle(); @@ -42,6 +43,8 @@ QString getAuthor(); QString getDescription(); QIcon getIcon(); + QWidget* createWidget(); + QObject* getObject(){ return this; } void convert(EisImage *image); private slots: @@ -51,7 +54,9 @@ void saveState(); private: - Ui::Overlay *ui;signals: + Ui::Overlay *ui; + QWidget *widget; +signals: void progress(int); }; diff -Nru easyimagesizer-3.0.2/plugins/overlay-text/overlay-text.cpp easyimagesizer-3.0.5/plugins/overlay-text/overlay-text.cpp --- easyimagesizer-3.0.2/plugins/overlay-text/overlay-text.cpp 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/plugins/overlay-text/overlay-text.cpp 2012-06-16 07:45:19.000000000 +0000 @@ -27,14 +27,15 @@ #include #include -OverlayText::OverlayText(QWidget *parent) : - QWidget(parent), ui(new Ui::OverlayText) { +OverlayText::OverlayText() : + ui(new Ui::OverlayText) { + widget = new QWidget(); font = new QFont(); color = new QColor(); pixmap = new QPixmap(32, 32); scene = new QGraphicsScene(); scenePixmap = new QPixmap(100, 100); - ui->setupUi(this); + ui->setupUi(widget); ui->preview->setScene(scene); connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(setFont())); @@ -55,7 +56,9 @@ OverlayText::~OverlayText() { saveState(); + widget->close(); delete ui; + delete widget; } QString OverlayText::getName() { @@ -82,6 +85,10 @@ return QIcon(""); } +QWidget * OverlayText::createWidget(){ + return widget; +} + void OverlayText::convert(EisImage *image) { if (ui->overlayCheckBox->isChecked()) { emit progress(50); @@ -110,7 +117,7 @@ // shows a dialog to select font of text void OverlayText::setFont() { bool ok; - QFont temp = QFontDialog::getFont(&ok, *font, this); + QFont temp = QFontDialog::getFont(&ok, *font, widget); if (ok) { delete font; this->font = new QFont(temp); @@ -121,7 +128,7 @@ // shows a dialog to select color of text void OverlayText::setColor() { - QColor temp = QColorDialog::getColor(*color, this); + QColor temp = QColorDialog::getColor(*color, widget); delete color; color = new QColor(temp); diff -Nru easyimagesizer-3.0.2/plugins/overlay-text/overlay-text.h easyimagesizer-3.0.5/plugins/overlay-text/overlay-text.h --- easyimagesizer-3.0.2/plugins/overlay-text/overlay-text.h 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/plugins/overlay-text/overlay-text.h 2012-06-16 07:45:19.000000000 +0000 @@ -33,12 +33,12 @@ class OverlayText; } -class OverlayText: public EasyImageSizer3Plugin { +class OverlayText: public QObject, public EasyImageSizer3Plugin { Q_OBJECT Q_INTERFACES(EasyImageSizer3Plugin) public: - OverlayText(QWidget *parent = 0); + OverlayText(); ~OverlayText(); QFont *font; @@ -53,6 +53,8 @@ QString getAuthor(); QString getDescription(); QIcon getIcon(); + QWidget* createWidget(); + QObject* getObject(){ return this; } void convert(EisImage *image); private slots: @@ -64,7 +66,9 @@ void makePreview(); private: - Ui::OverlayText *ui;signals: + Ui::OverlayText *ui; + QWidget *widget; +signals: void progress(int); }; diff -Nru easyimagesizer-3.0.2/plugins/rename/rename.cpp easyimagesizer-3.0.5/plugins/rename/rename.cpp --- easyimagesizer-3.0.2/plugins/rename/rename.cpp 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/plugins/rename/rename.cpp 2012-06-16 07:45:19.000000000 +0000 @@ -24,18 +24,20 @@ #include #include -Rename::Rename(QWidget *parent) : - QWidget(parent), +Rename::Rename() : ui(new Ui::Rename) { - ui->setupUi(this); + widget = new QWidget(); + ui->setupUi(widget); loadState(); } Rename::~Rename() { saveState(); + widget->close(); delete ui; + delete widget; } QString Rename::getName(){ @@ -47,7 +49,7 @@ } QString Rename::getVersion(){ - return QString("0.3"); + return QString("0.4"); } QString Rename::getAuthor(){ @@ -62,14 +64,19 @@ return QIcon(); } +QWidget * Rename::createWidget(){ + return widget; +} + void Rename::convert(EisImage *image){ emit progress(50); QString fileName = image->getName(); - if(ui->counterCheckBox->isChecked() && !(ui->prefixLineEdit->text().isEmpty() && ui->suffixLineEdit->text().isEmpty())){ - fileName = QString(ui->prefixLineEdit->text()); + if(ui->renameCheckBox->isChecked() && !(ui->prefixLineEdit->text().isEmpty() && ui->suffixLineEdit->text().isEmpty())){ + fileName.prepend(ui->prefixLineEdit->text()); + fileName.append(ui->suffixLineEdit->text()); + if(ui->counterCheckBox->isChecked()) fileName.append(QString("%1").arg(ui->startSpinBox->value()+image->getIndex(), ui->decimalSpinBox->value(), 10, QChar('0')) ); - fileName.append(ui->suffixLineEdit->text()); } image->setName(fileName); emit progress(100); diff -Nru easyimagesizer-3.0.2/plugins/rename/rename.h easyimagesizer-3.0.5/plugins/rename/rename.h --- easyimagesizer-3.0.2/plugins/rename/rename.h 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/plugins/rename/rename.h 2012-06-16 07:45:19.000000000 +0000 @@ -29,12 +29,12 @@ class Rename; } -class Rename: public EasyImageSizer3Plugin { +class Rename: public QObject, public EasyImageSizer3Plugin { Q_OBJECT Q_INTERFACES(EasyImageSizer3Plugin) public: - Rename(QWidget *parent = 0); + Rename(); ~Rename(); QString getName(); QString getTitle(); @@ -42,6 +42,8 @@ QString getAuthor(); QString getDescription(); QIcon getIcon(); + QWidget* createWidget(); + QObject* getObject(){ return this; } void convert(EisImage *image); private slots: @@ -49,7 +51,9 @@ void saveState(); private: - Ui::Rename *ui;signals: + Ui::Rename *ui; + QWidget *widget; +signals: void progress(int); }; diff -Nru easyimagesizer-3.0.2/plugins/resize/resize.cpp easyimagesizer-3.0.5/plugins/resize/resize.cpp --- easyimagesizer-3.0.2/plugins/resize/resize.cpp 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/plugins/resize/resize.cpp 2012-06-16 07:45:19.000000000 +0000 @@ -25,9 +25,10 @@ #include "resize.h" #include "ui_resize.h" -Resize::Resize(QWidget *parent) : - QWidget(parent), ui(new Ui::Resize) { - ui->setupUi(this); +Resize::Resize() : + ui(new Ui::Resize) { + widget = new QWidget(); + ui->setupUi(widget); loadState(); @@ -43,7 +44,9 @@ Resize::~Resize() { saveState(); + widget->close(); delete ui; + delete widget; } QString Resize::getName() { @@ -70,6 +73,10 @@ return QIcon(""); } +QWidget * Resize::createWidget(){ + return widget; +} + void Resize::convert(EisImage *image) { emit progress(1); // scale image by percentage diff -Nru easyimagesizer-3.0.2/plugins/resize/resize.h easyimagesizer-3.0.5/plugins/resize/resize.h --- easyimagesizer-3.0.2/plugins/resize/resize.h 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/plugins/resize/resize.h 2012-06-16 07:45:19.000000000 +0000 @@ -29,12 +29,12 @@ class Resize; } -class Resize: public EasyImageSizer3Plugin { +class Resize: public QObject, public EasyImageSizer3Plugin { Q_OBJECT Q_INTERFACES(EasyImageSizer3Plugin) public: - Resize(QWidget *parent = 0); + Resize(); ~Resize(); QString getName(); QString getTitle(); @@ -42,6 +42,8 @@ QString getAuthor(); QString getDescription(); QIcon getIcon(); + QWidget* createWidget(); + QObject* getObject(){ return this; } void convert(EisImage *image); private slots: @@ -55,6 +57,7 @@ private: Ui::Resize *ui; + QWidget *widget; signals: void progress(int); diff -Nru easyimagesizer-3.0.2/plugins/rotate/rotate.cpp easyimagesizer-3.0.5/plugins/rotate/rotate.cpp --- easyimagesizer-3.0.2/plugins/rotate/rotate.cpp 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/plugins/rotate/rotate.cpp 2012-06-16 07:45:19.000000000 +0000 @@ -25,16 +25,19 @@ #include "rotate.h" #include "ui_rotate.h" -Rotate::Rotate(QWidget *parent) : - QWidget(parent), ui(new Ui::Rotate) { - ui->setupUi(this); +Rotate::Rotate() : + ui(new Ui::Rotate) { + widget = new QWidget(); + ui->setupUi(widget); loadState(); } Rotate::~Rotate() { saveState(); + widget->close(); delete ui; + delete widget; } QString Rotate::getName() { @@ -61,6 +64,10 @@ return QIcon(""); } +QWidget * Rotate::createWidget(){ + return widget; +} + void Rotate::convert(EisImage *image) { emit progress(1); if (!ui->no_rotation->isChecked()) { diff -Nru easyimagesizer-3.0.2/plugins/rotate/rotate.h easyimagesizer-3.0.5/plugins/rotate/rotate.h --- easyimagesizer-3.0.2/plugins/rotate/rotate.h 2011-06-23 15:45:18.000000000 +0000 +++ easyimagesizer-3.0.5/plugins/rotate/rotate.h 2012-06-16 07:45:19.000000000 +0000 @@ -29,13 +29,13 @@ class Rotate; } -class Rotate : public EasyImageSizer3Plugin +class Rotate : public QObject, public EasyImageSizer3Plugin { Q_OBJECT Q_INTERFACES(EasyImageSizer3Plugin) public: - Rotate(QWidget *parent = 0); + Rotate(); ~Rotate(); QString getName(); QString getTitle(); @@ -43,6 +43,8 @@ QString getAuthor(); QString getDescription(); QIcon getIcon(); + QWidget* createWidget(); + QObject* getObject(){ return this; } void convert(EisImage *image); private slots: @@ -52,6 +54,7 @@ private: Ui::Rotate *ui; + QWidget *widget; signals: void progress(int);