Compare commits
1 Commits
v5.116.0-r
...
v5.82.0
Author | SHA1 | Date | |
---|---|---|---|
949c8745c4 |
@ -1,3 +1,2 @@
|
|||||||
#clang-format/tidy
|
#clang-format
|
||||||
1169859b07f25c865ee0bfc2a7dc97a431651776
|
1169859b07f25c865ee0bfc2a7dc97a431651776
|
||||||
eaca33bec8b19498c3621fc3a20a8c55a2812462
|
|
||||||
|
1
.gitattributes
vendored
@ -1 +0,0 @@
|
|||||||
autotests/read/raw/RAW_KODAK_C330_FORMAT_NONE_YRGB.raw binary
|
|
1
.gitignore
vendored
@ -25,4 +25,3 @@ CMakeLists.txt.user*
|
|||||||
.clangd
|
.clangd
|
||||||
.idea
|
.idea
|
||||||
/cmake-build*
|
/cmake-build*
|
||||||
.cache
|
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
# SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
|
|
||||||
# SPDX-License-Identifier: CC0-1.0
|
|
||||||
|
|
||||||
include:
|
|
||||||
- project: sysadmin/ci-utilities
|
|
||||||
file:
|
|
||||||
- /gitlab-templates/linux.yml
|
|
||||||
- /gitlab-templates/linux-static.yml
|
|
||||||
- /gitlab-templates/android.yml
|
|
||||||
- /gitlab-templates/freebsd.yml
|
|
||||||
- /gitlab-templates/windows.yml
|
|
||||||
- /gitlab-templates/windows-static.yml
|
|
@ -1,9 +0,0 @@
|
|||||||
Dependencies:
|
|
||||||
- 'on': ['Linux', 'FreeBSD', 'macOS', 'Windows']
|
|
||||||
'require':
|
|
||||||
'frameworks/extra-cmake-modules': '@same'
|
|
||||||
'frameworks/karchive' : '@same'
|
|
||||||
|
|
||||||
Options:
|
|
||||||
test-before-installing: True
|
|
||||||
require-passing-tests-on: [ 'Linux', 'FreeBSD', 'Windows' ]
|
|
@ -1,26 +1,27 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.6)
|
||||||
|
|
||||||
project(KImageFormats)
|
project(KImageFormats)
|
||||||
|
|
||||||
|
set (CMAKE_CXX_STANDARD 14)
|
||||||
|
|
||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
find_package(ECM 5.116.0 NO_MODULE)
|
find_package(ECM 5.82.0 NO_MODULE)
|
||||||
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
|
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
|
||||||
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||||
|
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${KImageFormats_SOURCE_DIR}/cmake/find-modules ${ECM_MODULE_PATH})
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
||||||
|
|
||||||
include(KDEInstallDirs)
|
include(KDEInstallDirs)
|
||||||
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
|
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
|
||||||
include(KDECMakeSettings)
|
include(KDECMakeSettings)
|
||||||
|
|
||||||
include(KDEGitCommitHooks)
|
include(KDEGitCommitHooks)
|
||||||
include(ECMDeprecationSettings)
|
|
||||||
include(CheckIncludeFiles)
|
|
||||||
include(FindPkgConfig)
|
|
||||||
|
|
||||||
set(REQUIRED_QT_VERSION 5.15.2)
|
|
||||||
find_package(Qt${QT_MAJOR_VERSION}Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
|
include(CheckIncludeFiles)
|
||||||
|
|
||||||
|
set(REQUIRED_QT_VERSION 5.15.0)
|
||||||
|
find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
|
||||||
|
|
||||||
find_package(KF5Archive)
|
find_package(KF5Archive)
|
||||||
set_package_properties(KF5Archive PROPERTIES
|
set_package_properties(KF5Archive PROPERTIES
|
||||||
@ -32,12 +33,12 @@ set_package_properties(KF5Archive PROPERTIES
|
|||||||
# this available in PATH
|
# this available in PATH
|
||||||
set(BUILD_EPS_PLUGIN FALSE)
|
set(BUILD_EPS_PLUGIN FALSE)
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
find_package(Qt${QT_MAJOR_VERSION}PrintSupport ${REQUIRED_QT_VERSION} NO_MODULE)
|
find_package(Qt5PrintSupport ${REQUIRED_QT_VERSION} NO_MODULE)
|
||||||
set_package_properties(Qt${QT_MAJOR_VERSION}PrintSupport PROPERTIES
|
set_package_properties(Qt5PrintSupport PROPERTIES
|
||||||
PURPOSE "Required for the QImage plugin for EPS images"
|
PURPOSE "Required for the QImage plugin for EPS images"
|
||||||
TYPE OPTIONAL
|
TYPE OPTIONAL
|
||||||
)
|
)
|
||||||
if (TARGET Qt${QT_MAJOR_VERSION}::PrintSupport)
|
if (Qt5PrintSupport_FOUND)
|
||||||
set(BUILD_EPS_PLUGIN TRUE)
|
set(BUILD_EPS_PLUGIN TRUE)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -51,10 +52,7 @@ set_package_properties(OpenEXR PROPERTIES
|
|||||||
PURPOSE "Required for the QImage plugin for OpenEXR images"
|
PURPOSE "Required for the QImage plugin for OpenEXR images"
|
||||||
)
|
)
|
||||||
|
|
||||||
find_package(libavif 0.8.2 CONFIG QUIET)
|
find_package(libavif 0.8.2 CONFIG)
|
||||||
if(NOT libavif_FOUND)
|
|
||||||
find_package(libavif 1 CONFIG)
|
|
||||||
endif()
|
|
||||||
set_package_properties(libavif PROPERTIES
|
set_package_properties(libavif PROPERTIES
|
||||||
TYPE OPTIONAL
|
TYPE OPTIONAL
|
||||||
PURPOSE "Required for the QImage plugin for AVIF images"
|
PURPOSE "Required for the QImage plugin for AVIF images"
|
||||||
@ -62,29 +60,16 @@ set_package_properties(libavif PROPERTIES
|
|||||||
|
|
||||||
option(KIMAGEFORMATS_HEIF "Enable plugin for HEIF format" OFF)
|
option(KIMAGEFORMATS_HEIF "Enable plugin for HEIF format" OFF)
|
||||||
if(KIMAGEFORMATS_HEIF)
|
if(KIMAGEFORMATS_HEIF)
|
||||||
|
include(FindPkgConfig)
|
||||||
pkg_check_modules(LibHeif IMPORTED_TARGET libheif>=1.10.0)
|
pkg_check_modules(LibHeif IMPORTED_TARGET libheif>=1.10.0)
|
||||||
endif()
|
endif()
|
||||||
add_feature_info(LibHeif LibHeif_FOUND "required for the QImage plugin for HEIF/HEIC images")
|
add_feature_info(LibHeif LibHeif_FOUND "required for the QImage plugin for HEIF/HEIC images")
|
||||||
|
|
||||||
option(KIMAGEFORMATS_JXL "Enable plugin for JPEG XL format" ON)
|
add_definitions(-DQT_NO_FOREACH)
|
||||||
if(KIMAGEFORMATS_JXL)
|
# 050d00 (5.13) triggers a BIC in qimageiohandler.h, in Qt 5.13, so do not enable that until we can require 5.14
|
||||||
pkg_check_modules(LibJXL IMPORTED_TARGET libjxl>=0.7.0)
|
# https://codereview.qt-project.org/c/qt/qtbase/+/279215
|
||||||
pkg_check_modules(LibJXLThreads IMPORTED_TARGET libjxl_threads>=0.7.0)
|
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
|
||||||
endif()
|
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055100)
|
||||||
add_feature_info(LibJXL LibJXL_FOUND "required for the QImage plugin for JPEG XL images")
|
|
||||||
|
|
||||||
# note: module FindLibRaw missing from https://invent.kde.org/frameworks/extra-cmake-modules
|
|
||||||
find_package(LibRaw 0.20.2)
|
|
||||||
set_package_properties(LibRaw PROPERTIES
|
|
||||||
TYPE OPTIONAL
|
|
||||||
PURPOSE "Required for the QImage plugin for RAW images"
|
|
||||||
)
|
|
||||||
|
|
||||||
ecm_set_disabled_deprecation_versions(
|
|
||||||
QT 5.15.2
|
|
||||||
KF 5.95
|
|
||||||
)
|
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
if (BUILD_TESTING)
|
if (BUILD_TESTING)
|
||||||
add_subdirectory(autotests)
|
add_subdirectory(autotests)
|
||||||
|
@ -1,121 +0,0 @@
|
|||||||
Creative Commons Legal Code
|
|
||||||
|
|
||||||
CC0 1.0 Universal
|
|
||||||
|
|
||||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
|
||||||
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
|
||||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
|
||||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
|
||||||
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
|
||||||
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
|
||||||
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
|
||||||
HEREUNDER.
|
|
||||||
|
|
||||||
Statement of Purpose
|
|
||||||
|
|
||||||
The laws of most jurisdictions throughout the world automatically confer
|
|
||||||
exclusive Copyright and Related Rights (defined below) upon the creator
|
|
||||||
and subsequent owner(s) (each and all, an "owner") of an original work of
|
|
||||||
authorship and/or a database (each, a "Work").
|
|
||||||
|
|
||||||
Certain owners wish to permanently relinquish those rights to a Work for
|
|
||||||
the purpose of contributing to a commons of creative, cultural and
|
|
||||||
scientific works ("Commons") that the public can reliably and without fear
|
|
||||||
of later claims of infringement build upon, modify, incorporate in other
|
|
||||||
works, reuse and redistribute as freely as possible in any form whatsoever
|
|
||||||
and for any purposes, including without limitation commercial purposes.
|
|
||||||
These owners may contribute to the Commons to promote the ideal of a free
|
|
||||||
culture and the further production of creative, cultural and scientific
|
|
||||||
works, or to gain reputation or greater distribution for their Work in
|
|
||||||
part through the use and efforts of others.
|
|
||||||
|
|
||||||
For these and/or other purposes and motivations, and without any
|
|
||||||
expectation of additional consideration or compensation, the person
|
|
||||||
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
|
||||||
is an owner of Copyright and Related Rights in the Work, voluntarily
|
|
||||||
elects to apply CC0 to the Work and publicly distribute the Work under its
|
|
||||||
terms, with knowledge of his or her Copyright and Related Rights in the
|
|
||||||
Work and the meaning and intended legal effect of CC0 on those rights.
|
|
||||||
|
|
||||||
1. Copyright and Related Rights. A Work made available under CC0 may be
|
|
||||||
protected by copyright and related or neighboring rights ("Copyright and
|
|
||||||
Related Rights"). Copyright and Related Rights include, but are not
|
|
||||||
limited to, the following:
|
|
||||||
|
|
||||||
i. the right to reproduce, adapt, distribute, perform, display,
|
|
||||||
communicate, and translate a Work;
|
|
||||||
ii. moral rights retained by the original author(s) and/or performer(s);
|
|
||||||
iii. publicity and privacy rights pertaining to a person's image or
|
|
||||||
likeness depicted in a Work;
|
|
||||||
iv. rights protecting against unfair competition in regards to a Work,
|
|
||||||
subject to the limitations in paragraph 4(a), below;
|
|
||||||
v. rights protecting the extraction, dissemination, use and reuse of data
|
|
||||||
in a Work;
|
|
||||||
vi. database rights (such as those arising under Directive 96/9/EC of the
|
|
||||||
European Parliament and of the Council of 11 March 1996 on the legal
|
|
||||||
protection of databases, and under any national implementation
|
|
||||||
thereof, including any amended or successor version of such
|
|
||||||
directive); and
|
|
||||||
vii. other similar, equivalent or corresponding rights throughout the
|
|
||||||
world based on applicable law or treaty, and any national
|
|
||||||
implementations thereof.
|
|
||||||
|
|
||||||
2. Waiver. To the greatest extent permitted by, but not in contravention
|
|
||||||
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
|
||||||
irrevocably and unconditionally waives, abandons, and surrenders all of
|
|
||||||
Affirmer's Copyright and Related Rights and associated claims and causes
|
|
||||||
of action, whether now known or unknown (including existing as well as
|
|
||||||
future claims and causes of action), in the Work (i) in all territories
|
|
||||||
worldwide, (ii) for the maximum duration provided by applicable law or
|
|
||||||
treaty (including future time extensions), (iii) in any current or future
|
|
||||||
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
|
||||||
including without limitation commercial, advertising or promotional
|
|
||||||
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
|
||||||
member of the public at large and to the detriment of Affirmer's heirs and
|
|
||||||
successors, fully intending that such Waiver shall not be subject to
|
|
||||||
revocation, rescission, cancellation, termination, or any other legal or
|
|
||||||
equitable action to disrupt the quiet enjoyment of the Work by the public
|
|
||||||
as contemplated by Affirmer's express Statement of Purpose.
|
|
||||||
|
|
||||||
3. Public License Fallback. Should any part of the Waiver for any reason
|
|
||||||
be judged legally invalid or ineffective under applicable law, then the
|
|
||||||
Waiver shall be preserved to the maximum extent permitted taking into
|
|
||||||
account Affirmer's express Statement of Purpose. In addition, to the
|
|
||||||
extent the Waiver is so judged Affirmer hereby grants to each affected
|
|
||||||
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
|
||||||
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
|
||||||
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
|
||||||
maximum duration provided by applicable law or treaty (including future
|
|
||||||
time extensions), (iii) in any current or future medium and for any number
|
|
||||||
of copies, and (iv) for any purpose whatsoever, including without
|
|
||||||
limitation commercial, advertising or promotional purposes (the
|
|
||||||
"License"). The License shall be deemed effective as of the date CC0 was
|
|
||||||
applied by Affirmer to the Work. Should any part of the License for any
|
|
||||||
reason be judged legally invalid or ineffective under applicable law, such
|
|
||||||
partial invalidity or ineffectiveness shall not invalidate the remainder
|
|
||||||
of the License, and in such case Affirmer hereby affirms that he or she
|
|
||||||
will not (i) exercise any of his or her remaining Copyright and Related
|
|
||||||
Rights in the Work or (ii) assert any associated claims and causes of
|
|
||||||
action with respect to the Work, in either case contrary to Affirmer's
|
|
||||||
express Statement of Purpose.
|
|
||||||
|
|
||||||
4. Limitations and Disclaimers.
|
|
||||||
|
|
||||||
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
|
||||||
surrendered, licensed or otherwise affected by this document.
|
|
||||||
b. Affirmer offers the Work as-is and makes no representations or
|
|
||||||
warranties of any kind concerning the Work, express, implied,
|
|
||||||
statutory or otherwise, including without limitation warranties of
|
|
||||||
title, merchantability, fitness for a particular purpose, non
|
|
||||||
infringement, or the absence of latent or other defects, accuracy, or
|
|
||||||
the present or absence of errors, whether or not discoverable, all to
|
|
||||||
the greatest extent permissible under applicable law.
|
|
||||||
c. Affirmer disclaims responsibility for clearing rights of other persons
|
|
||||||
that may apply to the Work or any use thereof, including without
|
|
||||||
limitation any person's Copyright and Related Rights in the Work.
|
|
||||||
Further, Affirmer disclaims responsibility for obtaining any necessary
|
|
||||||
consents, permissions or other rights required for any use of the
|
|
||||||
Work.
|
|
||||||
d. Affirmer understands and acknowledges that Creative Commons is not a
|
|
||||||
party to this document and has no duty or obligation with respect to
|
|
||||||
this CC0 or use of the Work.
|
|
@ -14,20 +14,16 @@ image formats.
|
|||||||
The following image formats have read-only support:
|
The following image formats have read-only support:
|
||||||
|
|
||||||
- Animated Windows cursors (ani)
|
- Animated Windows cursors (ani)
|
||||||
- Camera RAW images (arw, cr2, cr3, dcs, dng, ...)
|
|
||||||
- Gimp (xcf)
|
- Gimp (xcf)
|
||||||
- OpenEXR (exr)
|
- OpenEXR (exr)
|
||||||
- Photoshop documents (psd, psb, pdd, psdt)
|
- Photoshop documents (psd)
|
||||||
- Radiance HDR (hdr)
|
|
||||||
- Sun Raster (ras)
|
- Sun Raster (ras)
|
||||||
|
|
||||||
The following image formats have read and write support:
|
The following image formats have read and write support:
|
||||||
|
|
||||||
- AV1 Image File Format (AVIF)
|
- AV1 Image File Format (AVIF)
|
||||||
- Encapsulated PostScript (eps)
|
- Encapsulated PostScript (eps)
|
||||||
- JPEG XL (jxl)
|
|
||||||
- Personal Computer Exchange (pcx)
|
- Personal Computer Exchange (pcx)
|
||||||
- Quite OK Image format (qoi)
|
|
||||||
- SGI images (rgb, rgba, sgi, bw)
|
- SGI images (rgb, rgba, sgi, bw)
|
||||||
- Softimage PIC (pic)
|
- Softimage PIC (pic)
|
||||||
- Targa (tga): supports more formats than Qt's version
|
- Targa (tga): supports more formats than Qt's version
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#find_package(Qt5Test ${REQUIRED_QT_VERSION} NO_MODULE)
|
#find_package(Qt5Test ${REQUIRED_QT_VERSION} NO_MODULE)
|
||||||
|
|
||||||
include(ECMMarkAsTest)
|
include(ECMMarkAsTest)
|
||||||
|
include(CMakeParseArguments)
|
||||||
|
|
||||||
add_definitions(-DPLUGIN_DIR="${CMAKE_CURRENT_BINARY_DIR}/../bin")
|
add_definitions(-DPLUGIN_DIR="${CMAKE_CURRENT_BINARY_DIR}/../bin")
|
||||||
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
|
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
|
||||||
@ -14,7 +15,7 @@ macro(kimageformats_read_tests)
|
|||||||
|
|
||||||
if (NOT TARGET readtest)
|
if (NOT TARGET readtest)
|
||||||
add_executable(readtest readtest.cpp)
|
add_executable(readtest readtest.cpp)
|
||||||
target_link_libraries(readtest Qt${QT_MAJOR_VERSION}::Gui)
|
target_link_libraries(readtest Qt5::Gui)
|
||||||
target_compile_definitions(readtest
|
target_compile_definitions(readtest
|
||||||
PRIVATE IMAGEDIR="${CMAKE_CURRENT_SOURCE_DIR}/read")
|
PRIVATE IMAGEDIR="${CMAKE_CURRENT_SOURCE_DIR}/read")
|
||||||
ecm_mark_as_test(readtest)
|
ecm_mark_as_test(readtest)
|
||||||
@ -29,35 +30,23 @@ macro(kimageformats_read_tests)
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(kimageformats_write_tests)
|
macro(kimageformats_write_tests)
|
||||||
cmake_parse_arguments(KIF_RT "" "FUZZ" "" ${ARGN})
|
|
||||||
set(_fuzzarg)
|
|
||||||
if (KIF_RT_FUZZ)
|
|
||||||
set(_fuzzarg -f ${KIF_RT_FUZZ})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT TARGET writetest)
|
if (NOT TARGET writetest)
|
||||||
add_executable(writetest writetest.cpp)
|
add_executable(writetest writetest.cpp)
|
||||||
target_link_libraries(writetest Qt${QT_MAJOR_VERSION}::Gui)
|
target_link_libraries(writetest Qt5::Gui)
|
||||||
target_compile_definitions(writetest
|
target_compile_definitions(writetest
|
||||||
PRIVATE IMAGEDIR="${CMAKE_CURRENT_SOURCE_DIR}/write")
|
PRIVATE IMAGEDIR="${CMAKE_CURRENT_SOURCE_DIR}/write")
|
||||||
ecm_mark_as_test(writetest)
|
ecm_mark_as_test(writetest)
|
||||||
endif()
|
endif()
|
||||||
foreach(_testname ${KIF_RT_UNPARSED_ARGUMENTS})
|
foreach(_testname ${ARGN})
|
||||||
string(REGEX MATCH "-lossless$" _is_lossless "${_testname}")
|
string(REGEX MATCH "-lossless$" _is_lossless "${_testname}")
|
||||||
string(REGEX MATCH "-nodatacheck" _is_no_data_check "${_testname}")
|
|
||||||
unset(lossless_arg)
|
unset(lossless_arg)
|
||||||
unset(no_data_check_arg)
|
|
||||||
if (_is_lossless)
|
if (_is_lossless)
|
||||||
set(lossless_arg "--lossless")
|
set(lossless_arg "--lossless")
|
||||||
string(REGEX REPLACE "-lossless$" "" _testname "${_testname}")
|
string(REGEX REPLACE "-lossless$" "" _testname "${_testname}")
|
||||||
endif()
|
endif()
|
||||||
if (_is_no_data_check)
|
|
||||||
set(no_data_check_arg "--no-data-check")
|
|
||||||
string(REGEX REPLACE "-nodatacheck$" "" _testname "${_testname}")
|
|
||||||
endif()
|
|
||||||
add_test(
|
add_test(
|
||||||
NAME kimageformats-write-${_testname}
|
NAME kimageformats-write-${_testname}
|
||||||
COMMAND writetest ${lossless_arg} ${no_data_check_arg} ${_fuzzarg} ${_testname}
|
COMMAND writetest ${lossless_arg} ${_testname}
|
||||||
)
|
)
|
||||||
endforeach(_testname)
|
endforeach(_testname)
|
||||||
endmacro()
|
endmacro()
|
||||||
@ -69,7 +58,6 @@ kimageformats_read_tests(
|
|||||||
hdr
|
hdr
|
||||||
pcx
|
pcx
|
||||||
psd
|
psd
|
||||||
qoi
|
|
||||||
ras
|
ras
|
||||||
rgb
|
rgb
|
||||||
tga
|
tga
|
||||||
@ -86,34 +74,12 @@ if (TARGET avif)
|
|||||||
kimageformats_read_tests(
|
kimageformats_read_tests(
|
||||||
avif
|
avif
|
||||||
)
|
)
|
||||||
kimageformats_write_tests(
|
|
||||||
avif-nodatacheck-lossless
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (LibHeif_FOUND)
|
if (LibHeif_FOUND)
|
||||||
kimageformats_read_tests(
|
kimageformats_read_tests(
|
||||||
heif
|
heif
|
||||||
)
|
)
|
||||||
# because the plug-ins use RGB->YUV conversion which sometimes results in 1 value difference.
|
|
||||||
kimageformats_write_tests(FUZZ 1
|
|
||||||
heif-nodatacheck-lossless
|
|
||||||
)
|
|
||||||
|
|
||||||
if (LibHeif_VERSION VERSION_GREATER_EQUAL "1.17.0")
|
|
||||||
kimageformats_read_tests(FUZZ 1
|
|
||||||
hej2
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (LibJXL_FOUND AND LibJXLThreads_FOUND)
|
|
||||||
kimageformats_read_tests(
|
|
||||||
jxl
|
|
||||||
)
|
|
||||||
kimageformats_write_tests(
|
|
||||||
jxl-nodatacheck-lossless
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Allow some fuzziness when reading this formats, to allow for
|
# Allow some fuzziness when reading this formats, to allow for
|
||||||
@ -131,7 +97,6 @@ kimageformats_read_tests(FUZZ 1
|
|||||||
kimageformats_write_tests(
|
kimageformats_write_tests(
|
||||||
pcx-lossless
|
pcx-lossless
|
||||||
pic-lossless
|
pic-lossless
|
||||||
qoi-lossless
|
|
||||||
rgb-lossless
|
rgb-lossless
|
||||||
tga # fixme: the alpha images appear not to be written properly
|
tga # fixme: the alpha images appear not to be written properly
|
||||||
)
|
)
|
||||||
@ -143,30 +108,22 @@ kimageformats_write_tests(
|
|||||||
# kimageformats_write_tests(eps)
|
# kimageformats_write_tests(eps)
|
||||||
#endif()
|
#endif()
|
||||||
if (OpenEXR_FOUND)
|
if (OpenEXR_FOUND)
|
||||||
kimageformats_read_tests(
|
# FIXME: OpenEXR tests
|
||||||
exr
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (LibRaw_FOUND)
|
find_package(Qt5Test ${REQUIRED_QT_VERSION} CONFIG QUIET)
|
||||||
kimageformats_read_tests(
|
|
||||||
raw
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(Qt${QT_MAJOR_VERSION}Test ${REQUIRED_QT_VERSION} CONFIG QUIET)
|
if(NOT Qt5Test_FOUND)
|
||||||
|
message(STATUS "Qt5Test not found, some autotests will not be built.")
|
||||||
if(NOT TARGET Qt${QT_MAJOR_VERSION}::Test)
|
|
||||||
message(STATUS "Qt${QT_MAJOR_VERSION}Test not found, some autotests will not be built.")
|
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(pictest pictest.cpp)
|
add_executable(pictest pictest.cpp)
|
||||||
target_link_libraries(pictest Qt${QT_MAJOR_VERSION}::Gui Qt${QT_MAJOR_VERSION}::Test)
|
target_link_libraries(pictest Qt5::Gui Qt5::Test)
|
||||||
ecm_mark_as_test(pictest)
|
ecm_mark_as_test(pictest)
|
||||||
add_test(NAME kimageformats-pic COMMAND pictest)
|
add_test(NAME kimageformats-pic COMMAND pictest)
|
||||||
|
|
||||||
add_executable(anitest anitest.cpp)
|
add_executable(anitest anitest.cpp)
|
||||||
target_link_libraries(anitest Qt${QT_MAJOR_VERSION}::Gui Qt${QT_MAJOR_VERSION}::Test)
|
target_link_libraries(anitest Qt5::Gui Qt5::Test)
|
||||||
ecm_mark_as_test(anitest)
|
ecm_mark_as_test(anitest)
|
||||||
add_test(NAME kimageformats-ani COMMAND anitest)
|
add_test(NAME kimageformats-ani COMMAND anitest)
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kdemail.net>
|
|
||||||
|
|
||||||
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class Trait>
|
|
||||||
static bool fuzzyeq(const QImage &im1, const QImage &im2, uchar fuzziness)
|
|
||||||
{
|
|
||||||
Q_ASSERT(im1.format() == im2.format());
|
|
||||||
Q_ASSERT(im1.depth() == 24 || im1.depth() == 32 || im1.depth() == 64);
|
|
||||||
|
|
||||||
const int height = im1.height();
|
|
||||||
const int width = im1.width();
|
|
||||||
for (int i = 0; i < height; ++i) {
|
|
||||||
const Trait *line1 = reinterpret_cast<const Trait *>(im1.scanLine(i));
|
|
||||||
const Trait *line2 = reinterpret_cast<const Trait *>(im2.scanLine(i));
|
|
||||||
for (int j = 0; j < width; ++j) {
|
|
||||||
if (line1[j] > line2[j]) {
|
|
||||||
if (line1[j] - line2[j] > fuzziness) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (line2[j] - line1[j] > fuzziness) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// allow each byte to be different by up to 1, to allow for rounding errors
|
|
||||||
static bool fuzzyeq(const QImage &im1, const QImage &im2, uchar fuzziness)
|
|
||||||
{
|
|
||||||
return (im1.depth() == 64) ? fuzzyeq<quint16>(im1, im2, fuzziness) : fuzzyeq<quint8>(im1, im2, fuzziness);
|
|
||||||
}
|
|
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 528 KiB |
Before Width: | Height: | Size: 117 KiB |
Before Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 298 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 983 B |
Before Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 34 KiB |