diff --git a/.gitignore b/.gitignore index 0e3f3f96..6faafbe9 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ sdk *.zip CHANGES .DS_Store +deploy +mxe \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index eda65947..3644a410 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,16 +55,15 @@ set(TEST_HEADERS src/FXX.h) set(TEST_RESOURCE_FILES res/tests.qrc) set(COMPANY "Cyan") -set(COPYRIGHT "Copyright Ole-Andre Rodlie, INRIA, FxArena DA. All rights reserved.") +set(COPYRIGHT "Copyright Ole-Andre Rodlie. All rights reserved.") set(IDENTIFIER "net.fxarena.cyan") -if(CMAKE_BUILD_TYPE MATCHES RELEASE) +if(CMAKE_BUILD_TYPE MATCHES "^(release|Release|RELEASE)$") add_definitions(-DQT_NO_DEBUG_OUTPUT) endif() if(APPLE) set(ICON_FILE ${RESOURCE_FOLDER}/${PROJECT_NAME}.icns) - set(CMAKE_OSX_DEPLOYMENT_TARGET "10.7") set_source_files_properties(${PROJECT_NAME}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) set(MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME}) set(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}) @@ -84,7 +83,7 @@ find_package(Qt5 5.9 REQUIRED Core Gui Widgets Concurrent Test) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../lib/cmake/modules/") set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") option(DEPLOY "Deploy" OFF) option(USE_PKG_CONFIG "Use pkg-config" ON) @@ -113,28 +112,24 @@ else() find_package(ImageMagick COMPONENTS Magick++ REQUIRED) include_directories(${ImageMagick_INCLUDE_DIRS}) add_compile_options(${MAGICK_CFLAGS}) - if(USE_Q32) - add_definitions(-DMAGICKCORE_QUANTUM_DEPTH=32) - else() - add_definitions(-DMAGICKCORE_QUANTUM_DEPTH=16) - endif() - add_definitions(-DMAGICKCORE_HDRI_ENABLE=1) + add_definitions(-DMAGICKCORE_QUANTUM_DEPTH=16) + add_definitions(-DMAGICKCORE_HDRI_ENABLE=1) endif() add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} ${RESOURCES_FILES}) add_executable(tests ${TEST_SOURCES} ${TEST_HEADERS} ${TEST_RESOURCES_FILES}) target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Concurrent) -target_link_libraries(tests Qt5::Test) +target_link_libraries(tests Qt5::Core Qt5::Gui Qt5::Test) -if(MINGW AND DEPLOY) - target_link_libraries(${PROJECT_NAME} Threads::Threads) +if(MINGW) + target_link_libraries(${PROJECT_NAME} kernel32) endif() if(USE_PKG_CONFIG) if (DEPLOY) - target_link_libraries(${PROJECT_NAME} ${MAGICK_STATIC_LIBRARIES} ${LCMS2_LIBRARIES} ${MAGICK_LDFLAGS} ${LCMS2_LDFLAGS}) - target_link_libraries(tests ${MAGICK_STATIC_LIBRARIES} ${LCMS2_LIBRARIES} ${MAGICK_LDFLAGS} ${LCMS2_LDFLAGS}) + target_link_libraries(${PROJECT_NAME} ${MAGICK_STATIC_LIBRARIES} ${LCMS2_STATIC_LIBRARIES} ${MAGICK_STATIC_LDFLAGS} ${LCMS2_STATIC_LDFLAGS}) + target_link_libraries(tests ${MAGICK_STATIC_LIBRARIES} ${LCMS2_STATIC_LIBRARIES} ${MAGICK_STATIC_LDFLAGS} ${LCMS2_STATIC_LDFLAGS}) else() target_link_libraries(${PROJECT_NAME} ${MAGICK_LIBRARIES} ${LCMS2_LIBRARIES} ${MAGICK_LDFLAGS} ${LCMS2_LDFLAGS}) target_link_libraries(tests ${MAGICK_LIBRARIES} ${LCMS2_LIBRARIES} ${MAGICK_LDFLAGS} ${LCMS2_LDFLAGS}) diff --git a/cyan.pro b/cyan.pro index 90c88bde..8f3f5ca0 100644 --- a/cyan.pro +++ b/cyan.pro @@ -28,6 +28,8 @@ # The fact that you are presently reading this means that you have had # knowledge of the CeCILL license and that you accept its terms. +# USED FOR OFFICIAL BINARIES, USE CMAKE INSTEAD! + TARGET = Cyan VERSION = 1.2.99 @@ -46,6 +48,7 @@ HEADERS += \ src/helpdialog.h RESOURCES += \ res/cyan.qrc \ + res/fonts.qrc \ docs/docs.qrc DESTDIR = build @@ -77,7 +80,10 @@ DEFINES += CYAN_GIT=\"\\\"$${GIT}\\\"\" QMAKE_TARGET_COMPANY = "$${TARGET}" QMAKE_TARGET_PRODUCT = "$${TARGET}" QMAKE_TARGET_DESCRIPTION = "$${TARGET}" -QMAKE_TARGET_COPYRIGHT = "Copyright Ole-Andre Rodlie, INRIA" +QMAKE_TARGET_COPYRIGHT = "Copyright Ole-Andre Rodlie" + +DEFINES += DEPLOY +unix:!mac: DEFINES += BUNDLE_FONT CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT @@ -127,12 +133,13 @@ unix:!mac { mac { ICON = res/Cyan.icns QMAKE_INFO_PLIST = res/Info.plist - QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13 - QMAKE_CXXFLAGS += -fopenmp - QMAKE_LFLAGS += -fopenmp + #QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10 + #QMAKE_CXXFLAGS += -fopenmp + #QMAKE_LFLAGS += -fopenmp } win32 { RC_ICONS += res/cyan.ico - LIBS += -lpthread + #LIBS += -lpthread + LIBS += -lkernel32 } diff --git a/docs/ChangeLog.md b/docs/ChangeLog.md index 5dd03ac3..5590b91f 100644 --- a/docs/ChangeLog.md +++ b/docs/ChangeLog.md @@ -3,15 +3,14 @@ * Enhanced layer support * UI changes -## 1.2.3 - 20220313 +## 1.2.3 - 20220318 - * Minor UI fixes + * Fixed some (not all) UI scaling issues * Windows fixes - * Several Gimp compatibility fixes + * Gimp compatibility fixes * Fixed issues when loading some TIFF images - * Improved ImageMagick memory resource handler - * Downgraded to ImageMagick 6.9 (still compatible with 7.x) - * ImageMagick 7.x has OpenMP issues on MinGW and macOS + * Improved ImageMagick compatibility + * Fixed compatibility with Qt 5.15 * Updated third-party software (included in binaries) ## 1.2.2 - 20191103 diff --git a/docs/README.md b/docs/README.md index b5ab1efa..c4ac86e0 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,12 +1,14 @@ # Cyan -Cyan is an open source cross-platform image viewer and converter, designed for [prepress](https://en.wikipedia.org/wiki/Prepress) (print) work. Like converting an image from [RGB](https://en.wikipedia.org/wiki/RGB_color_model) to [CMYK](https://en.wikipedia.org/wiki/CMYK_color_model), or the other way around. Cyan supports [color profiles](https://en.wikipedia.org/wiki/ICC_profile) complying with the [International Color Consortium](http://www.color.org/index.xalter) (ICC) standard, and strives to create as color-accurate images as possible, with support for [RGB](https://en.wikipedia.org/wiki/RGB_color_model), [CMYK](https://en.wikipedia.org/wiki/CMYK_color_model) and [GRAY](https://en.wikipedia.org/wiki/Grayscale) with up to [32-bit](https://en.wikipedia.org/wiki/32-bit) image depth. +Cyan is an open source cross-platform image viewer and converter, designed for [prepress](https://en.wikipedia.org/wiki/Prepress) (print) work. Like converting an image from [RGB](https://en.wikipedia.org/wiki/RGB_color_model) to [CMYK](https://en.wikipedia.org/wiki/CMYK_color_model), or the other way around. Cyan supports [color profiles](https://en.wikipedia.org/wiki/ICC_profile) complying with the [International Color Consortium](http://www.color.org/index.xalter) (ICC) standard, and strives to create as color-accurate images as possible, with support for [RGB](https://en.wikipedia.org/wiki/RGB_color_model), [CMYK](https://en.wikipedia.org/wiki/CMYK_color_model) and [GRAY](https://en.wikipedia.org/wiki/Grayscale). -![Promo](https://github.com/rodlie/cyan/raw/1.2/docs/images/cyan-promo-01.png) + + +[![Download](https://a.fsdn.com/con/app/sf-download-button)](https://github.com/rodlie/cyan/releases/latest) # Features -* Supports RGB/CMYK/GRAY 8/16/32 bit images +* Supports RGB/CMYK/GRAY images * Supports ICC/ICM v2/v4 color profiles * Supports PNG, JPEG, TIFF, XCF and PSD image input * Supports TIFF, JPEG and PSD image output @@ -20,17 +22,16 @@ Cyan is an open source cross-platform image viewer and converter, designed for [ * Color convert images with layers (PSD/TIFF) # News -![Promo](https://github.com/rodlie/cyan/raw/1.2/docs/images/cyan-promo-02.png) +![Promo](images/cyan-promo-02.png) News and updates related to Cyan. + * [Cyan 1.2.3 released](https://github.com/rodlie/cyan/releases/tag/1.2.3) * [Cyan 1.2.2 released](https://github.com/rodlie/cyan/releases/tag/1.2.2) * [Cyan 1.2.1 released](https://github.com/rodlie/cyan/releases/tag/1.2.1) * [Cyan 1.2.0 released](https://github.com/rodlie/cyan/releases/tag/1.2.0) - * [The (long) road to Cyan 2](https://github.com/rodlie/cyan/issues/12) - # Open Source -![Promo](https://github.com/rodlie/cyan/raw/1.2/docs/images/cyan-promo-05.png) +![Promo](images/cyan-promo-05.png) This software is governed by the CeCILL license under French law and abiding by the rules of distribution of free software. You can use, modify and / or redistribute the software under the terms of the CeCILL license as circulated by CEA, CNRS and INRIA at the following URL https://www.cecill.info. diff --git a/docs/_config.yml b/docs/_config.yml index 8b715498..99ab0f0a 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -2,4 +2,8 @@ theme: jekyll-theme-minimal title: Cyan description: Open source prepress image viewer and converter logo: https://github.com/rodlie/cyan/raw/1.2/res/hicolor/256x256/apps/cyan.png -show_downloads: false +show_downloads: true + +github: + zip_url: https://sourceforge.net/projects/prepress/files/1.2.3/Cyan-1.2.3-Windows-x64.zip/download + tar_url: https://sourceforge.net/projects/prepress/files/1.2.3/Cyan-1.2.3-Linux-x86_64.zip/download diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index f6fd9556..e3087a07 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -19,12 +19,12 @@ {% endif %} - Download Cyan + {% if site.show_downloads %} {% endif %} diff --git a/docs/cyan.html b/docs/cyan.html index 36a440be..e7b9ceea 100644 --- a/docs/cyan.html +++ b/docs/cyan.html @@ -91,9 +91,5 @@

