diff --git a/YACReader.1 b/YACReader.1 index 9777636f..4f3d7987 100644 --- a/YACReader.1 +++ b/YACReader.1 @@ -25,7 +25,7 @@ Display this text and exit. .BR \-v, \-\- version Display version information and exit. .SH FEATURES -- rar, zip, cbr, cbz, tar, pdf, 7z and cb7 comics support with compatibility for jpeg, gif, png, tiff and bmp images. +- rar, zip, cbr, cbz, tar and pdf comics support with compatibility for jpeg, gif, png, tiff, webp and bmp images. .TP - Fast and easy to use. .TP diff --git a/YACReaderLibrary/headless/console_ui_library_creator.cpp b/YACReaderLibrary/headless/console_ui_library_creator.cpp index e7e6adf0..aa133c6f 100644 --- a/YACReaderLibrary/headless/console_ui_library_creator.cpp +++ b/YACReaderLibrary/headless/console_ui_library_creator.cpp @@ -17,7 +17,10 @@ void ConsoleUILibraryCreator::createLibrary(const QString & name, const QString QEventLoop eventLoop; LibraryCreator * libraryCreator = new LibraryCreator(); - libraryCreator->createLibrary(QDir::cleanPath(path),QDir::cleanPath(path)+"/.yacreaderlibrary"); + QDir pathDir(path); + QString cleanPath = QDir::cleanPath(pathDir.absolutePath()); + + libraryCreator->createLibrary(cleanPath,QDir::cleanPath(pathDir.absolutePath()+"/.yacreaderlibrary")); connect(libraryCreator, &LibraryCreator::finished, this, &ConsoleUILibraryCreator::done); connect(libraryCreator, &LibraryCreator::comicAdded, this, &ConsoleUILibraryCreator::newComic); @@ -33,7 +36,7 @@ void ConsoleUILibraryCreator::createLibrary(const QString & name, const QString //TODO, at some point some checking is needed for avoiding duplicated libraries YACReaderLibraries yacreaderLibraries; yacreaderLibraries.load(); - yacreaderLibraries.addLibrary(name, path); + yacreaderLibraries.addLibrary(name, cleanPath); yacreaderLibraries.save(); } @@ -42,7 +45,10 @@ void ConsoleUILibraryCreator::updateLibrary(const QString & path) QEventLoop eventLoop; LibraryCreator * libraryCreator = new LibraryCreator(); - libraryCreator->updateLibrary(QDir::cleanPath(path),QDir::cleanPath(path)+"/.yacreaderlibrary"); + QDir pathDir(path); + QString cleanPath = QDir::cleanPath(pathDir.absolutePath()); + + libraryCreator->updateLibrary(cleanPath,QDir::cleanPath(pathDir.absolutePath()+"/.yacreaderlibrary")); connect(libraryCreator, &LibraryCreator::finished, this, &ConsoleUILibraryCreator::done); connect(libraryCreator, &LibraryCreator::comicAdded, this, &ConsoleUILibraryCreator::newComic); @@ -58,13 +64,16 @@ void ConsoleUILibraryCreator::updateLibrary(const QString & path) void ConsoleUILibraryCreator::addExistingLibrary(const QString & name, const QString & path) { + QDir pathDir(path); + QString cleanPath = QDir::cleanPath(pathDir.absolutePath()); + //TODO add error handling YACReaderLibraries yacreaderLibraries; yacreaderLibraries.load(); - yacreaderLibraries.addLibrary(name, path); + yacreaderLibraries.addLibrary(name, cleanPath); yacreaderLibraries.save(); - std::cout << "Library added : " << name.toUtf8().constData() << " at " << path.toUtf8().constData() << std::endl; + std::cout << "Library added : " << name.toUtf8().constData() << " at " << cleanPath.toUtf8().constData() << std::endl; } void ConsoleUILibraryCreator::removeLibrary(const QString & name) diff --git a/YACReaderLibrary/headless/main.cpp b/YACReaderLibrary/headless/main.cpp index 3ac8801a..dd704f46 100644 --- a/YACReaderLibrary/headless/main.cpp +++ b/YACReaderLibrary/headless/main.cpp @@ -141,7 +141,7 @@ int main( int argc, char ** argv ) QDir().mkpath(YACReader::getSettingsPath()); Logger& logger = Logger::instance(); - logger.setLoggingLevel(QsLogging::TraceLevel); + logger.setLoggingLevel(QsLogging::InfoLevel); DestinationPtr fileDestination(DestinationFactory::MakeFileDestination( destLog, EnableLogRotation, MaxSizeBytes(1048576), MaxOldLogCount(2))); diff --git a/YACReaderLibrary/YACReaderLibraryServer.pro b/YACReaderLibraryServer/YACReaderLibraryServer.pro similarity index 60% rename from YACReaderLibrary/YACReaderLibraryServer.pro rename to YACReaderLibraryServer/YACReaderLibraryServer.pro index d377d567..1e6d1f7e 100644 --- a/YACReaderLibrary/YACReaderLibraryServer.pro +++ b/YACReaderLibraryServer/YACReaderLibraryServer.pro @@ -5,11 +5,11 @@ TEMPLATE = app TARGET = YACReaderLibraryServer CONFIG += console -DEPENDPATH += . -INCLUDEPATH += . +DEPENDPATH += ../YACReaderLibrary +INCLUDEPATH += ../YACReaderLibrary INCLUDEPATH += ../common \ - ./server \ - ./db + ../YACReaderLibrary/server \ + ../YACReaderLibrary/db DEFINES += SERVER_RELEASE NOMINMAX YACREADER_LIBRARY QT_NO_DEBUG_OUTPUT QMAKE_MAC_SDK = macosx10.11 @@ -46,14 +46,14 @@ CONFIG += c++11 #CONFIG += release CONFIG -= flat -QT += core sql network script +QT += core sql network # Input -HEADERS += library_creator.h \ - package_manager.h \ - bundle_creator.h \ - db_helper.h \ - ./db/data_base_management.h \ +HEADERS += ../YACReaderLibrary/library_creator.h \ + ../YACReaderLibrary/package_manager.h \ + ../YACReaderLibrary/bundle_creator.h \ + ../YACReaderLibrary/db_helper.h \ + ../YACReaderLibrary/db/data_base_management.h \ ../common/comic_db.h \ ../common/folder.h \ ../common/library_item.h \ @@ -61,36 +61,36 @@ HEADERS += library_creator.h \ ../common/bookmarks.h \ ../common/qnaturalsorting.h \ ../common/yacreader_global.h \ - yacreader_local_server.h \ - comics_remover.h \ + ../YACReaderLibrary/yacreader_local_server.h \ + ../YACReaderLibrary/comics_remover.h \ ../common/http_worker.h \ - yacreader_libraries.h \ - comic_files_manager.h \ - headless/console_ui_library_creator.h + ../YACReaderLibrary/yacreader_libraries.h \ + ../YACReaderLibrary/comic_files_manager.h \ + ../YACReaderLibrary/headless/console_ui_library_creator.h -SOURCES += library_creator.cpp \ - .\headless\main.cpp \ - package_manager.cpp \ - bundle_creator.cpp \ - db_helper.cpp \ - ./db/data_base_management.cpp \ +SOURCES += ../YACReaderLibrary/library_creator.cpp \ + ../YACReaderLibrary/headless\main.cpp \ + ../YACReaderLibrary/package_manager.cpp \ + ../YACReaderLibrary/bundle_creator.cpp \ + ../YACReaderLibrary/db_helper.cpp \ + ../YACReaderLibrary/db/data_base_management.cpp \ ../common/comic_db.cpp \ ../common/folder.cpp \ ../common/library_item.cpp \ ../common/comic.cpp \ ../common/bookmarks.cpp \ ../common/qnaturalsorting.cpp \ - yacreader_local_server.cpp \ - comics_remover.cpp \ + ../YACReaderLibrary/yacreader_local_server.cpp \ + ../YACReaderLibrary/comics_remover.cpp \ ../common/http_worker.cpp \ ../common/yacreader_global.cpp \ - yacreader_libraries.cpp \ - comic_files_manager.cpp \ - headless/console_ui_library_creator.cpp + ../YACReaderLibrary/yacreader_libraries.cpp \ + ../YACReaderLibrary/comic_files_manager.cpp \ + ../YACReaderLibrary/headless/console_ui_library_creator.cpp -include(./server/server.pri) +include(../YACReaderLibrary/server/server.pri) CONFIG(7zip){ include(../compressed_archive/wrapper.pri) } else:CONFIG(unarr) { @@ -111,7 +111,7 @@ TRANSLATIONS = yacreaderlibraryserver_es.ts \ yacreaderlibraryserver_source.ts -RESOURCES += headless/images.qrc +RESOURCES += ../YACReaderLibrary/headless/images.qrc Release:DESTDIR = ../release @@ -131,7 +131,17 @@ DATADIR = $$PREFIX/share DEFINES += "LIBDIR=\\\"$$LIBDIR\\\"" "DATADIR=\\\"$$DATADIR\\\"" "BINDIR=\\\"$$BINDIR\\\"" #MAKE INSTALL -INSTALLS += bin server translation #manpage +CONFIG(server_standalone) { + INSTALLS += bin server translation +} +else:CONFIG(server_bundled) { + INSTALLS += bin +} +else { + INSTALLS += bin server translation + message("No build type specified. Defaulting to standalone server build (CONFIG+=server_standalone).") + message("If you wish to run YACReaderLibraryServer on a system with an existing install of YACReaderLibrary, please specify CONFIG+=server_bundled as an option when running qmake.") +} bin.path = $$BINDIR isEmpty(DESTDIR) { diff --git a/YACReaderLibrary/headless_config.pri b/YACReaderLibraryServer/headless_config.pri similarity index 66% rename from YACReaderLibrary/headless_config.pri rename to YACReaderLibraryServer/headless_config.pri index ab1e2c65..fd5601b8 100644 --- a/YACReaderLibrary/headless_config.pri +++ b/YACReaderLibraryServer/headless_config.pri @@ -31,41 +31,41 @@ lessThan(QT_VER_MIN, 3){ unix { !macx { - packagesExist(QtCore) { - message("Found QtCore") + packagesExist(Qt5Core) { + message("Found Qt5Core") } else: { - error("Missing dependency: QtCore") + message("Missing dependency: Qt5Core") } - packagesExist(QtGui) { - message("Found QtGui") + packagesExist(Qt5Gui) { + message("Found Qt5Gui") } else: { - error("Missing dependency: QtGui") + message("Missing dependency: Qt5Gui") } packagesExist(poppler-qt5) { message("Found poppler-qt5") } else: { - error("Missing dependency: poppler-qt5") + message("Missing dependency: poppler-qt5") } - packagesExist(QtNetwork) { - message("Found QtNetwork") + packagesExist(Qt5Network) { + message("Found Qt5Network") } else: { - error("Missing dependency: QtNetwork") + message("Missing dependency: Qt5Network") } - packagesExist(QtSql) { - message("Found QtSql") + packagesExist(Qt5Sql) { + message("Found Qt5Sql") } else: { - error("Missing dependency: QtSql") + message("Missing dependency: Qt5Sql") } packagesExist(sqlite3) { message("Found sqlite3") } else: { - error("Missing dependency: sqlite3") + message("Missing dependency: sqlite3") } } } \ No newline at end of file diff --git a/common/pdf_comic.mm b/common/pdf_comic.mm index 7f9b32ce..3eda1c07 100644 --- a/common/pdf_comic.mm +++ b/common/pdf_comic.mm @@ -97,6 +97,15 @@ QImage MacOSXPDFComic::getPage(const int pageNum) lastPageData = (void *)dataRef; + if(!lastPageData) + { + QLOG_ERROR() << "Unable to extract image from PDF file using CGPDFDocument"; + CGImageRelease(image); + CGContextRelease(bitmapContext); + CGColorSpaceRelease(genericColorSpace); + return QImage(); + } + const uchar *bytes = (const uchar *)CFDataGetBytePtr(dataRef); qtImage = QImage(bytes, pageRect.size.width, pageRect.size.height, QImage::Format_ARGB32); diff --git a/common/yacreader_global.h b/common/yacreader_global.h index d42e110d..c55a04c3 100644 --- a/common/yacreader_global.h +++ b/common/yacreader_global.h @@ -7,7 +7,7 @@ #include #endif -#define VERSION "8.5.0" +#define VERSION "8.6.0" #define USE_BACKGROUND_IMAGE_IN_GRID_VIEW "USE_BACKGROUND_IMAGE_IN_GRID_VIEW" #define OPACITY_BACKGROUND_IMAGE_IN_GRID_VIEW "OPACITY_BACKGROUND_IMAGE_IN_GRID_VIEW" diff --git a/mktarball.sh b/mktarball.sh index d1a84f8c..774cf038 100755 --- a/mktarball.sh +++ b/mktarball.sh @@ -2,7 +2,7 @@ #Script to create a source tarball for YACReader distribution and packaging #This should be run from YACReaders top source directory -YACVERSION=8.0 +YACVERSION=8.6 if [ -f Makefile ] then make distclean