Open Source

_3RDPARTY_

-

Hosted on Github and Sourceforge.

- -

- diff --git a/docs/images/oss-community-choice-white.svg b/docs/images/oss-community-choice-white.svg new file mode 100644 index 00000000..76d73fd6 --- /dev/null +++ b/docs/images/oss-community-choice-white.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/images/oss-users-love-us-white.svg b/docs/images/oss-users-love-us-white.svg new file mode 100644 index 00000000..5b9ba8c5 --- /dev/null +++ b/docs/images/oss-users-love-us-white.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/res/fonts.qrc b/res/fonts.qrc new file mode 100644 index 00000000..60565215 --- /dev/null +++ b/res/fonts.qrc @@ -0,0 +1,5 @@ + + + fonts/DejaVuSans.ttf + + diff --git a/res/fonts/DejaVuSans.ttf b/res/fonts/DejaVuSans.ttf new file mode 100644 index 00000000..e5f7eecc Binary files /dev/null and b/res/fonts/DejaVuSans.ttf differ diff --git a/res/fonts/LICENSE b/res/fonts/LICENSE new file mode 100644 index 00000000..df52c170 --- /dev/null +++ b/res/fonts/LICENSE @@ -0,0 +1,187 @@ +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. +Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) + + +Bitstream Vera Fonts Copyright +------------------------------ + +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is +a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license ("Fonts") and associated +documentation files (the "Font Software"), to reproduce and distribute the +Font Software, including without limitation the rights to use, copy, merge, +publish, distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to the +following conditions: + +The above copyright and trademark notices and this permission notice shall +be included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional glyphs or characters may be added to the Fonts, only if the fonts +are renamed to names not containing either the words "Bitstream" or the word +"Vera". + +This License becomes null and void to the extent applicable to Fonts or Font +Software that has been modified and is distributed under the "Bitstream +Vera" names. + +The Font Software may be sold as part of a larger software package but no +copy of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING +ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE +FONT SOFTWARE. + +Except as contained in this notice, the names of Gnome, the Gnome +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font Software +without prior written authorization from the Gnome Foundation or Bitstream +Inc., respectively. For further information, contact: fonts at gnome dot +org. + +Arev Fonts Copyright +------------------------------ + +Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the fonts accompanying this license ("Fonts") and +associated documentation files (the "Font Software"), to reproduce +and distribute the modifications to the Bitstream Vera Font Software, +including without limitation the rights to use, copy, merge, publish, +distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to +the following conditions: + +The above copyright and trademark notices and this permission notice +shall be included in all copies of one or more of the Font Software +typefaces. + +The Font Software may be modified, altered, or added to, and in +particular the designs of glyphs or characters in the Fonts may be +modified and additional glyphs or characters may be added to the +Fonts, only if the fonts are renamed to names not containing either +the words "Tavmjong Bah" or the word "Arev". + +This License becomes null and void to the extent applicable to Fonts +or Font Software that has been modified and is distributed under the +"Tavmjong Bah Arev" names. + +The Font Software may be sold as part of a larger software package but +no copy of one or more of the Font Software typefaces may be sold by +itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL +TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +Except as contained in this notice, the name of Tavmjong Bah shall not +be used in advertising or otherwise to promote the sale, use or other +dealings in this Font Software without prior written authorization +from Tavmjong Bah. For further information, contact: tavmjong @ free +. fr. + +TeX Gyre DJV Math +----------------- +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. + +Math extensions done by B. Jackowski, P. Strzelczyk and P. Pianowski +(on behalf of TeX users groups) are in public domain. + +Letters imported from Euler Fraktur from AMSfonts are (c) American +Mathematical Society (see below). +Bitstream Vera Fonts Copyright +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera +is a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license (“Fonts”) and associated +documentation +files (the “Font Software”), to reproduce and distribute the Font Software, +including without limitation the rights to use, copy, merge, publish, +distribute, +and/or sell copies of the Font Software, and to permit persons to whom +the Font Software is furnished to do so, subject to the following +conditions: + +The above copyright and trademark notices and this permission notice +shall be +included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional +glyphs or characters may be added to the Fonts, only if the fonts are +renamed +to names not containing either the words “Bitstream” or the word “Vera”. + +This License becomes null and void to the extent applicable to Fonts or +Font Software +that has been modified and is distributed under the “Bitstream Vera” +names. + +The Font Software may be sold as part of a larger software package but +no copy +of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, +SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN +ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR +INABILITY TO USE +THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. +Except as contained in this notice, the names of GNOME, the GNOME +Foundation, +and Bitstream Inc., shall not be used in advertising or otherwise to promote +the sale, use or other dealings in this Font Software without prior written +authorization from the GNOME Foundation or Bitstream Inc., respectively. +For further information, contact: fonts at gnome dot org. + +AMSFonts (v. 2.2) copyright + +The PostScript Type 1 implementation of the AMSFonts produced by and +previously distributed by Blue Sky Research and Y&Y, Inc. are now freely +available for general use. This has been accomplished through the +cooperation +of a consortium of scientific publishers with Blue Sky Research and Y&Y. +Members of this consortium include: + +Elsevier Science IBM Corporation Society for Industrial and Applied +Mathematics (SIAM) Springer-Verlag American Mathematical Society (AMS) + +In order to assure the authenticity of these fonts, copyright will be +held by +the American Mathematical Society. This is not meant to restrict in any way +the legitimate use of the fonts, such as (but not limited to) electronic +distribution of documents containing these fonts, inclusion of these fonts +into other public domain or commercial font collections or computer +applications, use of the outline data to create derivative fonts and/or +faces, etc. However, the AMS does require that the AMS copyright notice be +removed from any derivative versions of the fonts which have been altered in +any way. In addition, to ensure the fidelity of TeX documents using Computer +Modern fonts, Professor Donald Knuth, creator of the Computer Modern faces, +has requested that any alterations which yield different font metrics be +given a different name. + +$Id$ diff --git a/res/magick.sh b/res/magick.sh index 351c3bea..7388d951 100755 --- a/res/magick.sh +++ b/res/magick.sh @@ -4,11 +4,13 @@ set -e -x CWD=`pwd` OS=`uname -s` SDK=${SDK:-/opt/$OS} -MAGICK=${MAGICK:-"6.9.12-23"} +MAGICK=${MAGICK:-"6.9.11-62"} OSX_MIN=10.7 CLANG_VER=mp-6.0 CLANG_PATH=/opt/local/bin JOBS=${JOBS:-2} +#TIFF=4.3.0 +#LCMS=2.13.1 DEFAULT_FLAGS="-I$SDK/include -L$SDK/lib" if [ "$OS" = "Darwin" ]; then @@ -17,7 +19,7 @@ else DEFAULT_FLAGS="-fPIC -march=core2 -mtune=corei7-avx $DEFAULT_FLAGS" fi -DEFAULT_CONFIGURE="--prefix=${SDK} --disable-shared --enable-static --disable-docs --disable-deprecated --with-magick-plus-plus=yes --with-quantum-depth=16 --without-dps --without-djvu --without-fftw --without-fpx --without-heic --without-gslib --without-gvc --without-jbig --with-jpeg --with-lcms2 --without-openjp2 --without-lqr --with-lzma --without-openexr --without-pango --with-png --without-rsvg --with-tiff --without-webp --without-xml --with-zlib --with-bzlib --enable-hdri --without-freetype --without-fontconfig --without-x --without-modules" +DEFAULT_CONFIGURE="--prefix=${SDK} --disable-shared --enable-static --disable-docs --disable-deprecated --with-magick-plus-plus=yes --with-quantum-depth=16 --without-dps --without-djvu --without-fftw --without-fpx --without-heic --without-gslib --without-gvc --without-jbig --with-jpeg --with-lcms --with-lzma --without-openjp2 --without-lqr --with-lzma --without-openexr --without-pango --with-png --without-rsvg --with-tiff --without-webp --with-xml --with-zlib --with-bzlib --enable-hdri --without-freetype --without-fontconfig --without-x --without-modules" if [ "$OS" = "Darwin" ]; then export CC="${CLANG_PATH}/clang-${CLANG_VER} -stdlib=libc++ -mmacosx-version-min=$OSX_MIN" @@ -25,20 +27,47 @@ if [ "$OS" = "Darwin" ]; then fi export PKG_CONFIG_PATH="$SDK/lib/pkgconfig:$PKG_CONFIG_PATH" -export PATH=$SDK/bin:/usr/bin:/usr/sbin:/bin:/sbin +#export PATH=$SDK/bin:/usr/bin:/usr/sbin:/bin:/sbin +#cd $CWD +#git clone https://gitlab.com/libtiff/libtiff +#cd libtiff +#git checkout v${TIFF} +#./autogen.sh + +#cd $CWD +#mkdir build-tiff && cd build-tiff +#CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" ../libtiff/configure --prefix=${SDK} --enable-static --disable-shared +#make -j$JOBS +#make install + +#cd $CWD +#git clone https://github.com/mm2/Little-CMS lcms2 +#cd lcms2 +#git checkout lcms${LCMS} +##./autogen.sh + +#cd $CWD +#mkdir build-lcms2 && cd build-lcms2 +#CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" ../lcms2/configure --prefix=${SDK} --enable-static --disable-shared +#make -j$JOBS +#make install + +cd $CWD git clone https://github.com/ImageMagick/ImageMagick6 cd ImageMagick6 git checkout $MAGICK + cd $CWD mkdir build-magick && cd build-magick -EXTRA_LDFLAGS="" -if [ "$OS" = "Darwin" ]; then - EXTRA_LDFLAGS="-mmacosx-version-min=$OSX_MIN" -fi -LDFLAGS="$EXTRA_LDFLAGS" LIBS="-lz -llzma" CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" ../ImageMagick6/configure $DEFAULT_CONFIGURE -sed -i'.original' -e 's/-ltiff/-ltiff -llzma/g' ../ImageMagick6/configure -LIBS="-lz -llzma" CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" ../ImageMagick6/configure $DEFAULT_CONFIGURE +#EXTRA_LDFLAGS="" +#if [ "$OS" = "Darwin" ]; then +# EXTRA_LDFLAGS="-mmacosx-version-min=$OSX_MIN" +#fi +#export PKG_CONFIG_PATH="$SDK/lib/pkgconfig:$PKG_CONFIG_PATH" +#LDFLAGS="$EXTRA_LDFLAGS" LIBS="-lz -llzma" CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" ../ImageMagick6/configure $DEFAULT_CONFIGURE +sed -i'.original' -e 's/-ltiff/-ltiff -llzma -ljbig -ljpeg -lz/g' ../ImageMagick6/configure +CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" ../ImageMagick6/configure $DEFAULT_CONFIGURE make -j$JOBS make install diff --git a/res/mktarball.sh b/res/mktarball.sh new file mode 100755 index 00000000..0f43d896 --- /dev/null +++ b/res/mktarball.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e -x + +CWD=`pwd` +BUILD_DIR=${BUILD_DIR:-"${CWD}/../cyan-tmp"} +VERSION=${VERSION:-1.2.3} + +rm -rf "${BUILD_DIR}" || true +mkdir -p "${BUILD_DIR}" && cd "${BUILD_DIR}" + +git clone ${CWD} cyan-${VERSION} +cd cyan-${VERSION} +git checkout ${VERSION} +rm -rf .git* docs/_config.yml docs/_layouts docs/CNAME .travis* || true + +cd "${BUILD_DIR}" +tar cvvf cyan-${VERSION}.tar cyan-${VERSION} +xz -9 cyan-${VERSION}.tar +ls -lah *.tar.xz diff --git a/res/release.sh b/res/release.sh new file mode 100755 index 00000000..19bb4598 --- /dev/null +++ b/res/release.sh @@ -0,0 +1,93 @@ +#!/bin/sh +# +# Build Cyan release for Windows and Linux +# +# Windows release is built on Ubuntu 20.04 using MXE +# Linux release is built on CentOS 7 using DTS-7 +# +# macOS support will be added if demand is high enough. +# + +set -e + +CWD=`pwd` +OS=${OS:-"Windows"} # Windows is default +SDK=${SDK:-${CWD}/${OS}} +TYPE=${TYPE:-Release} +MKJOBS=${MKJOBS:-1} +MAGICK=${MAGICK:-Magick++-6.Q16HDRI} +BUILD_DIR=${BUILD_DIR:-"${CWD}/tmp"} +MXE=${MXE:-/opt/cyan-mxe} +MXE_TC=${MXE_TC:-x86_64-w64-mingw32.static} +CMAKE=${MXE_TC}-cmake +STRIP="${MXE_TC}-strip -s" +WINE=${WINE:-wine64} +QMAKE=${MXE}/usr/${MXE_TC}/qt5/bin/qmake +VERSION=`cat CMakeLists.txt | sed '/Cyan VERSION/!d;s/)//' | awk '{print $3}'` +CI=20220315 + +ARCH="x86_64" +if [ "${OS}" = "Windows" ]; then + ARCH="x64" +fi + +if [ "${OS}" = "Windows" ]; then + SDK="${MXE}/usr/${MXE_TC}" + export PATH="${MXE}/usr/bin:${MXE}/usr/${MXE_TC}/qt5/bin:${PATH}" +elif [ "${OS}" = "Linux" ]; then + CMAKE="cmake" + STRIP="strip -s" + WINE="" + QMAKE="${SDK}/bin/qmake" + export PATH="${SDK}/usr/bin:${PATH}" +fi +export PKG_CONFIG_PATH="${SDK}/lib/pkgconfig" + +echo "Building Cyan ${VERSION} ${ARCH} for ${OS} using ${SDK} ... (Ctrl+C to cancel)\n" +sleep 5 +echo "Get ready ...\n\n" +sleep 5 + +rm -rf "${BUILD_DIR}" || true +mkdir -p "${BUILD_DIR}" && cd "${BUILD_DIR}" + +${QMAKE} ../cyan.pro +make -j${MKJOBS} +AEXE=build/Cyan +if [ "${OS}" = "Windows" ]; then + AEXE=build/Cyan.exe +fi +${STRIP} ${AEXE} +ls -lah ${AEXE} + +mkdir tst +cd tst +${QMAKE} ../../tests.pro +make +if [ "${OS}" = "Windows" ]; then + ${WINE} build/tests.exe +fi + +cd "${BUILD_DIR}" + +if [ ! -d "${CWD}/legal" ]; then + curl -L https://github.com/rodlie/cyan/releases/download/continuous/cyan-sdk-legal-${CI}.tar.xz -o legal.tar.xz + tar xvf legal.tar.xz -C "${CWD}/" +fi + +ZIP_DIR=Cyan-${VERSION}-${OS}-${ARCH} +mkdir -p ${ZIP_DIR} +cp ${AEXE} ${ZIP_DIR}/ +cp ../LICENSE ${ZIP_DIR}/LICENSE.TXT +cp -a ${CWD}/legal ${ZIP_DIR}/ + +if [ "${OS}" = "Windows" ]; then + rm -rf ${ZIP_DIR}/legal/libxkbcommon || true +else + rm -rf ${ZIP_DIR}/legal/gcc ${ZIP_DIR}/legal/mingw-w64 || true +fi + +echo "Licenses for included open-source software.\n\nSource code :\n\nhttps://github.com/rodlie/cyan/releases/download/continuous/cyan-sdk-src-${CI}.tar\nhttps://github.com/rodlie/cyan/releases/download/continuous/cyan-mxe-${CI}.tar.xz" > ${ZIP_DIR}/legal/README.TXT +zip -9 -r ${ZIP_DIR}.zip ${ZIP_DIR} + +ls -lah ${ZIP_DIR}.zip diff --git a/res/sample-GRAY.tif b/res/sample-GRAY.tif index 6ef70527..d6344db3 100644 Binary files a/res/sample-GRAY.tif and b/res/sample-GRAY.tif differ diff --git a/res/sdk.sh b/res/sdk.sh new file mode 100644 index 00000000..8b7c70ae --- /dev/null +++ b/res/sdk.sh @@ -0,0 +1,284 @@ +#!/bin/sh +# +# Cyan Linux/macOS SDK +# (c) 2019-2022 Ole-André Rodlie +# +set -e -x + +# common +CWD=`pwd` +OS=`uname -s` +JOBS=${JOBS:-8} +WRK=$CWD/tmp +KEEP_SDK=${KEEP_SDK:-1} +KEEP_TMP=${KEEP_TMP:-0} +SDK=$CWD/${OS} +SRC=$CWD/3rdparty + +# components +XKB=0.7.1 +PKGCONFIG_V=0.29.2 +ZLIB=1.2.11 +XZ=5.2.5 +JPEG=9e +TIFF=4.3.0 +PNG=1.6.37 +LCMS=2.12 # 2.13(.1) breaks GRAY unit test! +MAGICK=6.9.11-62 +QT=5.12.12 +BZIP=1.0.8 +XML=2.9.12 + +# on OSX we target High Sierra (10.13) with clang (MP) from macports +OSX_MIN=10.13 +CLANG=9.0 +CLANG_ROOT="/opt/local" + +# always include SDK dir during build +DEFAULT_FLAGS="-I$SDK/include -L$SDK/lib" + +# default compiler flags +if [ "$OS" = "Darwin" ]; then + DEFAULT_FLAGS="-mmacosx-version-min=${OSX_MIN} $DEFAULT_FLAGS" +else + DEFAULT_FLAGS="-fPIC -march=core2 -mtune=corei7-avx $DEFAULT_FLAGS" +fi + +# common configure flags +DEFAULT_CONFIGURE="--prefix=${SDK} --disable-shared --enable-static" +SHARED_CONFIGURE="--prefix=${SDK} --disable-static --enable-shared" + +# setup clang on OSX +if [ "$OS" = "Darwin" ]; then + # sudo port install clang-$CLANG ld64 + export CC="$CLANG_ROOT/bin/clang-mp-$CLANG -stdlib=libc++ -mmacosx-version-min=$OSX_MIN" + export CXX="$CLANG_ROOT/bin/clang++-mp-$CLANG -stdlib=libc++ -mmacosx-version-min=$OSX_MIN" +fi + +# export common env +export PKG_CONFIG_PATH="$SDK/lib/pkgconfig" +#export PATH=$SDK/bin:/usr/bin:/usr/sbin:/bin:/sbin +export PATH="${SDK}/bin:${PATH}" + +# always clean tmp +rm -rf "$WRK" || true +mkdir -p "$WRK" + +# setup sdk dir +if [ "$KEEP_SDK" = 0 ]; then + rm -rf "$SDK" || true +fi +if [ ! -d "$SDK" ]; then + mkdir -p "$SDK/lib" + (cd "$SDK"; ln -sf lib lib64) +fi + +# create source dist folder if not exists +if [ ! -d "$SRC" ]; then + mkdir -p "$SRC" +fi + +# pkgconfig +if [ "$OS" = "Darwin" ] && [ ! -f "$SDK/bin/pkg-config" ]; then + cd $WRK + rm -rf pkg-config-$PKGCONFIG_V || true + tar xvf $SRC/pkg-config-$PKGCONFIG_V.tar.gz + cd pkg-config-$PKGCONFIG_V + export LDFLAGS="-framework Foundation -framework Cocoa" + ./configure --prefix=${SDK} --with-pc-path=${SDK}/lib/pkgconfig --with-internal-glib + make + make install + unset LDFLAGS +fi + +# zlib +if [ ! -f "$SDK/lib/pkgconfig/zlib.pc" ]; then + cd $WRK + rm -rf zlib-$ZLIB || true + tar xvf $SRC/zlib-$ZLIB.tar.xz + cd zlib-$ZLIB + CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" CPPFLAGS="$DEFAULT_FLAGS" ./configure --prefix=$SDK + make + make install + if [ "$OS" = "Darwin" ]; then + rm -f $SDK/lib/*.dylib || true + elif [ "$OS" = "Linux" ]; then + rm -f $SDK/lib/libz*.so* || true + fi +fi + +# bzip +if [ ! -f "$SDK/lib/libbz2.a" ]; then + cd $WRK + rm -rf bzip2-$BZIP || true + tar xvf $SRC/bzip2-$BZIP.tar.gz + cd bzip2-$BZIP + if [ "$OS" = "Linux" ]; then + sed -i 's#CFLAGS=-Wall#CFLAGS=-fPIC -Wall#g' Makefile + fi + CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" CPPFLAGS="$DEFAULT_FLAGS" make + make PREFIX=$SDK install +fi + +# xz/lzma +if [ ! -f "$SDK/lib/pkgconfig/liblzma.pc" ]; then + cd $WRK + rm -rf xz-${XZ} || true + tar xvf $SRC/xz-${XZ}.tar.gz + cd xz-$XZ + XZ_CONFIGURE=$DEFAULT_CONFIGURE + CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" ./configure $XZ_CONFIGURE + make -j$JOBS + make install +fi + +# jpeg +if [ ! -f "$SDK/lib/pkgconfig/libjpeg.pc" ]; then + cd $WRK + rm -rf jpeg-${JPEG} || true + tar xvf $SRC/jpegsrc.v${JPEG}.tar.gz + cd jpeg-$JPEG + JPEG_CONFIGURE=$DEFAULT_CONFIGURE + CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" ./configure $JPEG_CONFIGURE + make -j$JOBS + make install +fi + +# libpng +if [ ! -f "$SDK/lib/pkgconfig/libpng16.pc" ]; then + cd $WRK + rm -rf libpng-$PKG || true + tar xvf $SRC/libpng-$PNG.tar.xz + cd libpng-$PNG + PNG_CONFIGURE=$DEFAULT_CONFIGURE + CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" CPPFLAGS="$DEFAULT_FLAGS" ./configure $PNG_CONFIGURE + make -j$JOBS + make install +fi + +# libtiff +if [ ! -f "$SDK/lib/pkgconfig/libtiff-4.pc" ]; then + cd $WRK + rm -rf tiff-$TIFF || true + tar xvf $SRC/tiff-$TIFF.tar.gz + cd tiff-$TIFF + TIF_CONFIGURE=$DEFAULT_CONFIGURE + CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" CPPFLAGS="$DEFAULT_FLAGS" ./configure $TIF_CONFIGURE \ + --without-x --disable-webp --enable-lzma --enable-jpeg12 --with-jpeg12-include-dir=$SDK/include + make -j$JOBS + make install +fi + +# lcms +if [ ! -f "$SDK/lib/pkgconfig/lcms2.pc" ]; then + cd $WRK + rm -rf lcms2-$LCMS || true + tar xvf $SRC/lcms2-$LCMS.tar.gz + cd lcms2-$LCMS + LCMS_CONFIGURE=$DEFAULT_CONFIGURE + CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" CPPFLAGS="$DEFAULT_FLAGS" ./configure $LCMS_CONFIGURE + make -j$JOBS + make install +fi + +# libxml2 +if [ ! -f "$SDK/lib/pkgconfig/libxml-2.0.pc" ]; then + cd $WRK + rm -rf libxml2-$XML || true + tar xvf $SRC/libxml2-$XML.tar.gz + cd libxml2-$XML + XML_CONFIGURE=$DEFAULT_CONFIGURE + CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" CPPFLAGS="$DEFAULT_FLAGS" ./configure $XML_CONFIGURE \ + --without-python + make -j$JOBS + make install +fi + +# imagemagick +if [ ! -f "$SDK/lib/pkgconfig/Magick++.pc" ]; then + cd $WRK || exit 1 + rm -rf ImageMagick* || true + tar xvf $SRC/ImageMagick-$MAGICK.tar.xz || exit 1 + cd ImageMagick-$MAGICK || exit 1 + if [ ! -f "${CWD}/imagemagick-3-gimp_2_10.patch" ]; then + curl -L https://github.com/nettstudio/mxe/raw/Cyan-1.2.3/src/imagemagick-3-gimp_2_10.patch -o "${CWD}/imagemagick-3-gimp_2_10.patch" + fi + patch -p1 < "${CWD}/imagemagick-3-gimp_2_10.patch" + MAGICK_LDFLAGS="" + if [ "$OS" = "Darwin" ]; then + MAGICK_LDFLAGS="-mmacosx-version-min=$OSX_MIN" + fi + sed -i 's#-ltiff#-ltiff -llzma -ljpeg -lz#g' configure + LDFLAGS="$MAGICK_LDFLAGS" LIBS="-lz -llzma -lbz2" CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" ./configure --prefix=$SDK \ + --enable-static --disable-shared \ + --with-x=no --disable-docs --disable-modules --without-modules --with-xml --without-gslib \ + --with-zlib --with-lzma --without-jasper --enable-hdri --with-quantum-depth=16 \ + --enable-largefile --without-pango --without-webp --without-fftw --without-lqr \ + --without-freetype --without-openexr --without-fontconfig \ + --enable-zero-configuration \ + || exit 1 + make -j$JOBS || exit 1 + make install || exit 1 +fi + +if [ "$OS" = "Darwin" ]; then + for i in $SDK/lib/pkgconfig/*.pc ; do + sed -i '' "s/-lgomp//g;s/-fopenmp /-fopenmp=libomp /g" $i || exit 1 + done +fi + +# libxkbcommon +if [ "$OS" = "Linux" ] && [ ! -f "$SDK/lib/pkgconfig/xkbcommon.pc" ]; then + tar xvf $SRC/libxkbcommon-$XKB.tar.xz || exit 1 + cd libxkbcommon-$XKB || exit 1 + CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" CPPFLAGS="$DEFAULT_FLAGS" ./configure $DEFAULT_CONFIGURE || exit 1 + make -j$JOBS || exit + make install || exit 1 +fi + +# qtbase +QT_CONFIGURE="-optimize-size -opensource -release -confirm-license -gui -widgets -strip -static -nomake examples -nomake tests -no-glib -no-dbus -no-openssl -no-ico -no-icu -no-sql-sqlite -no-sse4.2 -no-avx -no-avx2 -no-avx512 -no-cups -no-gtk -no-libjpeg -no-fontconfig -no-mtdev -no-syslog -no-gif -qt-pcre -qt-freetype -qt-harfbuzz -opengl desktop" +if [ ! -f "$SDK/bin/qmake" ] && [ "$OS" = "Darwin" ]; then + ## we use the legacy LTS release (5.9) on OSX + #cd $WRK || exit 1 + #tar xvf $SRC/qtbase-opensource-src-$QT.tar.xz || exit 1 + #cd $WRK/qtbase-opensource-src-$QT || exit 1 + ## set correct compiler + #sed -i '' "s#QMAKE_CC = clang#QMAKE_CC = $CLANG_ROOT/bin/clang-mp-${CLANG}#" mkspecs/common/clang.conf || exit 1 + #sed -i '' "s#QMAKE_CXX = clang++#QMAKE_CXX = $CLANG_ROOT/bin/clang++-mp-${CLANG}#" mkspecs/common/clang.conf || exit 1 + #./configure -prefix $SDK -release -opensource -c++std c++11 -framework \ + #-no-sql-sqlite -no-avx -no-avx2 -force-pkg-config -system-zlib -no-gif -no-libjpeg \ + #-system-libpng -no-fontconfig -qt-freetype -qt-harfbuzz -no-openssl -qt-pcre -nomake examples \ + #-gui -widgets -no-glib -no-cups -no-dbus -opengl desktop -no-securetransport -confirm-license -I $SDK/include -L $SDK/lib || exit 1 + #make -j$JOBS || exit 1 + #make install || exit 1 + echo "update me!" +elif [ ! -f "$SDK/bin/qmake" ] && [ "$OS" = "Linux" ]; then + cd $WRK + rm -rf qtbase-everywhere-src-$QT + tar xvf $SRC/qtbase-everywhere-src-$QT.tar.xz + cd qtbase-everywhere-src-$QT || exit 1 + export LD_LIBRARY_PATH="$SDK/lib:$LD_LIBRARY_PATH" + CFLAGS="$DEFAULT_FLAGS" CXXFLAGS="$DEFAULT_FLAGS" ./configure -prefix $SDK $QT_CONFIGURE \ + -no-eglfs -no-kms -no-linuxfb -xkbcommon -qt-xcb -system-libpng -system-zlib \ + -I $SDK/include -L $SDK/lib || exit 1 + make -j$JOBS || exit 1 + make install || exit 1 +fi + +# macdeployqt +if [ ! -f "$SDK/bin/macdeployqt" ] && [ "$OS" = "Darwin" ]; then + cd $WRK || exit 1 + rm -rf qttools* || true + tar xvf $SRC/qttools-opensource-src-$QT.tar.xz || exit 1 + cd qttools-opensource-src-$QT || exit 1 + $SDK/bin/qmake || exit 1 + make || exit 1 + make install || exit 1 +fi + +if [ "${KEEP_TMP}" = 0 ]; then + rm -rf "$WRK" || true +fi + +echo "==> Done with Cyan SDK!" diff --git a/src/FXX.cpp b/src/FXX.cpp index 8c340a10..87c6448d 100644 --- a/src/FXX.cpp +++ b/src/FXX.cpp @@ -86,7 +86,6 @@ FXX::Image FXX::readImage(const std::string &file, // get image profile std::vector imageProfile = readImageColorProfile(image, failsafe); - std::cout << "profile??? " << imageProfile.size() << std::endl; if (imageProfile.size()>0) { Magick::Blob profile(imageProfile.data(), imageProfile.size()); @@ -135,6 +134,7 @@ FXX::Image FXX::readImage(const std::string &file, FXX::Image FXX::readImage(Magick::Image image, FXX::Image failsafe, bool getInfo) { FXX::Image result; + image.quiet(true); if (image.isValid()) { std::vector layers; Magick::Blob output; @@ -223,6 +223,7 @@ FXX::Image FXX::readImage(Magick::Image image, FXX::Image failsafe, bool getInfo std::vector FXX::generateThumb(Magick::Image image, int width, int height) { std::vector result; + image.quiet(true); try { image.scale(Magick::Geometry(width, height)); if (image.depth()>8) { image.depth(8); } @@ -249,6 +250,7 @@ FXX::Image FXX::convertImage(FXX::Image input, bool getInfo) input.iccInputBuffer.size()>0) { Magick::Image image; + image.quiet(true); try { Magick::Blob tmp(input.imageBuffer.data(), input.imageBuffer.size()); diff --git a/src/cyan.cpp b/src/cyan.cpp index 04c1e717..cebd640f 100644 --- a/src/cyan.cpp +++ b/src/cyan.cpp @@ -57,6 +57,9 @@ #ifdef Q_OS_WIN #include +#ifdef __MINGW32__ +extern "C" WINBASEAPI BOOL WINAPI GetPhysicallyInstalledSystemMemory (PULONGLONG); +#endif #elif defined(Q_OS_LINUX) #include #endif @@ -121,7 +124,6 @@ Cyan::Cyan(QWidget *parent) palette.setColor(QPalette::Disabled, QPalette::Text, Qt::darkGray); palette.setColor(QPalette::Disabled, QPalette::ButtonText, Qt::darkGray); qApp->setPalette(palette); - setStyleSheet("QToolBar { border: 0; }"); } setWindowIcon(QIcon(":/cyan.png")); setAttribute(Qt::WA_QuitOnClose); @@ -192,7 +194,7 @@ Cyan::Cyan(QWidget *parent) if (supportedDepth()>=16) { bitDepth->addItem(bitDepthIcon, tr("16-bit"), 16); } - if ( (supportedDepth() == 16 && fx.hasHDRI()) || supportedDepth() >= 32 ) { + if (supportedDepth() >= 32) { bitDepth->addItem(bitDepthIcon, tr("32-bit"), 32); } bitDepth->setMaximumWidth(150); @@ -220,6 +222,20 @@ Cyan::Cyan(QWidget *parent) QLabel *bitDepthLabel = new QLabel(tr("Depth"), this); QLabel *qualityLabel = new QLabel(tr("Quality"), this); + /*if (!nativeStyle) { + QString padding = "margin-right:5px;"; + inputLabel->setStyleSheet(padding); + outputLabel->setStyleSheet(padding); + monitorLabel->setStyleSheet(padding); + renderLabel->setStyleSheet(padding); + blackLabel->setStyleSheet(padding); + rgbLabel->setStyleSheet(padding); + cmykLabel->setStyleSheet(padding); + grayLabel->setStyleSheet(padding); + bitDepthLabel->setStyleSheet(padding); + qualityLabel->setStyleSheet(padding); + }*/ + inputLabel->setToolTip(tr("Input profile for image")); inputLabel->setAlignment(Qt::AlignVCenter); outputLabel->setToolTip(tr("Profile used to convert image")); @@ -1366,6 +1382,86 @@ int Cyan::supportedDepth() void Cyan::clearImageBuffer() { fx.clearImage(imageData); + imageInfoTree->clear(); +} + +void Cyan::parseImageInfo() +{ + QString info = QString::fromStdString(imageData.info); + if (!info.isEmpty()) { + imageInfoTree->clear(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QStringList list = info.split("\n", Qt::SkipEmptyParts); +#else + QStringList list = info.split("\n", QString::SkipEmptyParts); +#endif + QVector level1items; + QVector level2items; + QString level1 = " "; + QString level2 = " "; + QString level3 = " "; + bool foundHistogramTag = false; + for (int i = 0; i < list.size(); ++i) { + QString item = list.at(i); + if (item.startsWith(level1)) { + QTreeWidgetItem *levelItem = new QTreeWidgetItem(); + QString section1 = item.section(":",0,0).trimmed(); + QString section2 = item.section(":",1).trimmed(); + if (item.startsWith(" Pixels per second:") || + item.startsWith(" User time:") || + item.startsWith(" Elapsed time:") || + item.startsWith(" Version: Image") || + item.startsWith(" Format: ") || + item.startsWith(" Class: ") || + item.startsWith(" Base filename:") || + item.startsWith(" Mime type:") || + item.contains("Filename")) + { + continue; + } + levelItem->setText(0,section1); + levelItem->setText(1,section2); + if (item == " Histogram:") { + foundHistogramTag = true; + } + if (foundHistogramTag && (item.startsWith(" Rendering intent:") || + item.startsWith(" Gamma:"))) + { + foundHistogramTag = false; + } + if (foundHistogramTag) { + continue; + } + if (item.startsWith(level3)) { + int parentID = level2items.size()-1; + if (parentID<0) { + parentID=0; + } + QTreeWidgetItem *parentItem = level2items.at(parentID); + if (parentItem) { + parentItem->addChild(levelItem); + } + + } else if(item.startsWith(level2)) { + int parentID = level1items.size()-1; + if (parentID<0) { + parentID=0; + } + QTreeWidgetItem *parentItem = level1items.at(parentID); + if (parentItem) { + parentItem->addChild(levelItem); + level2items << levelItem; + } + } else if(item.startsWith(level1)) { + level1items << levelItem; + } + continue; + } + } + imageInfoTree->addTopLevelItems(level1items.toList()); + level2items.clear(); + imageInfoTree->expandAll(); + } } QMap Cyan::genProfiles(FXX::ColorSpace colorspace) diff --git a/src/main.cpp b/src/main.cpp index 50596c34..480d2b8f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,6 +33,11 @@ #include "cyan.h" #include +#ifdef BUNDLE_FONT +#include +#include +#endif + int main(int argc, char *argv[]) { QApplication a(argc, argv); @@ -42,6 +47,17 @@ int main(int argc, char *argv[]) QCoreApplication::setOrganizationDomain("net.fxarena"); QCoreApplication::setApplicationVersion(CYAN_VERSION); Cyan w; + +#ifdef BUNDLE_FONT + QString fontPath = QString(":/fonts/DejaVuSans.ttf"); + int fontId = QFontDatabase::addApplicationFont(fontPath); + if (fontId != -1) { + QFont font("DejaVuSans"); + if (font.pointSize() == 12) { font.setPointSize(10); } + a.setFont(font); + } +#endif + w.show(); return a.exec(); diff --git a/src/tst_cyan.cpp b/src/tst_cyan.cpp index 23f504d8..2c8399b2 100644 --- a/src/tst_cyan.cpp +++ b/src/tst_cyan.cpp @@ -77,6 +77,8 @@ bool Cyan::compareImages(std::vector image1, Magick::Blob blob1(image1.data(), image1.size()); Magick::Blob blob2(image2.data(), image2.size()); Magick::Image src,dst; + src.quiet(true); + dst.quiet(true); try { src.read(blob1); dst.read(blob2); @@ -94,6 +96,7 @@ bool Cyan::compareImages(std::vector image1, Magick::Image errorImage = src.compare(dst, MagickCore::AbsoluteErrorMetric, &distortion); + errorImage.quiet(true); errorImage.write("compare.jpg"); src.write("src.tif"); dst.write("dst.tif"); @@ -125,6 +128,7 @@ void Cyan::test_case1() Magick::Blob magickBlob(result.data(), static_cast(result.length())); QVERIFY(magickBlob.length()>0); Magick::Image magickImage; + magickImage.quiet(true); try { magickImage.read(magickBlob); } diff --git a/tests.pro b/tests.pro index 5f815167..fc88d74b 100644 --- a/tests.pro +++ b/tests.pro @@ -43,7 +43,7 @@ MOC_DIR = $${DESTDIR}/.moc RCC_DIR = $${DESTDIR}/.qrc unix:QMAKE_POST_LINK = ./build/$${TARGET} -win32-g++:QMAKE_POST_LINK = "wine64 build/$${TARGET}.exe" +#win32-g++:QMAKE_POST_LINK = "wine64 build/$${TARGET}.exe" CONFIG += c++11 QT_CONFIG -= no-pkg-config @@ -63,4 +63,4 @@ mac { QMAKE_LFLAGS += -fopenmp } -win32-g++: LIBS += -lpthread +#win32-g++: LIBS += -lpthread