Compare commits

...

424 Commits

Author SHA1 Message Date
485e084fa9 QImage: use rvalue overloads more
to reuse internal buffers
2023-09-16 23:29:30 +08:00
75e1280073 hdr: options support and bugfixes
- Support for Size and Format options
- Added compile option to generate 16-bit instead of 32-bit images
- Includes MR !189 and MR !192 fixes
2023-09-11 09:08:18 +00:00
0a6fbd88e9 xcf: fix crash (oss-fuzz issue 62075) 2023-09-07 16:12:41 +00:00
fbf60f8bbb xcf: fix possible overflow
Port to KF6 of MR !187
2023-09-05 11:32:32 +00:00
2799382c21 Drop code for Qt < 6.5.0
...now that we depend on Qt >= 6.5.0.
2023-08-30 00:27:47 +02:00
adc7da4f41 GIT_SILENT Upgrade Qt6 version requirement to 6.5.0. 2023-08-29 23:31:26 +02:00
ac808679cd qoi: initialize structure before use
It was reported by Code Quality scans as Critical (CWE-457)
2023-08-29 21:04:00 +02:00
2aea982e9e qoi: fix reports from quality scanner
struct QoiHeader is initialized to invalid values prior use,
it’s good to detect situations when we read incomplete data.
Add include in scanlineconverter.cpp so it can be used without
change in kf5 branch.
2023-08-29 16:22:52 +02:00
9173f02ea3 ras: rle decode
Added support for RLE compressed images. This patch makes the player almost complete allowing to read all type 1,2 and 3 RAS files. Only types 4 and 5 are missing which are images converted from TIFF and IFF.
2023-08-29 09:11:35 +00:00
4badb3088e Support libavif 1.0
Make cmake find libavif 1.0 and adapt to API changes (which is reverting to pre 0.9.2 API)
2023-08-29 09:21:37 +02:00
8dc685df26 qoi: write support
As a base I used the reference implementation found on the official site at https://qoiformat.org/ (MIT license).
I added a class to convert scan lines in scanlineconverter.cpp. The class takes advantage of the QImage conversion and contrary to what one might expect, with large images it improves performance (compared to converting the whole image) 😄 

In progressive mode, for each line, the following conversions (only if needed) are made before saving:
1. If the icc profile is set, the line is converted to sRGB or sRGB Linear.
2. The line is scaled to 8 bits with RGBA order.
2023-08-28 22:25:10 +00:00
4bd9d5baec No longer needed to explicitly include CMakeParseArguments
NO_CHANGELOG
2023-08-28 22:54:41 +02:00
79e8e183eb ras: code revamped
- Progressive load from file
- Added support for 1-bit image
- Images with palette are now Index (instead of RGB32)
- Added options support (Size, Format)
- Added some test cases
- Improved performance by directly accessing the scanline
- Support for more RAS extension (taken from GIMP)

The code should works "as is" also on KF5.
2023-08-28 18:02:02 +00:00
7d63a1d8fa exr: multiple fixes
- Support for images with transparency
- Precise colorspace conversion using QT color spaces
- Set the correct resolution
- Set useful metadata
- Support for RGBX16FPx4 format in Qt 6
- Speed improvements

![image](/uploads/bb36492d71acce4995e8b4229a813031/image.png)
2023-08-28 17:30:50 +00:00
c11c5eff4f xcf: format v12 support
This is a patch over MR !108 by @sandsmark. Martin has done a great job implementing support and I find it a shame not to use it.

I made sure that the results are the same as the current version and fixed the problems of pixels with wrong colors with color depth grater than 8 bits. I also fixed conversion errors on mask and gray images (16/32 bits).
Unfortunately the internal rendering engine of the original code is 8-bit so I always forced the output of 8-bit images to correct the problems (see image below). Since it is a plugin with a "rendering engine", the tests to seriously validate it are potentially endless (as the original version is not perfect).

Errors of the original version of the MR (right) which should no longer occur:
![image](/uploads/9ef24eb5436bd19ff1fb428242a9c119/image.png)
2023-08-28 17:27:08 +00:00
c02bf3dbcc Readme.md: Update supported formats list
- (+) Krita (kra)
- (+) OpenRaster (ora)
- (-) XView (xv)
2023-08-20 08:04:21 +00:00
6254529d2d qoi: fix buffer overflow
- fix buffer overflow with corrupted images without image data
- fix unable to read very small images (e.g. 1x1 px)
- new test cases added
- detect incomplete files by checking the end of streams as written in the specs
2023-08-18 14:09:00 +00:00
35ff3efbbc hdr: improve precision
- Improve the precision of HDR format (it is a floating point format) by using the RGBA32FPx4 image format.
2023-08-13 22:19:22 +00:00
7a0d95af92 Renamed qoi.h to qoi_p.h 2023-08-12 23:47:29 +02:00
4c3ade04dd Minor improvements 2023-08-12 09:03:56 +02:00
b209e54b6f Add support for the QOI image format
This MR adds read-only QOI (https://qoiformat.org/) image format support for KImageFormats.

This format has received it's MIME type inclusion in shared-mime-info 4 months ago: ff51a0a9e3

The code is based on the reference QOI implementation at https://github.com/phoboslab/qoi/blob/master/qoi.h

Official test images: https://qoiformat.org/qoi_test_images.zip

![pngvsqoi](/uploads/e386aa5057641057106e21940c770d97/pngvsqoi.png)

Also: This is my first MR to KDE ;)
2023-08-11 20:44:17 +00:00
4dc2099fa4 Set linear color space for proper viewing 2023-07-21 14:17:11 +02:00
491b223c15 psd: Fix UB type punning
BUGS: 471829
2023-07-16 08:07:13 +00:00
6559bf8994 Treat 3-channel MCH images as CMY images 2023-07-03 12:34:54 +02:00
34ed3bad27 Add explicit moc includes to sources for moc-covered headers
* speeds up incremental builds as changes to a header will not always
  need the full mocs_compilation.cpp for all the target's headers rebuild,
  while having a moc file sourced into a source file only adds minor
  extra costs, due to small own code and the used headers usually
  already covered by the source file, being for the same class/struct
* seems to not slow down clean builds, due to empty mocs_compilation.cpp
  resulting in those quickly processed, while the minor extra cost of the
  sourced moc files does not outweigh that in summary.
  Measured times actually improved by some percent points.
  (ideally CMake would just skip empty mocs_compilation.cpp & its object
  file one day)
* enables compiler to see all methods of a class in same compilation unit
  to do some sanity checks
* potentially more inlining in general, due to more in the compilation unit
* allows to keep using more forward declarations in the header, as with the
  moc code being sourced into the cpp file there definitions can be ensured
  and often are already for the needs of the normal class methods
2023-07-02 03:08:44 +02:00
9c579fc1f8 jxl: add support for libjxl v0.9, drop support for old 0.6.1 2023-06-27 14:32:08 +02:00
93adb22632 raw: change the use of the quality parameter
- Standardized the quality parameter between 0-100
- The value -1 is the default value of Qt plugins and is managed
- Negative values other than -1 are used as flags to activate the custom mode
2023-05-17 17:45:23 +00:00
d57ff91f8b pcx: multiple fixes (2)
- 1-bit writer: checks where is black and use NOT operator only if needed
- Fix images with witdh == 65536(*)
- Checks result of disk writes and reads on all formats

(*) PCX formats support images with with of 65536 but only if the header field bytesPerLine is valid (no overflow). This means that the width 65536 is supported on 1bpp images only.
The previous version of the plugins wrote an image with width of 65536px in the wrong way and it was unable to read it (wrong image returned). I verified that Photoshop and Gimp weren't able to read the image either.
2023-05-12 08:53:50 +00:00
edd6adcbac Avoid unnecessary conversions 2023-05-10 15:34:14 +02:00
d787c12727 RGB/SGI writer: fix alpha detection and image limit size 2023-05-10 11:43:21 +00:00
c9fec5e408 TGA writer: fix alpha detection and performance improvements 2023-05-10 11:43:21 +00:00
e60dfd4968 pcx: multiple fixes
- Fix wrong RGB channel order if image format is other than (A)RGB32
- Write right resolution
- Set right resolution on image load
- Return false on write error
- Save images with depth greater than 24-bits
2023-05-10 11:43:04 +00:00
f5a9dd46d2 Removed unused jxl.desktop file 2023-04-22 09:31:30 +02:00
41f0411b62 PSD: fix test failure on some systems and fix wrong check on alpha conversion
- Fix PSD alpha conversion
- Fix autoread test to use also TIFF images
2023-04-18 22:14:41 +00:00
e1a3751936 CMake: make use of qt_add_plugin for plugins
Currently it will only produce shared library binaries as plugin.
This could make building static imageformats plugin much easier.

Related: https://invent.kde.org/frameworks/kimageformats/-/issues/4
2023-03-30 03:42:41 +00:00
402dfb5de3 psd: Fix alpha blending
PSD files are saved with as alpha premultiplied. The problem is that alpha refers to white instead of black so it requires transformation formulas. Then, to conver PS premultiplied to QImage premultiplied you have to use the following formula:

* V = Alpha + Vps - Max (C, M, Y, K, R, G, B, Gray, L\* components)
* V = Vps + (Alpha - Max + 1) / 2 (a\*, b\* components)

Where Max is the maximum value depending on the image depth and Vps is the valued read from the file.
2023-03-29 17:55:55 +00:00
a3f7c03b61 heif: Add format read-write support in README 2023-02-15 08:36:24 +00:00
20cec27ae8 Fix writing TGA alpha depth flag
Correctly write alpha channel depth as 8-bit.
2023-02-01 16:26:31 -06:00
d34c1668aa Bump Qt deprecation level to 6.4 2023-02-01 17:16:45 +01:00
560d0483ae Replace deprecated functions
Improve the code by replacing deprecated functions as suggested by the Qt documentation.
2023-01-31 21:32:30 +00:00
085c9c4841 HDR format removed from RAW plugin 2023-01-30 21:58:36 +00:00
b654f20ece heif: reject invalid files with zero size 2023-01-29 16:16:52 +01:00
21211cd63b psd: LAB conversion speed improved
Using an approximated pow function improves the conversion speed of LAB images by more than 50% without an appreciable visual difference.
2023-01-27 23:19:48 +00:00
5cc7a2b45c psd: native 32-bits RGB support
This patch maps RGB 32-bits PSD to QImage::Format_RGBA32FPx4 or QImage::Format_RGBX32FPx4.
2023-01-26 23:17:09 +00:00
4451737d2f Remove Qt 5 support 2023-01-24 17:15:14 +01:00
01ab0876f1 Debug code removed 2023-01-22 11:04:48 +01:00
a67dcac7d1 LAB/CMYK conversion speed improved by ~10% 2023-01-22 10:57:54 +01:00
cef8d08ad4 Bump KF_DEP_VERSION for KF6 2023-01-21 13:30:04 +01:00
a4b9dd9400 Rename CMake targets/config/libraries for KF6 2023-01-20 23:58:58 +01:00
6e6c1ab5f4 Require Qt6
master is for Qt6-based development now

Qt5 development continues in the 'kf5' branch
2023-01-18 23:37:26 +01:00
f205adf2e0 Remove Qt5 CI
master is Qt6 now
2023-01-18 23:37:26 +01:00
14742cb502 PCX: Fix reading of the extended palette
The VGA palette starts 769 bytes before the end of the file. There may be PADs between the end of the image and the start of the palette.

BUG: 463951
2023-01-11 22:56:38 +00:00
4c6d2b92b6 GIT_SILENT Upgrade ECM and KF version requirements for 5.102.0 release. 2023-01-07 00:28:55 +00:00
05bd9397b3 raw: tweak seek implementation
libraw uses fseek when doing files, which allows seeking past the end
without problems, so do the same, otherwise when we report oss-fuzz
issues they say "give me an example to reproduce" and since our seek
and their seek don't behave the same it's hard to convince them
to fix their code
2022-12-14 23:56:20 +01:00
f4ca3f6783 heif: fix error handling 2022-12-13 11:11:38 +01:00
a30f043e5d heif: rewrite plugin to use only libheif C API
Using C-API instead of C++ libheif API has following advantages:
- More libheif features available (for ex.: strict decoding)
- Linking with static build of libheif is possible
- No need to enable exceptions
2022-12-05 22:43:41 +01:00
7af4eea253 GIT_SILENT Upgrade ECM and KF version requirements for 5.101.0 release. 2022-12-03 09:47:44 +00:00
a3049f6740 Fix missing DCI-P3 color space set 2022-11-24 15:02:31 +01:00
3b1e8f7054 minor tweaks in HEIF and AVIF plugins
It is mostly only about casting between types.
2022-11-19 11:38:49 +00:00
dcab3a06ab raw: LibRaw_QIODevice::read: fixed possible partial reading of an item
- If the size of an item is greater than 1 byte, it must be ensured that it is not partially read.
- In many readings, LibRAW gives an error if a partial number of items are read so I always try to read everything.
2022-11-19 10:14:16 +00:00
361f9e867e PSD multichannel testcases 2022-11-15 16:25:22 +00:00
35883aa604 Support to MCH with 4+ channels (treat as CMYK) 2022-11-15 16:25:22 +00:00
50846f224f avif: Check if encoder/decoder is available in capabilities()
The plugin can be compiled even with decoder libraries only. In a similar way of HEIC plugin I check if an encoder or a decoder is available.
2022-11-15 13:14:09 +00:00
9ad82ed608 Fix condition for installing desktop files 2022-11-07 00:37:09 +01:00
c9f32a226f GIT_SILENT Upgrade ECM and KF version requirements for 5.100.0 release. 2022-11-05 12:28:10 +00:00
a0df142408 Don't install desktop files for image formats when building against Qt6
These are only for kdelibs4support/KServiceTypeTrader
2022-11-03 21:36:38 +01:00
8586bb4719 raw: Don't seek back if we were asked to read too much
Otherwise we will return false when LibRaw::derror
calls for eof() when it is actually that we have reached eof
2022-10-30 23:59:55 +01:00
d734f28727 jxl: indicate when all frames have been read
and return correct loop count
2022-10-18 17:58:40 +02:00
afa7399b36 avif: minor fixes
libavif 0.11.0 uses new default dimension limit 32768 pixels,
we allow 65535 which was used by us previously.
Minor tweaks in jumpToNextImage, jumpToImage
to handle rare situations.
2022-10-18 15:05:15 +02:00
bfb12093ad avif: indicate when all frames have been read 2022-10-15 20:08:39 +02:00
1190e53e9b avif: always indicate endless loop
avif does not support loops but endless loop was the behavior before
460085 was fixed, so a workaround is added.

See also: https://github.com/AOMediaCodec/libavif/issues/347

CCBUG: 460085
2022-10-15 14:11:56 +08:00
350ce1b990 avif: return false in canRead() when imageIndex >= imageCount
Otherwise when `cache: false` is set in AnimatedImage, QMovie will try
to read the image forever.

BUG: 460085
FIXED-IN: 5.100
2022-10-15 14:02:38 +08:00
bcbf45e23a Add JXL test files corresponding to 8 EXIF orientation values 2022-10-13 15:47:04 +02:00
c71a7984d6 Add AVIF test files with rotation and mirror operations 2022-10-12 15:39:27 +02:00
b1f3a87896 Auto-rotate input images in readtest
Currently, there is no difference in the tests but in the future
we will add images with various transformations defined.
2022-10-12 15:33:08 +02:00
8af9a0f9d9 jxl: remove C-style casts 2022-10-11 15:38:55 +02:00
3790a89cd1 avif: Use reinterpret_cast instead C cast
No longer using int for QByteArray size because Qt6 uses qsizetype
2022-10-11 15:05:20 +02:00
f475a4b24a avif: revert 9ac923ad09 commit
Changes to libavif's avifImageRGBToYUV() API were reverted too.
2022-10-11 14:36:17 +02:00
d2f38b8b9c heif: replace C cast with static_cast 2022-10-10 09:28:41 +00:00
9ab64dbf22 heif: use heif_init/heif_deinit with libheif 1.13.0+
In recent libheif, application should use
heif_init/heif_deinit calls. Unfortunately, these calls are
not thread-safe in released 1.13.0 version yet (will be in the
future) and HEIFHandler is often created in different threads.
So we have to guard their use with a mutex.
2022-10-10 09:28:41 +00:00
20f74ce5e6 FindLibRaw: fix include dir, should not contain prefix libraw/
See also the examples at https://www.libraw.org/docs/API-CXX.html

BUG: 460105
2022-10-08 02:15:18 +02:00
54129819d5 Fix duplicated tests 2022-10-02 06:01:23 +00:00
181eb253c6 ANI partial test and PIC test added 2022-10-02 06:01:23 +00:00
c5f7ea7eac PSD: impreved support to sequential access device 2022-10-02 06:01:23 +00:00
ea14882ff7 Fix messages 2022-10-02 06:01:23 +00:00
f8bfdce285 CMakeLists: enable EXR test 2022-10-02 06:01:23 +00:00
524f083ee4 Added EXR test image 2022-10-02 06:01:23 +00:00
c96ad6ba8a Fixes for sequential devices 2022-10-02 06:01:23 +00:00
49bd131eef GIT_SILENT Upgrade ECM and KF version requirements for 5.99.0 release. 2022-10-01 13:17:36 +00:00
2a25ec7a56 Add Qt6 windows CI support 2022-09-27 15:15:36 +00:00
a8a477ae67 pcx: Do not support sequential devices
We need QIODevice::pos() to work in QDataStream &operator>>.

BUG: 459541
2022-09-24 03:45:21 +02:00
2f27dff48b Fix maximum number of channels (testcase added) 2022-09-22 21:17:10 +00:00
72a1cc23b1 Use consistently std::as_const instead of qAsConst
NO_CHANGELOG
2022-09-22 15:59:15 +02:00
6f3a326cf8 LibRaw_QIODevice::seek() avoid seek on a sequential device 2022-09-21 02:14:55 +02:00
d881a7bbb1 LibRaw_QIODevice::seek() bounding checks 2022-09-20 19:44:08 +02:00
65a20b43fc Camera RAW images plugin
Plugin to read RAW camera images based on LibRAW.

- Supersedes MR !86 
- Support to LibRaw 0.20 and 0.21-Beta
- Support to multi-shot images: use imageCount(), jumpToImage() to select the wanted shot
- By default generates 16-bits sRGB images using camera white balance and interpolation AHD
- Should fix CCBUG: 454208: on my Debian with KF5.96 and the pulgin installed, I see the preview of all my RAW files (ARW included) in Dolphin

News compared to V1 (MR !86)

- Fix possible stack overflow due to the huge size of LibRaw class
- Fix image allocation with Qt 6 (make use of QImageIOHandler::allocateImage()) 
- Support to XMP metapacket
- Support to quality option. For e.g. you can focus on quality (q = 10) or speed (q = 1)
- oss-fuzz available [here](https://github.com/mircomir/oss-fuzz/tree/raw_fuzz/projects/kimageformats)
2022-09-19 23:52:43 +00:00
84941b7690 .gitlab-ci.yml: enable static builds 2022-09-18 18:41:54 +00:00
21928300c6 Enables opening of XCF files with Width and/or Height greater than 32K 2022-09-13 17:57:57 +00:00
024d199ed0 Replace C cast with reinterpret_cast 2022-09-11 11:01:55 +02:00
9ac923ad09 avif: adjust for libavif breaking change in YUV<->RGB conversion 2022-09-09 17:54:18 +02:00
feb6d9b20f Fix image allocation with Qt 6
To make the plugins fail to allocate if the image size is greater than QImageReader::allocationLimit() it is necessary to allocate the image with QImageIOHandler::allocateImage().

Note that not all plugins have been changed and some others are not tested in the CI (maybe due to missing libraries).

PS: the following message is printed by QImageIOHandler::allocateImage() if the size is exceeded: "qt.gui.imageio: QImageIOHandler: Rejecting image as it exceeds the current allocation limit of XXX megabytes"
2022-09-07 14:03:33 +00:00
dfbc6e0f8c GIT_SILENT Upgrade ECM and KF version requirements for 5.98.0 release. 2022-09-05 09:27:11 +00:00
43543f96bc Add FreeBSD Qt6 CI support 2022-08-25 08:20:16 +02:00
62e477a6f2 Protect against too big resize for a QByteArray
oss-fuzz/48480
2022-08-15 10:24:40 +00:00
e6955e1f03 GIT_SILENT Upgrade ECM and KF version requirements for 5.97.0 release. 2022-08-07 12:18:50 +00:00
6074c4d6fd Use right type on enums 2022-07-29 07:46:10 +02:00
6f44c5c52a PSD: Improve alpha detection
BUG: 182496
2022-07-25 19:34:57 +00:00
d030c75925 PSD: LAB support
LAB images support:
- Added LAB 8/16-bits support by converting them to sRGB
- The conversion are done using literature formulas (LAB -> XYZ -> sRGB): [sRGB on Wiki](https://en.wikipedia.org/wiki/SRGB), [LAB on wiki](https://en.wikipedia.org/wiki/CIELAB_color_space)
- Removed unused code
2022-07-06 21:30:23 +00:00
9b3133ac92 GIT_SILENT Upgrade ECM and KF version requirements for 5.96.0 release. 2022-07-02 14:33:58 +00:00
b0a0bb1294 PSD header checks according to specifications 2022-06-30 06:56:21 +00:00
3d5090593c Improved detection of alpha channel on CMYK images 2022-06-30 06:56:21 +00:00
d4966d169b Minor code optimization 2022-06-30 06:56:21 +00:00
bf52896347 Minor code improvements (tested on all my MCYK PSD/PSB files) 2022-06-30 06:56:21 +00:00
c52ffa2227 Fix Alpha + testcase images 2022-06-30 06:56:21 +00:00
e4e386babf Fix regression 2022-06-30 06:56:21 +00:00
b47a9d7022 Basic support to CMYK 8/16 bits (not fully tested) 2022-06-30 06:56:21 +00:00
2cbf815d1f Require passing tests for the CI to pass 2022-06-29 20:09:38 +02:00
6cd0056f3b Use ECMDeprecationSettings, bump hidden deprec. API to KF 5.95
NO_CHANGELOG
2022-06-28 00:35:18 +02:00
83374f390e Fix missing init of oneValueArgs variable
NO_CHANGELOG
2022-06-28 00:17:56 +02:00
5e59d950bd jxl: support both old 0.6.1 and new 0.7.0 libjxl API
New libjxl API changed the way how lossless 16bit depth images
must be encoded: codestream level 10 must be set,
which implies use of container format.
Unfortunately, there isn’t version number inside libjxl header yet,
so we must detect new version on cmake/PkgConfig level.
2022-06-22 22:21:33 +00:00
de320447f6 Remove extra ';' 2022-06-22 19:52:13 +02:00
cf375a207f avif: read performance improvements 2022-06-20 18:50:03 +02:00
2aec1d3926 GIT_SILENT Upgrade ECM and KF version requirements for 5.95.0 release. 2022-06-04 08:19:33 +00:00
2a84dd677d psd: Fix segfault on architectures where char is unsigned (like ARM) 2022-05-27 12:26:56 +03:00
ebcc34519c avif: prepare for breaking change in libavif 2022-05-02 11:46:37 +02:00
cff2604cf9 XCF: Support to QImageIOHandler::Size option 2022-04-29 13:23:20 +00:00
f8a251e268 Support to QImageIOHandler::Size option 2022-04-28 08:52:18 +02:00
52134fc2e9 QByteArray resize removal
- Removed QByteArray resize with potentially large numbers as in merge request !66
2022-04-14 23:04:58 +00:00
343954ca98 psd: Fix crash on broken files
Instead of resizing the bytearray to the potential size and then reading
into it, ask the device to read into a bytearray, this way instead of a
crash because we're trying to resize to a too big number we get a nice
  maxSize argument exceeds QByteArray size limit
warning

oss-fuzz/46664
2022-04-13 23:07:22 +02:00
44fd6b7bc0 psd: duotone read
- New format added: Duotone
- Fix float to int conversion round issue
2022-04-11 21:07:23 +00:00
c8a0806aab psd: Don't crash with broken images
Found by oss-fuzz but still with an unfiled bug number
2022-04-10 12:19:52 +02:00
bb475dedd1 psd: Header depth has to be 8 for CM_INDEXED color_mode
As suggested by Mirco Miranda
2022-04-07 23:50:15 +02:00
9e28aae868 psd: Protect against broken images
If you have an image that says it's Mono but has 16 as header.depth we
end up doing invalid memory accesses

oss-fuzz/46437
2022-04-07 21:46:08 +00:00
5c47a97b79 psd: Don't abort on broken images
oss-fuzz/46418
2022-04-06 22:58:31 +00:00
84d56d00cf avif: lossless support 2022-04-06 16:13:10 +00:00
384f78a13c psd: Don't assert on broken files
oss-fuzz/46407
2022-04-06 00:16:38 +02:00
72fc32aefc Add windows CI 2022-04-05 15:45:38 +02:00
98f19c60ae PSD: Performance improvements and support to missing common formats
- Supersedes merge request !55 (PSB support, XMP metadata, ICC color profile, image resolution read)
- Performance improvements: 5 time faster than previous version (tested on a 3.9GB PSB: 9sec instead 47sec)
- New formats support added: INDEXED (8bps), BITMAP (1bps), GRAYSCALE (8, 16, 32bps), RGB (32bps)
- Should fix Bug https://bugs.kde.org/show_bug.cgi?id=397610
- Fix Bug https://bugs.kde.org/show_bug.cgi?id=428238
2022-04-04 17:22:45 +00:00
ae6b724824 GIT_SILENT Upgrade ECM and KF version requirements for 5.93.0 release. 2022-04-02 10:00:12 +00:00
3e751dd80d Fix XCF parasites metadata in QImage and support to ICC profile
- Fix parasite "gimp-comment" not set due to null QImage
- Support to parasite "icc-profile" using Qt 5.14+ API
- Added parasite "gimp-image-metadata" as QImage metadata "XML:org.gimp.xml"
- Added a XCF with XML metadata and icc prifile embedded in autotest folder (generated by GIMP 2.10.30)
- Tested with Qt 5.15.2 and Qt 6.2.3 under Windows and Qt 6.2.3 under macOS
2022-03-23 23:34:33 +00:00
e69dff73e6 avif: encoder speed 7->6 2022-03-10 09:44:50 +01:00
64cfe52bee avif: fix jumpToImage 2022-03-10 09:39:53 +01:00
8732fc8487 avif: warn about non-recommended libavif configuration 2022-03-10 09:35:08 +01:00
d9729b7190 GIT_SILENT Upgrade ECM and KF version requirements for 5.92.0 release. 2022-03-05 11:15:00 +00:00
55d3c568b2 Add Qt6 Android CI 2022-03-01 16:04:48 +00:00
4afafee6c1 Add write tests for heif/avif/jxl
Unfortunately none of them pass since it seems they can't load a png,
save it to their format with loseless quality and read it back and get
exactly the same contents than the png
2022-02-18 00:05:01 +01:00
f04084e175 jxl: encoding improvements
Plug-in can save in 8bit depth now,
previously only 16bit was supported.
Memory and dimension limits were adjusted.
2022-02-16 10:26:56 +01:00
9911c9c2ea avif: adjust dimension and memory limits
With or height can be above 32k now (up to 64k), but
image should not have more than 256megapixels
(Default memory limit of libavif)
2022-02-11 16:01:07 +01:00
4ceef5164d GIT_SILENT Upgrade ECM and KF version requirements for 5.91.0 release. 2022-02-05 15:14:16 +00:00
3d2d91a08a Fix typo, should be qCWarning
GIT_SILENT
2022-02-03 16:34:06 +02:00
0a02458560 Check executables exist in PATH before passing them to QProcess
See:
https://kde.org/info/security/advisory-20220131-1.txt
https://mail.kde.org/pipermail/kde-devel/2022-January/000943.html
2022-02-03 11:32:24 +02:00
96836e849f Fix handling of null terminated ANI metadata with Qt6
In Qt5 converting a QByteArray to a QString stops at the first null byte,
in Qt6 the QByteArray size is respected, and trailing null bytes are
therefore included in the final QString. Explicitly determine the length
of the string data to deal with that.
2022-01-22 22:03:21 +01:00
f4edb7296f Add CI qt6 support 2022-01-08 09:27:14 +01:00
56376ffd66 GIT_SILENT Upgrade ECM and KF version requirements for 5.90.0 release. 2022-01-01 12:16:00 +00:00
f534254063 GIT_SILENT: It compiles fine without deprecated methods 2021-12-26 11:35:54 +01:00
32347725cb Fix typo 2021-12-21 20:28:05 +01:00
56e762c563 Make it compile against qt6 2021-12-21 20:10:11 +01:00
81603ed908 GIT_SILENT Upgrade ECM and KF version requirements for 5.89.0 release. 2021-12-04 17:00:59 +00:00
957c199c68 GIT_SILENT: add missing licences 2021-12-02 07:14:54 +01:00
f445e5dd0a avif: limit scope of variables 2021-11-29 17:35:51 +01:00
d3da56bba3 Add JXL to the list of supported formats 2021-11-17 20:06:11 +01:00
41c4b5930c Add plugin for JPEG XL (JXL) 2021-11-10 16:01:58 +01:00
fb66044714 Add FreeBSD CI 2021-10-07 00:28:35 +02:00
a43394a759 Add Android CI 2021-10-07 00:04:08 +02:00
904c251f50 GIT_SILENT Upgrade ECM and KF version requirements for 5.87.0 release. 2021-10-02 12:18:49 +00:00
2f9e09f04a Add Gitlab CI configuration 2021-09-29 21:55:22 +13:00
6458c9ae52 avif: performance and quality improvements
Enable decoder to use more threads.
8bit YUV->RGB conversion is significantly faster
when AVIF_RGB_FORMAT_RGBA format is used,
because libavif can use libyuv to perform conversion quickly.
Prefer faster AVIF_CHROMA_UPSAMPLING_FASTEST when decoding animation.
Encoder speed changed from to 8 to 7.
Recent AV1 encoders got faster,
so it is OK to switch to better compression quality.
Remove obsolete image/avif-sequence mime-type
as it was merged with image/avif.
2021-09-22 11:53:46 +02:00
45cd128f73 GIT_SILENT Add CI configuration file 2021-09-05 14:03:42 +02:00
e89d21f12d GIT_SILENT Upgrade ECM and KF version requirements for 5.86.0 release. 2021-09-04 15:45:36 +00:00
1d2b51ddf1 Fix build with clang12 + libc++ 2021-08-30 20:29:23 +02:00
1080976abe GIT_SILENT: we can use std::as_const directly 2021-08-28 18:07:43 +02:00
abd550c60c GIT_SILENT: replace MacOSX with macOS 2021-08-25 14:56:21 +02:00
aade392da3 Clean up unneeded JSON parameter in kimageformats_add_plugin
The moc process already rebuilds the plugin when the JSON file changes, consequently the additional parameter is not needed.

Task: https://phabricator.kde.org/T14649
2021-08-24 12:06:06 +02:00
7642633551 SGIImage::writeImage: Properly fail if the image is too big 2021-08-19 17:29:44 +02:00
9f2c5061c8 exr: Port to std::log/pow
The Imath functions are marked as deprecated and they just call the
std::log/pow anyway
2021-08-18 21:51:53 +00:00
28099eed71 GIT_SILENT Upgrade Qt5 version requirement to 5.15.2. 2021-08-15 08:56:59 +00:00
f5d574b3ad clang-tidy: one declaration per line; braces around statements
clang-tidy checks:
readability-isolate-declaration and readability-braces-around-statements

KF task: https://phabricator.kde.org/T14729

GIT_SILENT
2021-08-13 15:13:21 +02:00
a8f92e5525 PCXHandler::write: Properly fail if the image is too big 2021-08-12 16:43:52 +02:00
fbeef559b7 exr: Repair compability with openexr2
BUGS: 440084
2021-07-21 00:04:45 +02:00
7f56d835f0 GIT_SILENT Upgrade ECM and KF version requirements for 5.85.0 release. 2021-07-14 22:32:29 +00:00
8f87ce4cb2 Fix typos found by codespell
GIT_SILENT
2021-07-14 00:08:38 +02:00
5aa03c12ad exr: Override the actual function signature
For gcc there's a typedef that makes it work, but seems clang in macos is
not so lucky

BUGS: 439767
2021-07-12 20:15:12 +02:00
3266a9c466 Fix build with older openEXR versions
Dynamic exception specification is not allowed in c++-17. The enforcement needs
to be relaxed for the kimg_exr plugin when using openEXR versions older than 2.3.0.
2021-07-08 12:56:30 +02:00
1b2bf6e931 Remove CMAKE_CXX_STANDARD, now set to 17 in KDEFrameworkCompilerSettings in ECM
NO_CHANGELOG
2021-06-19 20:05:41 +02:00
894391b000 GIT_SILENT Upgrade ECM and KF version requirements for 5.84.0 release. 2021-06-19 15:58:16 +00:00
ef6be2c077 avif: Disable all strict decoder checks
New libavif 0.9.1 apply some very strict standard compliance
checks by default. Unfortunately, it rejects many files made by
libheif-based apps (GIMP, ImageMagick) in the past.
libheif 1.12.0 (released on May 5, 2021) addressed the problem,
but it would be good to extend grace period, allowing other
projects and distributions to upgrade to fixed version.
2021-06-08 15:20:41 +02:00
96b40da089 GIT_SILENT Upgrade ECM and KF version requirements for 5.83.0 release. 2021-06-05 08:55:28 +00:00
bf3f94da76 avif: Adjust for libavif breaking change 2021-06-04 14:37:10 +02:00
318dacda75 Remove compiler flags already defined in extra-cmake-modules
-DQT_NO_FOREACH

GIT_SILENT
2021-05-23 17:18:51 +02:00
e358bb0feb Bump required CMake version to 3.16
KF6 task: https://phabricator.kde.org/T14467
2021-05-17 13:21:23 +02:00
dca6e87c89 Enable HEIC plugin to save all ICC profiles 2021-05-14 12:30:28 +02:00
62f9af9a35 Color profile loading/saving fixes
Allow saving Qt-unsupported variants of ICC profiles, they could be
correctly handled by apps with wider color management support.
Change way how QColorSpace is created to avoid
rare problems in some apps.
2021-05-13 16:56:46 +02:00
ff53d3d7e9 xcf: Make sure offsets are not negative
It's not a huge problem since QIODevice::seek() is a noop on negative values but it's
just better to bail out as soon as possible when we realize the file is
broken
2021-05-05 17:23:59 +02:00
780f342825 GIT_SILENT Add auto generated files to .gitignore 2021-05-02 12:48:16 +02:00
297ed9a2fe xcf: Fix Stack-buffer-overflow WRITE on broken files
oss-fuzz/33742
2021-05-02 09:50:50 +00:00
55b4077f2c GIT_SILENT Upgrade ECM and KF version requirements for 5.82.0 release. 2021-05-01 09:42:14 +00:00
2429c95336 Support building with OpenEXR 3
Try to find OpenEXR 3 first via the upstream cmake config and fallback to using our FindOpenEXR
2021-04-24 10:17:25 +00:00
224f892b09 GIT_SILENT increase KF_DISABLE_DEPRECATED_BEFORE_AND_AT 2021-04-11 12:05:38 +02:00
64fa129ed6 GIT_SILENT Add auto generated files to .gitignore 2021-04-07 21:06:01 +02:00
3cb4021afc test: imageconverter: add a way to list mimes instead of formats 2021-04-05 09:44:03 +00:00
95a19a15c3 xcf: fix new[]/delete mismatch, as detected by ASAN 2021-04-04 17:30:52 +02:00
1ba23a1e8e Port away from QPrinter::setPaperSize, deprecated in Qt 5.15
The formula was found in Qt's qt_pixelMultiplier (qpagesize.cpp)
as called by the deprecated setPaperSize method (when the unit is
DevicePixel)

NO_CHANGELOG
2021-04-04 15:56:13 +02:00
bc3c04c7ce GIT_SILENT Upgrade Qt5 version requirement to 5.15.0. 2021-04-04 14:44:40 +02:00
2755f74fbb ani: convert +1 to -1 so we don't do a potential integer overflow
oss-fuzz/32601

runtime error: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
2021-04-03 22:46:33 +00:00
3b0c767f82 GIT_SILENT Upgrade ECM and KF version requirements for 5.81.0 release. 2021-04-03 09:33:41 +00:00
e80fcd7c30 GIT_SILENT increase KF_DISABLE_DEPRECATED_BEFORE_AND_AT 2021-03-27 11:37:36 +01:00
a73e3d44dd Add .git-blame-ignore-revs
GIT_SILENT
2021-03-09 02:18:09 +02:00
1169859b07 Run clang-format on all cpp/h files
NO_CHANGELOG
2021-03-08 20:15:33 +02:00
04e276dcb3 Add clang-format bits to CMakeLists.txt
GIT_SILENT
2021-03-08 20:14:48 +02:00
e3ab850712 Add a trailing comma to enum
Should help produce better diffs and clang-format won't squash the enum
on one line.

GIT_SILENT
2021-03-08 20:14:42 +02:00
503b3eee2b Fix Non-square Radiance/RGBE/.hdr images failing to load
The HDR QImageIOHandler plugin only supports the default image orientation (-Y +X) in .hdr files. It mixes up the width and height however, resulting in non-square images not loading.

This fix adds a check for the standard image orientation in the file and returns false (with error message) if that fails.
If it succeeds, it takes the height from the -Y component, and the width from the +X component, resulting in successful loading of the image.

Add autotest images for landscape and portrait HDR (Radiance RGBE) loader

BUGS: 433877
2021-03-04 22:57:23 +01:00
511a22f0b4 Check the input buffer before passing it to libheif 2021-03-02 11:46:13 +00:00
c532227d43 GIT_SILENT Upgrade ECM and KF version requirements for 5.80.0 release. 2021-02-28 18:59:05 +00:00
1462c3abd6 Check primaries returned from libavif
Due to various double vs float arithmetic,
some primaries could be rejected by Qt.
If necessary, we adjust the values so they
will be accepted by Qt.

Remove newline from the ends of error strings.
2021-02-27 19:11:56 +01:00
ca52d4ddf5 Add plugin for High Efficiency Image File Format (HEIF)
Code partially by Sirius Bakke
2021-02-25 11:52:00 +01:00
7ba4d6adda GIT_SILENT increase KF_DISABLE_DEPRECATED_BEFORE_AND_AT 2021-02-13 14:41:28 +01:00
0aaab103b1 Add compile_commands.json to .gitignore
See https://invent.kde.org/sdk/kdesrc-build/-/merge_requests/82

GIT_SILENT
2021-02-11 14:27:34 +02:00
8b9125c913 Quality option can be returned without parsing input file. 2021-02-08 10:00:53 +01:00
8845dd9818 Simplify portion of NCLX color profile code 2021-02-02 09:28:32 +01:00
a4b8295625 [imagedump] Add "list MIME type" (-m) option
Allows listing the supported mime types
2021-01-31 20:49:16 +01:00
134c96fa61 GIT_SILENT Add auto generated .clang-format file to .gitignore 2021-01-30 18:39:11 +01:00
3673874a63 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.79.0 release. 2021-01-29 20:44:46 +00:00
8ad43638ad Fix crash with malformed files
oss-fuzz/29284
2021-01-08 14:02:45 +00:00
c72c9f577b ani: Make sure riffSizeData is of the correct size before doing the quint32_le cast dance
oss-fuzz/29290
2021-01-05 21:52:24 +01:00
bf3f99abf5 Add missing includes 2021-01-03 10:05:53 +01:00
b79d1f222d Add plugin for animated Windows cursors (ANI) 2021-01-03 08:49:10 +00:00
bf1de9f8f0 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.78.0 release. 2021-01-02 12:27:55 +00:00
82d5e0f8a4 Remove ifdefs, we require Qt 5.14 now 2020-12-18 19:34:07 +01:00
bbf945137a GIT_SILENT Upgrade Qt5 version requirement to 5.14.0. 2020-12-18 19:02:54 +01:00
54ed1dda27 Add AVIF to the list of supported formats 2020-12-16 08:36:39 +00:00
34a9ec1b06 Add plugin for AV1 Image File Format (AVIF) 2020-12-13 22:23:27 +00:00
a6ec69d276 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.77.0 release. 2020-12-05 10:09:13 +00:00
02cbf3889f GIT_SILENT Upgrade Qt5 version requirement to 5.13.0. 2020-11-27 00:45:24 +01:00
6cf05cf305 test: don't convert image format if possible 2020-11-10 13:03:37 +08:00
938b8126b5 No longer descease color depth to 8 for 16 bit uncompressed PSD files 2020-11-10 13:03:37 +08:00
d36c191351 tests: Remove qimage_format_enum_names and just use QMetaEnum 2020-11-09 19:15:36 +00:00
1acb5a6177 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.76.0 release. 2020-11-07 11:39:10 +00:00
f2ccbf1724 Add test case for RLE compressed 16 bpc PSD files. 2020-11-06 15:04:04 +08:00
5825c83235 Add support for RLE-compressed, 16 bits per channel PSD files. 2020-11-06 15:02:29 +08:00
b742cb7cc7 Return unsupported when reading 16bit RLE compressed PSD files 2020-11-01 11:50:48 +08:00
2e6eeebdfc feat: add psd color depth == 16 format support 2020-10-30 21:47:12 +08:00
db0b5d571a GIT_SILENT increase KF_DISABLE_DEPRECATED_BEFORE_AND_AT 2020-10-11 11:27:17 +02:00
da2fc84a3b GIT_SILENT Upgrade ECM and KF5 version requirements for 5.75.0 release. 2020-10-04 09:52:48 +00:00
d6b79d16ad GIT_SILENT Upgrade ECM and KF5 version requirements for 5.74.0 release. 2020-09-06 09:21:38 +00:00
fc9a128f47 Remove obsolete COPYING files 2020-08-17 08:00:58 +02:00
d326d5dab9 GIT_SILENT increase KF_DISABLE_DEPRECATED_BEFORE_AND_AT 2020-08-16 01:12:16 +02:00
6e9df28487 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.73.0 release. 2020-08-01 17:06:54 +00:00
f4281984c1 Adapt license to LGPL-2.0-or-later
According to relicensecheck Brad is OK with changing LGPLv2 to LGPLv2+,
which is required to be compatible with the LGPL-2.1-or-later licensed
source files.
2020-07-21 09:26:47 +00:00
20f996a7dd Rely on QStringLiteral yielding a QString to use its methods on
GIT_SILENT
2020-07-13 04:02:38 +02:00
9a04f2637f Use KF-standardized Qt logging categories
See https://community.kde.org/Frameworks/Frameworks_Logging_Policy
2020-07-13 04:01:44 +02:00
d1136c4bac GIT_SILENT Upgrade ECM and KF5 version requirements for 5.72.0 release. 2020-07-04 09:51:54 +00:00
a446331a5e GIT_SILENT Upgrade ECM and KF5 version requirements for 5.71.0 release. 2020-06-06 19:34:48 +00:00
37be13e3a4 GIT_SILENT increase KF_DISABLE_DEPRECATED_BEFORE_AND_AT 2020-06-05 10:40:11 +02:00
51d0b2ad86 GIT_SILENT: we don't use phabricator anymore 2020-05-19 07:13:43 +02:00
8562ce18f1 Add some sanity and bounds checking
Since QImage does sanity checking for overflows and stuff wrt.
dimensions and depth, check for QImage::isNull() as early as possible to
see if there's some funky business going on.

Also tried to add some checks wherever we wrote to "raw" memory.

Unit tests pass, and tested converting some files from
https://samples.ffmpeg.org/image-samples/ to pngs, and that seemed to
work.

Reviewed By: aacid

Differential Revision: https://phabricator.kde.org/D24367
2020-05-10 18:06:56 +02:00
f5b26cc9f9 GIT_SILENT increase KF_DISABLE_DEPRECATED_BEFORE_AND_AT 2020-05-10 00:38:45 +02:00
105d0fab46 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.70.0 release. 2020-05-02 21:58:20 +00:00
497b6b81bd Fix build on Windows.
We added our own implementation of rand_r to make sure we use the same
as Gimp, and to make Windows work. But we need to actually use it
everywhere.

Discussion in Differential:

Differential Revision: https://phabricator.kde.org/D25267
2020-04-15 09:46:54 +02:00
c60e77c048 Add support for modern Gimp images/XCF files
We now support up to and including version 11 of the XCF format, earlier
it only supported version 1 (from 1997, according to the XCF spec).

Biggest difference seems to be that they changed to 64bit for offsets
from version 11 and upwards, otherwise it's mostly just newer enum
values and theoretically major stuff that we don't really need to care
about to get a thumbnail (e. g. linear vs. perceptual RGB).

We still don't support all features, but now it handles that more
gracefully and should at least create thumbnails that are usable. It
should also be easier to update in the future if/when there comes new
versions.

Also added a test file created with the latest version of Gimp
(2.10.18).

Reviewed By: aacid

Differential Revision: https://phabricator.kde.org/D25937
2020-04-13 14:52:33 +02:00
f089e860e0 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.69.0 release. 2020-04-04 22:35:32 +00:00
551e7d44a8 Port the HDR plugin from sscanf() to QRegularExpression. Fixes FreeBSD. 2020-03-29 13:04:34 +02:00
232075f92e Port HDR plugin to qCDebug, to debug CI failure on FreeBSD
NO_CHANGELOG
2020-03-29 12:14:13 +02:00
1d12b345f9 GIT_SILENT add missing newline 2020-03-29 01:06:42 +01:00
becd7aff3a autotests: print QImageReader::supportedImageFormats, to debug CI failures 2020-03-29 00:47:47 +01:00
52fbe1863b GIT_SILENT increase KF_DISABLE_DEPRECATED_BEFORE_AND_AT 2020-03-25 00:54:05 +01:00
203f459536 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.68.0 release. 2020-03-07 08:52:35 +00:00
693bb34b69 GIT_SILENT: qtcreator created .cmake/ repo. 2020-02-12 07:12:24 +01:00
5c66570b9e GIT_SILENT increase KF_DISABLE_DEPRECATED_BEFORE_AND_AT 2020-02-09 20:26:37 +01:00
cba2328ae6 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.67.0 release. 2020-02-01 09:04:07 +00:00
961465a311 GIT_SILENT Bump KF5 deprecation level to 5.66 2020-01-12 12:46:21 +01:00
b7cd5cddc1 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.66.0 release. 2020-01-03 23:12:09 +00:00
ce56b97ee7 GIT_SILENT Upgrade Qt5 version requirement to 5.12.0. 2019-12-21 12:34:54 +01:00
500ce13265 Update the obsolete projects.kde.org URL
Use the generic redirect commits.kde.org.

Change discussed on the kde-frameworks-devel list:
https://mail.kde.org/pipermail/kde-frameworks-devel/2019-November/097564.html
2019-12-15 22:42:38 +01:00
f03739f222 pic: Fix Invalid-enum-value undefined behaviour
Summary:
Instead of directly casting the quint8 to PicChannelEncoding we just store the quint8
and compare it to the possible PicChannelEncoding values when needed

oss-fuzz/19344

Reviewers: dfaure

Reviewed By: dfaure

Subscribers: dfaure, security-team, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D25937
2019-12-14 21:05:02 +01:00
69effbf9f5 GIT_SILENT Bump KF5 deprecation level to 5.65 2019-12-14 12:22:02 +01:00
f06cf300f1 GIT_SILENT Bump KF5 deprecation level to 5.64 2019-12-14 11:45:23 +01:00
2a4d230717 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.65.0 release. 2019-12-07 19:43:41 +00:00
bdf23e45d5 GIT_SILENT QT_DEPRECATED_WARNINGS_SINCE will be done by ECM 2019-11-03 21:13:00 +01:00
e9b52df1d3 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.64.0 release. 2019-11-02 11:44:38 +00:00
dd98b2b717 Workaround crash in Qt due to -DQT_DISABLE_DEPRECATED_BEFORE=0x050d00
https://codereview.qt-project.org/c/qt/qtbase/+/279215

NO_CHANGELOG
2019-10-27 09:38:43 +01:00
dd76f41c38 GIT_SILENT disable use of deprecated KF5 API 2019-10-26 23:20:53 +02:00
940ca2b081 GIT_SILENT enable Qt deprecation warnings 2019-10-25 00:28:24 +02:00
b14ef357e5 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.63.0 release. 2019-10-06 09:35:52 +00:00
bf5502403e Add files for testing bug411327 2019-09-20 23:18:17 +02:00
5c4c05257c xcf: Fix regression when reading files with "unsupported" properties
Summary:
The fact that we don't know the property is most of the times not fatal,
so what we have to do is just "skip" the property and hope for the best

BUGS: 411327

Reviewers: cfeck, apol, vkrause

Reviewed By: vkrause

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D24114
2019-09-20 22:41:26 +02:00
7afaacb093 xcf: Properly read image resolution
Summary:
QDataStream reads 64 bits when reading into a float unless you tell it to use SinglePrecision,
since floats in xcf are 32 bit, do that

Reviewers: cfeck, apol, vkrause

Reviewed By: vkrause

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D24113
2019-09-20 22:41:03 +02:00
68bb1a0ee7 Port HDR (Radiance RGBE) image loader to Qt5
Tested with HDR images from hdrihaven.com
* Loading in KolourPaint works
* Thumbnails in Dolphin work

Reviewed by: aacid

Differential Revision: https://phabricator.kde.org/D23811
2019-09-14 14:05:30 +02:00
9a9ac6e8fe GIT_SILENT Upgrade ECM and KF5 version requirements for 5.62.0 release. 2019-09-07 12:35:26 +00:00
4bf2894bde Fix uninitialized memory read
Summary:
Make sure whole of pixel_size in pixel has data either because it was
read or because we set it to 0

oss-fuzz/14565

Reviewers: dfaure, apol, vkrause

Reviewed By: vkrause

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D23739
2019-09-05 20:05:35 +02:00
40353da5db GIT_SILENT Upgrade ECM and KF5 version requirements for 5.61.0 release. 2019-08-03 19:33:24 +00:00
068e711847 Remove explicit use of ECM_KDE_MODULE_DIR, is part of ECM_MODULE_PATH
GIT_SILENT
2019-08-02 22:54:45 +02:00
90ba55d982 Remove unused pnm.desktop file 2019-07-20 11:29:31 +02:00
e3603bc748 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.60.0 release. 2019-07-06 13:15:48 +00:00
75ef81a109 QImage::byteCount -> QImage::sizeInByes 2019-07-04 22:26:53 +02:00
bff22e2a76 GIT_SILENT Upgrade Qt5 version requirement to 5.11.0. 2019-07-04 19:23:58 +02:00
0196444a99 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.59.0 release. 2019-06-01 16:38:28 +00:00
90f340df24 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.58.0 release. 2019-05-04 22:44:00 +00:00
1a9b5d6cb6 tga: don't try to read more than max_palette_size into palette 2019-05-01 01:51:42 +02:00
96b1d7e7bc tga: memset dst if read fails 2019-05-01 01:51:39 +02:00
bcce48012e tga: memset the whole palette array, not only the palette_size 2019-05-01 01:44:47 +02:00
0db5c89c5f Initialize the unread bits of _starttab
oss-fuzz #14446
2019-04-25 23:08:17 +02:00
6fea48c4ee xcf: Fix uninitialized memory use on broken documents
oss-fuzz #14312
2019-04-17 20:09:49 +02:00
645daec1ef ras: Don't overread input on malformed files 2019-04-17 20:03:52 +02:00
aaa285a3b9 xcf: layer is const in copy and merge, mark it as such 2019-04-17 17:37:28 +02:00
35e64c44d8 No & is a bit faster here 2019-04-17 17:37:28 +02:00
26b796f67d const & is a bit faster here 2019-04-17 17:37:28 +02:00
4692a34a1c QStringLiteral is a bit faster here 2019-04-17 17:37:28 +02:00
c0656c5181 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.57.0 release. 2019-04-07 07:18:46 +00:00
83d1ca90d9 Fix compilation
Summary:
Seems only gcc can do a constexpr with strlen.

This fixes the build with clang, hopefully to with MSVC?

Reviewers: svuorela

Reviewed By: svuorela

Subscribers: svuorela, apol, pino, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D20149
2019-03-31 22:18:16 +02:00
fd4fb6f596 ora:kra: qstrcmp -> memcmp
i..e don't check strings but memory

Makes oss-fuzz happier.

Reviewers: svuorela

Reviewed By: svuorela

Subscribers: apol, pino, security-team, rempt, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D20143
2019-03-31 21:32:07 +02:00
a24ece396a autotests: Also exercise canRead 2019-03-31 20:58:26 +02:00
9fc6967f4f Fix RGBHandler::canRead
Summary:
As one can see in SGIImage::readImage the accepted images are

    _stream >> u16;
    if (u16 != 0x01da) {
        return false;
    }

    _stream >> _rle;
    if (_rle > 1) {
        return false;
    }

so not only \x01\xda\x01 but also \x01\xda\x00

Reviewers: svuorela

Reviewed By: svuorela

Subscribers: svuorela, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D20145
2019-03-31 19:44:21 +02:00
bd704045e6 xcf: Don't crash with files with unsupported layer modes 2019-03-31 01:35:33 +01:00
af7a89fea7 GIT_SILENT: add gitignore 2019-03-04 07:03:36 +01:00
5989bba56a GIT_SILENT Upgrade ECM and KF5 version requirements for 5.56.0 release. 2019-03-02 13:27:12 +00:00
20100a1e0e ras: fix crash on broken files
Replace QVector::operator[] with QVector::value() since we can't know for
sure the values will be on range so use value() that gives us a 0 if the
index is not on range

oss-fuzz/13462
2019-03-01 23:33:35 +01:00
297b168a52 Use auto here too 2019-02-28 23:03:25 +01:00
f1c6c15b06 compile without foreach
Summary: compile without foreach

Reviewers: dfaure, apol

Reviewed By: apol

Subscribers: apol, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D19317
2019-02-28 23:02:41 +01:00
156bac5e54 ras: protect the palette QVector too
oss-fuzz/13068
2019-02-13 23:50:36 +01:00
d79c11d280 ras: tweak max file check
better to do - 32 than + 32 otherwise we may overflow

oss-fuzz/13017
2019-02-11 22:57:33 +01:00
aeec934839 xcf: Fix uninitialized memory use on broken documents
oss-fuzz/12871
2019-02-08 23:27:03 +01:00
0c4f2f8e62 add const, helps understand the function better 2019-02-08 23:07:56 +01:00
4a8da73f0e ras: tweak max size that "fits" in a QVector
oss-fuzz/12951
2019-02-07 22:14:22 +01:00
039d7d8fbe ras: don't assert because we try to allicate a huge vector
oss-fuzz/12915
2019-02-06 22:06:58 +01:00
b072484dbb ras: Protect against divide by zero
oss-fuzz/12905
2019-02-05 19:51:24 +01:00
bad90cea4b xcf: Don't divide by 0
oss-fuzz/12815
2019-02-03 14:06:33 +01:00
a51cbd865f tga: fail gracefully if readRawData errors
oss-fuzz/12818
2019-02-03 13:49:11 +01:00
1a31500e55 ras: fail gracefully on height*width*bpp > length
oss-fuzz/12822
2019-02-03 13:38:44 +01:00
dd95a5bd0e GIT_SILENT Upgrade ECM and KF5 version requirements for 5.55.0 release. 2019-02-02 17:22:00 +00:00
8d0b625538 xcf: Fix fix for opacity being out of bounds
If max opacity is 255 we want the min between opacity and 255 and not the max
2019-02-01 11:30:28 +01:00
8e48d67568 Uncomment the qdebug includes
i've wasted enough time uncommenting and commenting them again
2019-01-31 01:37:09 +01:00
8b8330b0fe tga: Fix Use-of-uninitialized-value on broken files
oss-fuzz/12776
2019-01-31 01:35:39 +01:00
e7f3c0be44 max opacity is 255
Fixes oss-fuzz/12782
2019-01-31 01:25:38 +01:00
c3152506e2 xcf: Fix assert in files with two PROP_COLORMAP
It's most probably a broken file but better if we don't assert ^_^

oss-fuzz/12780
2019-01-31 01:19:52 +01:00
de7a9a8457 ras: Fix assert because of ColorMapLength being too big
oss-fuzz/12785
2019-01-31 01:03:17 +01:00
c2d2a9be66 pcx: Fix crash on fuzzed file
oss-fuzz/12784
2019-01-31 00:56:25 +01:00
4ee92527c4 xcf: Implement robustness for when PROP_APPLY_MASK is not on the file
fixes oss-fuzz/12754
2019-01-29 22:34:04 +01:00
1bad780baa xcf: loadHierarchy: Obey the layer.type and not the bpp
Otherwise we end up doing uninitialized memory reads on broken/fuzzed
files

oss-fuzz/12761
2019-01-29 20:36:15 +01:00
18e17d3a7a tga: Don't support more than 8 alpha bits
Fixes undefined left shift with negative values

oss-fuzz/12764
2019-01-29 12:39:52 +01:00
e34f53d6ae ras: Return false if allocating the image failed
Probably because it's too huge
2019-01-29 12:32:23 +01:00
6dcea7fd01 rgb: Fix integer overflow in fuzzed file
oss-fuzz/12763
2019-01-29 11:19:58 +01:00
4751e897ce rgb: Fix Heap-buffer-overflow in fuzzed file
oss-fuzz/12757
2019-01-29 10:54:25 +01:00
ac725cca68 psd: Fix crash on fuzzed file
oss-fuzz/12752
2019-01-29 10:53:30 +01:00
f61d64e0e5 xcf: Initialize x/y_offset
https://gitlab.gnome.org/GNOME/gimp/raw/master/devel-docs/xcf.txt
  When reading old XCF files that lack this property, assume (0,0).
2019-01-28 21:51:10 +01:00
e45b65e814 rgb: Fix crash in fuzzed image
An image without color channels makes no sense
2019-01-28 21:48:26 +01:00
7e86e62e86 pcx: Fix crash on fuzzed image 2019-01-28 21:40:42 +01:00
03c3c07004 Fix tests on jenkins
Qt also has a tga image plugin so unless we make sure ours is used first
tests are not testing what they should

On a side note their plugin fails our tests so someone with enough time
should report the failures to them
2019-01-28 21:27:22 +01:00
0e21713267 rgb: fix crash in fuzzed file 2019-01-28 21:10:18 +01:00
188271a5d0 xcf: initialize layer mode
https://gitlab.gnome.org/GNOME/gimp/raw/master/devel-docs/xcf.txt
  When reading old XCF files that lack this property, assume mode==0.
2019-01-28 21:05:29 +01:00
311296dd19 xcf: initialize layer opacity
https://gitlab.gnome.org/GNOME/gimp/raw/master/devel-docs/xcf.txt
  When reading old XCF files that lack this property, full opacity
  should be assumed.
2019-01-28 20:31:18 +01:00
d6ae11a691 xcf: set buffer to 0 if read less data that expected
Fixes MemorySanitizer: use-of-uninitialized-value on fuzzed file
2019-01-28 20:09:21 +01:00
3923c9b855 bzero -> memset
Seems bzero is less portable
2019-01-28 19:18:01 +01:00
51d710adda Fix various OOB reads and writes in kimg_tga and kimg_xcf
Summary:
I had a look at some image loading code in kimageformats and found memory
corruption bugs (there might be more):

- oobwrite4b.xcf: OOB write in kimg_xcf:

By overflowing the "size = 3 * ncolors + 4;" calculation, it's possible to make
size == 3 or size == 0, which then allows 1 or 4 bytes to be overwritten:
https://cgit.kde.org/kimageformats.git/tree/src/imageformats/xcf.cpp?id=3f2552f21b1cdef063c2a93cc95d42a8cf907fcf#n484
The values aren't arbitrary, so AFAICT DoS only.
Fix is to move the sanity check for size below the assignment.

- oobread.tga: OOB read in kimg_tga:

By overflowing the "size = tga.width * tga.height * pixel_size" calculation,
it's possible to cause OOB reads later on as the image data array is too small:
https://cgit.kde.org/kimageformats.git/tree/src/imageformats/tga.cpp?id=3f2552f21b1cdef063c2a93cc95d42a8cf907fcf#n192
Fix is to use a 64bit integer instead.

- oobwrite4b.tga/oobwrite507.tga: OOB write in kimg_tga

If RLE is enabled, any size checks are skipped, so it's possible to write
either 128 repetitions of an arbitrary four byte value (oobwrite4b.tga)
or or 507 arbitrary bytes (oobwrite507.tga) out of bounds.
https://cgit.kde.org/kimageformats.git/tree/src/imageformats/tga.cpp?id=3f2552f21b1cdef063c2a93cc95d42a8cf907fcf#n209
Fix is to check for "num" being negative before reading into the buffer.

Also, bail out early if there is no more data available (reading a 65kx65k px image from 14B data takes ages otherwise)

Test Plan:
Stopped crashing and valgrind don't complain anymore.

TGA preview still works for valid files.

Reviewers: aacid

Reviewed By: aacid

Subscribers: lbeltrame, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D18574
2019-01-28 14:21:27 +01:00
52a5959c08 pic: resize header id back if didn't read 4 bytes as expected 2019-01-28 01:56:12 +01:00
309cddbe83 xcf: bzero buffer if read less data than expected 2019-01-28 01:30:17 +01:00
47f46d4463 xcf: Only call setDotsPerMeterX/Y if PROP_RESOLUTION is found
https://gitlab.gnome.org/GNOME/gimp/blob/master/devel-docs/xcf.txt says
it's not really that important to be there
2019-01-27 13:14:30 +01:00
bff6142b44 xcf: initialize num_colors 2019-01-27 13:07:37 +01:00
09abfd8084 xcf: Initialize layer visible property
https://gitlab.gnome.org/GNOME/gimp/blob/master/devel-docs/xcf.txt says
	When reading old XCF files that lack this property, assume that layers are visible
2019-01-27 13:03:51 +01:00
964624ba40 xcf: Don't cast int to enum that can't hold that int value 2019-01-27 12:50:19 +01:00
3dee6f7c47 xcf: Do not overflow int on the setDotsPerMeterX/Y call 2019-01-27 12:29:07 +01:00
b8cb5e322c delete copy constructor and assignment operator of some internal classes
they are unused, but if anyone would use them things would go wrong, so protect us from it
2019-01-13 22:30:55 +01:00
8803ae9cd6 GIT_SILENT Upgrade Qt5 version requirement to 5.10.0. 2019-01-07 00:19:26 +01:00
e5b7b414df GIT_SILENT Upgrade ECM and KF5 version requirements for 5.54.0 release. 2019-01-04 21:42:58 +00:00
c3b8030674 GIT_SILENT Upgrade CMake version requirement to 3.5. 2018-12-01 23:56:44 +01:00
072b531b0d GIT_SILENT Upgrade ECM and KF5 version requirements for 5.53.0 release. 2018-12-01 14:40:14 +00:00
10f201e414 Use gimp to export simple-rgba-gimp-2.8.10.xcf to png again
This fixes the xcf test that was failing, i guess at some point someone
run optipng or something over the expected result and that was causing
the test to fail
2018-11-17 12:22:25 +01:00
1656913fbd GIT_SILENT Upgrade Qt5 version requirement to 5.9.0. 2018-11-17 11:18:21 +01:00
beaf20bd4a GIT_SILENT Upgrade ECM and KF5 version requirements for 5.52.0 release. 2018-11-03 12:00:43 +00:00
8ac949d459 Fix minor EBN issues 2018-10-22 19:58:24 +03:00
4c0c6c8d60 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.51.0 release. 2018-10-07 10:07:12 +00:00
f485719012 kimg_rgb: optimize away QRegExp and QString::fromLocal8Bit.
Summary:
The code is even simpler this way.

Found by using heaptrack.

Test Plan: the unittest for rgb still passes.

Reviewers: cfeck

Reviewed By: cfeck

Subscribers: jtamate, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D15890
2018-10-03 00:51:29 +02:00
1db1b94657 [EPS] qWarning -> qCWarning 2018-09-17 11:56:58 +02:00
98c65a438d [EPS] Fix crash at app shutdown (being tried to persist clipboard image)
Summary:
Deny any capabilities when there is no QApp instance.

BUG: 397040

Test Plan:
Untested, as I do not experience the bug on my system and had no time to
invest into trying to.

Reviewers: zccrs, dfaure, pino

Reviewed By: dfaure

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D15405
2018-09-17 11:54:18 +02:00
167967a145 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.50.0 release. 2018-08-31 22:22:12 +00:00
17239a7ea6 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.49.0 release. 2018-08-04 08:43:39 +00:00
118d262bec GIT_SILENT Upgrade ECM and KF5 version requirements for 5.48.0 release. 2018-07-07 21:52:47 +00:00
67a84f459d Use override 2018-06-12 07:01:11 +02:00
de2b942b33 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.47.0 release. 2018-06-02 16:28:21 +00:00
813a7bdddb Remove duplicated mime types from json files
Qt expects a bijection between keys and mime types.
2018-05-25 14:32:11 +03:00
a4d1f4db1d Use override 2018-05-23 08:06:50 +02:00
29d090f078 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.46.0 release. 2018-05-05 12:39:09 +00:00
19f33239e7 [XCF/GIMP loader] Raise maximimum allowed image size to 32767x32767 on 64 bit platforms
The GIMP image loader had a limit to 16K x 16K pixels, because this would
already exhaust the 2 GByte address space limit of 32 bit systems.

Remove this limit on 64 bit systems to allow the full 32K x 32K size.

BUG: 391970

Differential Revision: https://phabricator.kde.org/D12557
2018-05-02 02:10:26 +02:00
4668fbbcdc GIT_SILENT Upgrade ECM and KF5 version requirements for 5.45.0 release. 2018-04-07 07:47:44 +00:00
698ba297d3 We depend against 5.8.0 now 2018-03-27 08:01:04 +02:00
3a9bafdbbe GIT_SILENT Upgrade Qt5 version requirement to 5.8.0. 2018-03-24 13:34:11 +00:00
e5b226e804 Remove not necessary QtCore and co 2018-03-11 13:49:26 +01:00
871d0f976f GIT_SILENT Upgrade ECM and KF5 version requirements for 5.44.0 release. 2018-03-03 09:52:42 +00:00
7aa5333a3f kcoreaddons_add_plugin: remove effectless OBJECT_DEPENDS on json file
The JSON file argument is passed to Q_PLUGIN_METADATA, which is a no-code
macro at the C++ level and only used to note information used by moc
for the generated moc file.

So when the content of the JSON file has changed, this will not change
anything in the preprocessed source file itself. It only has an effect on
the content of the moc file generated based on it, which is either included
and thus already triggers a dependecy or generated by automoc and compiled
separately into the target with the needed dependencies.

It is automoc which needs to properly trigger a recreation of the moc
file when checking the sources (and at least in 3.9 & 10 does),
and this is nothing that can be influenced by dependency rules.
2018-02-23 19:09:18 +01:00
aeabd92eea GIT_SILENT Upgrade ECM and KF5 version requirements for 5.43.0 release. 2018-02-05 08:11:10 +00:00
64e719f329 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.42.0 release. 2018-01-05 23:41:49 +00:00
eef855b146 Remove obsolete reviewboardrc file 2018-01-05 13:24:38 +01:00
04e2ee01cb Set LIBRARY_OUTPUT_DIRECTORY so the autotests can run without the plugins installed
Do this properly by defining a function (inspired by kcoreaddons_add_plugin)
2018-01-05 11:19:18 +01:00
7f2c44add4 Use brace-initializer instead of nullptr in returning 0-QFlags
Differential Revision: https://phabricator.kde.org/D9182
2017-12-05 19:34:30 +01:00
ca67a8f342 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.41.0 release. 2017-12-02 10:14:43 +00:00
23759d0aef GIT_SILENT Upgrade ECM and KF5 version requirements for 5.40.0 release. 2017-11-04 21:43:30 +00:00
bfc02ddfe3 Add .arcconfig 2017-10-15 20:24:32 +02:00
a65b504a44 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.39.0 release. 2017-10-07 11:15:41 +00:00
78aeee7d36 GIT_SILENT Upgrade to ECM 5.38 and make tests run uninstalled 2017-08-14 15:15:23 +02:00
a2d0e43889 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.37.0 release. 2017-08-06 16:42:02 +00:00
e0bd85cbc3 GIT_SILENT Upgrade Qt5 version requirement to 5.7.0. 2017-08-06 16:02:31 +00:00
f16485a872 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.36.0 release. 2017-06-30 10:34:05 +00:00
e3afec9e75 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.35.0 release. 2017-06-03 09:02:51 +00:00
b040cf0f96 Use Q_FALLTHROUGH 2017-06-02 07:52:48 +02:00
7be2757c36 GIT_SILENT Upgrade ECM and KF5 version requirements for 5.34.0 release. 2017-05-06 08:37:02 +00:00
a8562a8471 Upgrade ECM and KF5 version requirements for 5.33.0 release. 2017-04-01 17:33:21 +00:00
252b639638 Upgrade ECM and KF5 version requirements for 5.32.0 release. 2017-03-03 12:56:29 +00:00
b0c8c40dec Upgrade ECM and KF5 version requirements for 5.31.0 release. 2017-02-04 18:20:08 +00:00
1afb7681b7 Upgrade Qt5 version requirement to 5.6.0. 2017-02-03 23:44:22 +00:00
740fe5df0e Use nullptr everywhere
Differential Revision: https://phabricator.kde.org/D3987
2017-01-16 09:44:17 +01:00
e4aa067bd2 Upgrade ECM and KF5 version requirements for 5.30.0 release. 2017-01-08 15:31:27 +00:00
9f77675d91 Require CMake 3.0, as discussed on kde-frameworks-devel 2017-01-03 13:24:41 +01:00
8a8ef69b7c Add FreeBSD to metainfo.yaml.
REVIEW: 129472
2016-12-06 19:06:09 +01:00
95e14f8f60 Upgrade ECM and KF5 version requirements for 5.29.0 release. 2016-12-03 10:23:58 +00:00
1fca298a20 Upgrade ECM and KF5 version requirements for 5.28.0 release. 2016-11-05 11:02:19 +00:00
09b1ac5a16 imageformats/kra.h - overrides for KraPlugin capabilities() and create() 2016-10-16 11:50:18 -04:00
7f852d241a Upgrade ECM and KF5 version requirements for 5.27.0 release. 2016-10-02 08:00:57 +00:00
5fdcdff6e3 Drop obsolete version check
Frameworks already require Qt 5.5.0.

REVIEW: 128989
2016-09-23 00:51:41 +02:00
60b5866b77 Upgrade ECM and KF5 version requirements for 5.26.0 release. 2016-09-05 22:36:08 +00:00
f42c1b7423 Upgrade ECM and KF5 version requirements for 5.25.0 release. 2016-08-06 08:34:21 +00:00
ede3a4a3f3 Qt 5.5.0 is now required, as discussed on kde-frameworks-devel 2016-07-24 13:20:33 +00:00
1d2aed54fa Upgrade ECM and KF5 version requirements for 5.24.0 release. 2016-07-02 08:48:36 +00:00
b019a2a57e Promote Android support 2016-06-18 00:04:19 +02:00
a4de98aa4f Silence CMake policy CMP0063 warning
...by adding the NO_POLICY_SCOPE flag as recommended by ECM's
documentation.

REVIEW: 128139
2016-06-09 17:57:09 +02:00
172c494cff remove extra ';' 2016-06-09 10:57:48 +02:00
298 changed files with 14471 additions and 3127 deletions

3
.git-blame-ignore-revs Normal file
View File

@ -0,0 +1,3 @@
#clang-format/tidy
1169859b07f25c865ee0bfc2a7dc97a431651776
eaca33bec8b19498c3621fc3a20a8c55a2812462

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
autotests/read/raw/RAW_KODAK_C330_FORMAT_NONE_YRGB.raw binary

28
.gitignore vendored Normal file
View File

@ -0,0 +1,28 @@
# Ignore the following files
*~
*.[oa]
*.diff
*.kate-swp
*.kdev4
.kdev_include_paths
*.kdevelop.pcs
*.moc
*.moc.cpp
*.orig
*.user
.*.swp
.swp.*
Doxyfile
Makefile
avail
random_seed
/build*/
CMakeLists.txt.user*
*.unc-backup*
.cmake/
/.clang-format
/compile_commands.json
.clangd
.idea
/cmake-build*
.cache

8
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,8 @@
# SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: CC0-1.0
include:
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux-qt6.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/android-qt6.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd-qt6.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/windows-qt6.yml

9
.kde-ci.yml Normal file
View File

@ -0,0 +1,9 @@
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' ]

View File

@ -1,5 +0,0 @@
REVIEWBOARD_URL = "https://git.reviewboard.kde.org"
REPOSITORY = 'git://anongit.kde.org/kimageformats'
BRANCH = 'master'
TARGET_GROUPS = 'kdeframeworks'
TARGET_PEOPLE = 'alexmerry'

View File

@ -1,27 +1,29 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.16)
project(KImageFormats)
include(FeatureSummary)
find_package(ECM 5.23.0 NO_MODULE)
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules")
find_package(ECM 5.240.0 NO_MODULE)
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)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
set(CMAKE_MODULE_PATH ${KImageFormats_SOURCE_DIR}/cmake/find-modules ${ECM_MODULE_PATH})
include(KDEInstallDirs)
include(KDEFrameworkCompilerSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(KDEGitCommitHooks)
include(ECMDeprecationSettings)
include(CheckIncludeFiles)
include(FindPkgConfig)
set(REQUIRED_QT_VERSION 5.4.0)
find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
set(REQUIRED_QT_VERSION 6.5.0)
find_package(Qt6Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
find_package(KF5Archive)
set_package_properties(KF5Archive PROPERTIES
find_package(KF6Archive)
set_package_properties(KF6Archive PROPERTIES
TYPE OPTIONAL
PURPOSE "Required for the QImage plugin for Krita and OpenRaster images"
)
@ -30,22 +32,59 @@ set_package_properties(KF5Archive PROPERTIES
# this available in PATH
set(BUILD_EPS_PLUGIN FALSE)
if (UNIX)
find_package(Qt5PrintSupport ${REQUIRED_QT_VERSION} NO_MODULE)
set_package_properties(Qt5PrintSupport PROPERTIES
find_package(Qt6PrintSupport ${REQUIRED_QT_VERSION} NO_MODULE)
set_package_properties(Qt6PrintSupport PROPERTIES
PURPOSE "Required for the QImage plugin for EPS images"
TYPE OPTIONAL
)
if (Qt5PrintSupport_FOUND)
if (TARGET Qt6::PrintSupport)
set(BUILD_EPS_PLUGIN TRUE)
endif()
endif()
find_package(OpenEXR)
find_package(OpenEXR 3.0 CONFIG QUIET)
if(NOT OpenEXR_FOUND)
find_package(OpenEXR)
endif()
set_package_properties(OpenEXR PROPERTIES
TYPE OPTIONAL
PURPOSE "Required for the QImage plugin for OpenEXR images"
)
find_package(libavif 0.8.2 CONFIG QUIET)
if(NOT libavif_FOUND)
find_package(libavif 1 CONFIG)
endif()
set_package_properties(libavif PROPERTIES
TYPE OPTIONAL
PURPOSE "Required for the QImage plugin for AVIF images"
)
option(KIMAGEFORMATS_HEIF "Enable plugin for HEIF format" OFF)
if(KIMAGEFORMATS_HEIF)
pkg_check_modules(LibHeif IMPORTED_TARGET libheif>=1.10.0)
endif()
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)
if(KIMAGEFORMATS_JXL)
pkg_check_modules(LibJXL IMPORTED_TARGET libjxl>=0.7.0)
pkg_check_modules(LibJXLThreads IMPORTED_TARGET libjxl_threads>=0.7.0)
endif()
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 6.4
KF 5.102
)
add_subdirectory(src)
if (BUILD_TESTING)
add_subdirectory(autotests)
@ -53,3 +92,5 @@ if (BUILD_TESTING)
endif()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)

View File

@ -1,510 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations
below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it
becomes a de-facto standard. To achieve this, non-free programs must
be allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control
compilation and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least
three years, to give the same user the materials specified in
Subsection 6a, above, for a charge no more than the cost of
performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. 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 not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply, and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License
may add an explicit geographical distribution limitation excluding those
countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the 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
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms
of the ordinary General Public License).
To apply these terms, attach the following notices to the library.
It is safest to attach them to the start of each source file to most
effectively convey the exclusion of warranty; and each file should
have at least the "copyright" line and a pointer to where the full
notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or
your school, if any, to sign a "copyright disclaimer" for the library,
if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James
Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

121
LICENSES/CC0-1.0.txt Normal file
View File

@ -0,0 +1,121 @@
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.

View File

@ -0,0 +1,446 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
[This is the first released version of the library GPL. It is numbered 2 because
it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public Licenses are intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users.
This license, the Library General Public License, applies to some specially
designated Free Software Foundation software, and to any other libraries whose
authors decide to use it. You can use it for your libraries, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish), that you receive source code or can get it if you want it, that you
can change the software or use pieces of it in new free programs; and that
you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to
deny you these rights or to ask you to surrender the rights. These restrictions
translate to certain responsibilities for you if you distribute copies of
the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis or for
a fee, you must give the recipients all the rights that we gave you. You must
make sure that they, too, receive or can get the source code. If you link
a program with the library, you must provide complete object files to the
recipients so that they can relink them with the library, after making changes
to the library and recompiling it. And you must show them these terms so they
know their rights.
Our method of protecting your rights has two steps: (1) copyright the library,
and (2) offer you this license which gives you legal permission to copy, distribute
and/or modify the library.
Also, for each distributor's protection, we want to make certain that everyone
understands that there is no warranty for this free library. If the library
is modified by someone else and passed on, we want its recipients to know
that what they have is not the original version, so that any problems introduced
by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We
wish to avoid the danger that companies distributing free software will individually
obtain patent licenses, thus in effect transforming the program into proprietary
software. To prevent this, we have made it clear that any patent must be licensed
for everyone's free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary GNU
General Public License, which was designed for utility programs. This license,
the GNU Library General Public License, applies to certain designated libraries.
This license is quite different from the ordinary one; be sure to read it
in full, and don't assume that anything in it is the same as in the ordinary
license.
The reason we have a separate public license for some libraries is that they
blur the distinction we usually make between modifying or adding to a program
and simply using it. Linking a program with a library, without changing the
library, is in some sense simply using the library, and is analogous to running
a utility program or application program. However, in a textual and legal
sense, the linked executable is a combined work, a derivative of the original
library, and the ordinary General Public License treats it as such.
Because of this blurred distinction, using the ordinary General Public License
for libraries did not effectively promote software sharing, because most developers
did not use the libraries. We concluded that weaker conditions might promote
sharing better.
However, unrestricted linking of non-free programs would deprive the users
of those programs of all benefit from the free status of the libraries themselves.
This Library General Public License is intended to permit developers of non-free
programs to use free libraries, while preserving your freedom as a user of
such programs to change the free libraries that are incorporated in them.
(We have not seen how to achieve this as regards changes in header files,
but we have achieved it as regards changes in the actual functions of the
Library.) The hope is that this will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and modification
follow. Pay close attention to the difference between a "work based on the
library" and a "work that uses the library". The former contains code derived
from the library, while the latter only works together with the library.
Note that it is possible for a library to be covered by the ordinary General
Public License rather than by this special one.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which contains a
notice placed by the copyright holder or other authorized party saying it
may be distributed under the terms of this Library General Public License
(also called "this License"). Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data prepared
so as to be conveniently linked with application programs (which use some
of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which has
been distributed under these terms. A "work based on the Library" means either
the Library or any derivative work under copyright law: that is to say, a
work containing the Library or a portion of it, either verbatim or with modifications
and/or translated straightforwardly into another language. (Hereinafter, translation
is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making modifications
to it. For a library, complete source code means all the source code for all
modules it contains, plus any associated interface definition files, plus
the scripts used to control compilation and installation of the library.
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running a program
using the Library is not restricted, and output from such a program is covered
only if its contents constitute a work based on the Library (independent of
the use of the Library in a tool for writing it). Whether that is true depends
on what the Library does and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and disclaimer
of warranty; keep intact all the notices that refer to this License and to
the absence of any warranty; and distribute a copy of this License along with
the Library.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of it,
thus forming a work based on the Library, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all
of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices stating that
you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no charge to all
third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a table of
data to be supplied by an application program that uses the facility, other
than as an argument passed when the facility is invoked, then you must make
a good faith effort to ensure that, in the event an application does not supply
such function or table, the facility still operates, and performs whatever
part of its purpose remains meaningful.
(For example, a function in a library to compute square roots has a purpose
that is entirely well-defined independent of the application. Therefore, Subsection
2d requires that any application-supplied function or table used by this function
must be optional: if the application does not supply it, the square root function
must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Library, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Library, the distribution of the whole must be
on the terms of this License, whose permissions for other licensees extend
to the entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise
the right to control the distribution of derivative or collective works based
on the Library.
In addition, mere aggregation of another work not based on the Library with
the Library (or with a work based on the Library) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License.
3. You may opt to apply the terms of the ordinary GNU General Public License
instead of this License to a given copy of the Library. To do this, you must
alter all the notices that refer to this License, so that they refer to the
ordinary GNU General Public License, version 2, instead of to this License.
(If a newer version than version 2 of the ordinary GNU General Public License
has appeared, then you can specify that version instead if you wish.) Do not
make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that copy,
so the ordinary GNU General Public License applies to all subsequent copies
and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the Library
into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of
it, under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you accompany it with the complete corresponding
machine-readable source code, which must be distributed under the terms of
Sections 1 and 2 above on a medium customarily used for software interchange.
If distribution of object code is made by offering access to copy from a designated
place, then offering equivalent access to copy the source code from the same
place satisfies the requirement to distribute the source code, even though
third parties are not compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the Library, but
is designed to work with the Library by being compiled or linked with it,
is called a "work that uses the Library". Such a work, in isolation, is not
a derivative work of the Library, and therefore falls outside the scope of
this License.
However, linking a "work that uses the Library" with the Library creates an
executable that is a derivative of the Library (because it contains portions
of the Library), rather than a "work that uses the library". The executable
is therefore covered by this License. Section 6 states terms for distribution
of such executables.
When a "work that uses the Library" uses material from a header file that
is part of the Library, the object code for the work may be a derivative work
of the Library even though the source code is not. Whether this is true is
especially significant if the work can be linked without the Library, or if
the work is itself a library. The threshold for this to be true is not precisely
defined by law.
If such an object file uses only numerical parameters, data structure layouts
and accessors, and small macros and small inline functions (ten lines or less
in length), then the use of the object file is unrestricted, regardless of
whether it is legally a derivative work. (Executables containing this object
code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute
the object code for the work under the terms of Section 6. Any executables
containing that work also fall under Section 6, whether or not they are linked
directly with the Library itself.
6. As an exception to the Sections above, you may also compile or link a "work
that uses the Library" with the Library to produce a work containing portions
of the Library, and distribute that work under terms of your choice, provided
that the terms permit modification of the work for the customer's own use
and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the Library
is used in it and that the Library and its use are covered by this License.
You must supply a copy of this License. If the work during execution displays
copyright notices, you must include the copyright notice for the Library among
them, as well as a reference directing the user to the copy of this License.
Also, you must do one of these things:
a) Accompany the work with the complete corresponding machine-readable source
code for the Library including whatever changes were used in the work (which
must be distributed under Sections 1 and 2 above); and, if the work is an
executable linked with the Library, with the complete machine-readable "work
that uses the Library", as object code and/or source code, so that the user
can modify the Library and then relink to produce a modified executable containing
the modified Library. (It is understood that the user who changes the contents
of definitions files in the Library will not necessarily be able to recompile
the application to use the modified definitions.)
b) Accompany the work with a written offer, valid for at least three years,
to give the same user the materials specified in Subsection 6a, above, for
a charge no more than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy from a designated
place, offer equivalent access to copy the above specified materials from
the same place.
d) Verify that the user has already received a copy of these materials or
that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library" must
include any data and utility programs needed for reproducing the executable
from it. However, as a special exception, the source code distributed need
not include anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the operating
system on which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license restrictions of
other proprietary libraries that do not normally accompany the operating system.
Such a contradiction means you cannot use both them and the Library together
in an executable that you distribute.
7. 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 not covered by
this License, and distribute such a combined library, provided that the separate
distribution of the work based on the Library and of the other library facilities
is otherwise permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities. This must be distributed
under the terms of the Sections above.
b) Give prominent notice with the combined library of the fact that part of
it is a work based on the Library, and explaining where to find the accompanying
uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the Library
except as expressly provided under this License. Any attempt otherwise to
copy, modify, sublicense, link with, or distribute the Library is void, and
will automatically terminate your rights under this License. However, parties
who have received copies, or rights, from you under this License will not
have their licenses terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Library or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the Library
(or any work based on the Library), you indicate your acceptance of this License
to do so, and all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library),
the recipient automatically receives a license from the original licensor
to copy, distribute, link with or modify the Library subject to these terms
and conditions. You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for enforcing
compliance by third parties to this License.
11. If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of
this License. If you cannot distribute so as to satisfy simultaneously your
obligations under this License and any other pertinent obligations, then as
a consequence you may not distribute the Library at all. For example, if a
patent license would not permit royalty-free redistribution of the Library
by all those who receive copies directly or indirectly through you, then the
only way you could satisfy both it and this License would be to refrain entirely
from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims;
this section has the sole purpose of protecting the integrity of the free
software distribution system which is implemented by public license practices.
Many people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Library under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this
License incorporates the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions of
the Library 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 specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that version
or of any later version published by the Free Software Foundation. If the
Library does not specify a license version number, you may choose any version
ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs
whose distribution conditions are incompatible with these, write to the author
to ask for permission. For software which is copyrighted by the Free Software
Foundation, write to the Free Software Foundation; we sometimes make exceptions
for this. Our decision will be guided by the two goals of preserving the free
status of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible
use to the public, we recommend making it free software that everyone can
redistribute and change. You can do so by permitting redistribution under
these terms (or, alternatively, under the terms of the ordinary General Public
License).
To apply these terms, attach the following notices to the library. It is safest
to attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the "copyright"
line and a pointer to where the full notice is found.
one line to give the library's name and an idea of what it does.
Copyright (C) year name of author
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Library General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
details.
You should have received a copy of the GNU Library General Public License
along with this library; if not, write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your school,
if any, to sign a "copyright disclaimer" for the library, if necessary. Here
is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
signature of Ty Coon, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

467
LICENSES/LGPL-2.1-only.txt Normal file
View File

@ -0,0 +1,467 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts as the
successor of the GNU Library Public License, version 2, hence the version
number 2.1.]
Preamble
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public Licenses are intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users.
This license, the Lesser General Public License, applies to some specially
designated software packages--typically libraries--of the Free Software Foundation
and other authors who decide to use it. You can use it too, but we suggest
you first think carefully about whether this license or the ordinary General
Public License is the better strategy to use in any particular case, based
on the explanations below.
When we speak of free software, we are referring to freedom of use, not price.
Our General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish); that you receive source code or can get it if you want it; that you
can change the software and use pieces of it in new free programs; and that
you are informed that you can do these things.
To protect your rights, we need to make restrictions that forbid distributors
to deny you these rights or to ask you to surrender these rights. These restrictions
translate to certain responsibilities for you if you distribute copies of
the library or if you modify it.
For example, if you distribute copies of the library, whether gratis or for
a fee, you must give the recipients all the rights that we gave you. You must
make sure that they, too, receive or can get the source code. If you link
other code with the library, you must provide complete object files to the
recipients, so that they can relink them with the library after making changes
to the library and recompiling it. And you must show them these terms so they
know their rights.
We protect your rights with a two-step method: (1) we copyright the library,
and (2) we offer you this license, which gives you legal permission to copy,
distribute and/or modify the library.
To protect each distributor, we want to make it very clear that there is no
warranty for the free library. Also, if the library is modified by someone
else and passed on, the recipients should know that what they have is not
the original version, so that the original author's reputation will not be
affected by problems that might be introduced by others.
Finally, software patents pose a constant threat to the existence of any free
program. We wish to make sure that a company cannot effectively restrict the
users of a free program by obtaining a restrictive license from a patent holder.
Therefore, we insist that any patent license obtained for a version of the
library must be consistent with the full freedom of use specified in this
license.
Most GNU software, including some libraries, is covered by the ordinary GNU
General Public License. This license, the GNU Lesser General Public License,
applies to certain designated libraries, and is quite different from the ordinary
General Public License. We use this license for certain libraries in order
to permit linking those libraries into non-free programs.
When a program is linked with a library, whether statically or using a shared
library, the combination of the two is legally speaking a combined work, a
derivative of the original library. The ordinary General Public License therefore
permits such linking only if the entire combination fits its criteria of freedom.
The Lesser General Public License permits more lax criteria for linking other
code with the library.
We call this license the "Lesser" General Public License because it does Less
to protect the user's freedom than the ordinary General Public License. It
also provides other free software developers Less of an advantage over competing
non-free programs. These disadvantages are the reason we use the ordinary
General Public License for many libraries. However, the Lesser license provides
advantages in certain special circumstances.
For example, on rare occasions, there may be a special need to encourage the
widest possible use of a certain library, so that it becomes a de-facto standard.
To achieve this, non-free programs must be allowed to use the library. A more
frequent case is that a free library does the same job as widely used non-free
libraries. In this case, there is little to gain by limiting the free library
to free software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free programs
enables a greater number of people to use a large body of free software. For
example, permission to use the GNU C Library in non-free programs enables
many more people to use the whole GNU operating system, as well as its variant,
the GNU/Linux operating system.
Although the Lesser General Public License is Less protective of the users'
freedom, it does ensure that the user of a program that is linked with the
Library has the freedom and the wherewithal to run that program using a modified
version of the Library.
The precise terms and conditions for copying, distribution and modification
follow. Pay close attention to the difference between a "work based on the
library" and a "work that uses the library". The former contains code derived
from the library, whereas the latter must be combined with the library in
order to run.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other program
which contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Lesser General
Public License (also called "this License"). Each licensee is addressed as
"you".
A "library" means a collection of software functions and/or data prepared
so as to be conveniently linked with application programs (which use some
of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which has
been distributed under these terms. A "work based on the Library" means either
the Library or any derivative work under copyright law: that is to say, a
work containing the Library or a portion of it, either verbatim or with modifications
and/or translated straightforwardly into another language. (Hereinafter, translation
is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making modifications
to it. For a library, complete source code means all the source code for all
modules it contains, plus any associated interface definition files, plus
the scripts used to control compilation and installation of the library.
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running a program
using the Library is not restricted, and output from such a program is covered
only if its contents constitute a work based on the Library (independent of
the use of the Library in a tool for writing it). Whether that is true depends
on what the Library does and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and disclaimer
of warranty; keep intact all the notices that refer to this License and to
the absence of any warranty; and distribute a copy of this License along with
the Library.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of it,
thus forming a work based on the Library, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all
of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices stating that
you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no charge to all
third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a table of
data to be supplied by an application program that uses the facility, other
than as an argument passed when the facility is invoked, then you must make
a good faith effort to ensure that, in the event an application does not supply
such function or table, the facility still operates, and performs whatever
part of its purpose remains meaningful.
(For example, a function in a library to compute square roots has a purpose
that is entirely well-defined independent of the application. Therefore, Subsection
2d requires that any application-supplied function or table used by this function
must be optional: if the application does not supply it, the square root function
must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Library, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Library, the distribution of the whole must be
on the terms of this License, whose permissions for other licensees extend
to the entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise
the right to control the distribution of derivative or collective works based
on the Library.
In addition, mere aggregation of another work not based on the Library with
the Library (or with a work based on the Library) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License.
3. You may opt to apply the terms of the ordinary GNU General Public License
instead of this License to a given copy of the Library. To do this, you must
alter all the notices that refer to this License, so that they refer to the
ordinary GNU General Public License, version 2, instead of to this License.
(If a newer version than version 2 of the ordinary GNU General Public License
has appeared, then you can specify that version instead if you wish.) Do not
make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that copy,
so the ordinary GNU General Public License applies to all subsequent copies
and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the Library
into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of
it, under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you accompany it with the complete corresponding
machine-readable source code, which must be distributed under the terms of
Sections 1 and 2 above on a medium customarily used for software interchange.
If distribution of object code is made by offering access to copy from a designated
place, then offering equivalent access to copy the source code from the same
place satisfies the requirement to distribute the source code, even though
third parties are not compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the Library, but
is designed to work with the Library by being compiled or linked with it,
is called a "work that uses the Library". Such a work, in isolation, is not
a derivative work of the Library, and therefore falls outside the scope of
this License.
However, linking a "work that uses the Library" with the Library creates an
executable that is a derivative of the Library (because it contains portions
of the Library), rather than a "work that uses the library". The executable
is therefore covered by this License. Section 6 states terms for distribution
of such executables.
When a "work that uses the Library" uses material from a header file that
is part of the Library, the object code for the work may be a derivative work
of the Library even though the source code is not. Whether this is true is
especially significant if the work can be linked without the Library, or if
the work is itself a library. The threshold for this to be true is not precisely
defined by law.
If such an object file uses only numerical parameters, data structure layouts
and accessors, and small macros and small inline functions (ten lines or less
in length), then the use of the object file is unrestricted, regardless of
whether it is legally a derivative work. (Executables containing this object
code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute
the object code for the work under the terms of Section 6. Any executables
containing that work also fall under Section 6, whether or not they are linked
directly with the Library itself.
6. As an exception to the Sections above, you may also combine or link a "work
that uses the Library" with the Library to produce a work containing portions
of the Library, and distribute that work under terms of your choice, provided
that the terms permit modification of the work for the customer's own use
and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the Library
is used in it and that the Library and its use are covered by this License.
You must supply a copy of this License. If the work during execution displays
copyright notices, you must include the copyright notice for the Library among
them, as well as a reference directing the user to the copy of this License.
Also, you must do one of these things:
a) Accompany the work with the complete corresponding machine-readable source
code for the Library including whatever changes were used in the work (which
must be distributed under Sections 1 and 2 above); and, if the work is an
executable linked with the Library, with the complete machine-readable "work
that uses the Library", as object code and/or source code, so that the user
can modify the Library and then relink to produce a modified executable containing
the modified Library. (It is understood that the user who changes the contents
of definitions files in the Library will not necessarily be able to recompile
the application to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the Library. A
suitable mechanism is one that (1) uses at run time a copy of the library
already present on the user's computer system, rather than copying library
functions into the executable, and (2) will operate properly with a modified
version of the library, if the user installs one, as long as the modified
version is interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least three years,
to give the same user the materials specified in Subsection 6a, above, for
a charge no more than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy from a designated
place, offer equivalent access to copy the above specified materials from
the same place.
e) Verify that the user has already received a copy of these materials or
that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library" must
include any data and utility programs needed for reproducing the executable
from it. However, as a special exception, the materials to be distributed
need not include anything that is normally distributed (in either source or
binary form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component itself
accompanies the executable.
It may happen that this requirement contradicts the license restrictions of
other proprietary libraries that do not normally accompany the operating system.
Such a contradiction means you cannot use both them and the Library together
in an executable that you distribute.
7. 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 not covered by
this License, and distribute such a combined library, provided that the separate
distribution of the work based on the Library and of the other library facilities
is otherwise permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities. This must be distributed
under the terms of the Sections above.
b) Give prominent notice with the combined library of the fact that part of
it is a work based on the Library, and explaining where to find the accompanying
uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the Library
except as expressly provided under this License. Any attempt otherwise to
copy, modify, sublicense, link with, or distribute the Library is void, and
will automatically terminate your rights under this License. However, parties
who have received copies, or rights, from you under this License will not
have their licenses terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Library or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the Library
(or any work based on the Library), you indicate your acceptance of this License
to do so, and all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library),
the recipient automatically receives a license from the original licensor
to copy, distribute, link with or modify the Library subject to these terms
and conditions. You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for enforcing
compliance by third parties with this License.
11. If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of
this License. If you cannot distribute so as to satisfy simultaneously your
obligations under this License and any other pertinent obligations, then as
a consequence you may not distribute the Library at all. For example, if a
patent license would not permit royalty-free redistribution of the Library
by all those who receive copies directly or indirectly through you, then the
only way you could satisfy both it and this License would be to refrain entirely
from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims;
this section has the sole purpose of protecting the integrity of the free
software distribution system which is implemented by public license practices.
Many people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Library under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this
License incorporates the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions of
the 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 specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that version
or of any later version published by the Free Software Foundation. If the
Library does not specify a license version number, you may choose any version
ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs
whose distribution conditions are incompatible with these, write to the author
to ask for permission. For software which is copyrighted by the Free Software
Foundation, write to the Free Software Foundation; we sometimes make exceptions
for this. Our decision will be guided by the two goals of preserving the free
status of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible
use to the public, we recommend making it free software that everyone can
redistribute and change. You can do so by permitting redistribution under
these terms (or, alternatively, under the terms of the ordinary General Public
License).
To apply these terms, attach the following notices to the library. It is safest
to attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the "copyright"
line and a pointer to where the full notice is found.
< one line to give the library's name and an idea of what it does. >
Copyright (C) < year > < name of author >
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2.1 of the License, or (at your option)
any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License along
with this library; if not, write to the Free Software Foundation, Inc., 51
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information
on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your school,
if any, to sign a "copyright disclaimer" for the library, if necessary. Here
is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
< signature of Ty Coon > , 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -0,0 +1,468 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts as the
successor of the GNU Library Public License, version 2, hence the version
number 2.1.]
Preamble
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public Licenses are intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users.
This license, the Lesser General Public License, applies to some specially
designated software packages--typically libraries--of the Free Software Foundation
and other authors who decide to use it. You can use it too, but we suggest
you first think carefully about whether this license or the ordinary General
Public License is the better strategy to use in any particular case, based
on the explanations below.
When we speak of free software, we are referring to freedom of use, not price.
Our General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish); that you receive source code or can get it if you want it; that you
can change the software and use pieces of it in new free programs; and that
you are informed that you can do these things.
To protect your rights, we need to make restrictions that forbid distributors
to deny you these rights or to ask you to surrender these rights. These restrictions
translate to certain responsibilities for you if you distribute copies of
the library or if you modify it.
For example, if you distribute copies of the library, whether gratis or for
a fee, you must give the recipients all the rights that we gave you. You must
make sure that they, too, receive or can get the source code. If you link
other code with the library, you must provide complete object files to the
recipients, so that they can relink them with the library after making changes
to the library and recompiling it. And you must show them these terms so they
know their rights.
We protect your rights with a two-step method: (1) we copyright the library,
and (2) we offer you this license, which gives you legal permission to copy,
distribute and/or modify the library.
To protect each distributor, we want to make it very clear that there is no
warranty for the free library. Also, if the library is modified by someone
else and passed on, the recipients should know that what they have is not
the original version, so that the original author's reputation will not be
affected by problems that might be introduced by others.
Finally, software patents pose a constant threat to the existence of any free
program. We wish to make sure that a company cannot effectively restrict the
users of a free program by obtaining a restrictive license from a patent holder.
Therefore, we insist that any patent license obtained for a version of the
library must be consistent with the full freedom of use specified in this
license.
Most GNU software, including some libraries, is covered by the ordinary GNU
General Public License. This license, the GNU Lesser General Public License,
applies to certain designated libraries, and is quite different from the ordinary
General Public License. We use this license for certain libraries in order
to permit linking those libraries into non-free programs.
When a program is linked with a library, whether statically or using a shared
library, the combination of the two is legally speaking a combined work, a
derivative of the original library. The ordinary General Public License therefore
permits such linking only if the entire combination fits its criteria of freedom.
The Lesser General Public License permits more lax criteria for linking other
code with the library.
We call this license the "Lesser" General Public License because it does Less
to protect the user's freedom than the ordinary General Public License. It
also provides other free software developers Less of an advantage over competing
non-free programs. These disadvantages are the reason we use the ordinary
General Public License for many libraries. However, the Lesser license provides
advantages in certain special circumstances.
For example, on rare occasions, there may be a special need to encourage the
widest possible use of a certain library, so that it becomes a de-facto standard.
To achieve this, non-free programs must be allowed to use the library. A more
frequent case is that a free library does the same job as widely used non-free
libraries. In this case, there is little to gain by limiting the free library
to free software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free programs
enables a greater number of people to use a large body of free software. For
example, permission to use the GNU C Library in non-free programs enables
many more people to use the whole GNU operating system, as well as its variant,
the GNU/Linux operating system.
Although the Lesser General Public License is Less protective of the users'
freedom, it does ensure that the user of a program that is linked with the
Library has the freedom and the wherewithal to run that program using a modified
version of the Library.
The precise terms and conditions for copying, distribution and modification
follow. Pay close attention to the difference between a "work based on the
library" and a "work that uses the library". The former contains code derived
from the library, whereas the latter must be combined with the library in
order to run.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other program
which contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Lesser General
Public License (also called "this License"). Each licensee is addressed as
"you".
A "library" means a collection of software functions and/or data prepared
so as to be conveniently linked with application programs (which use some
of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which has
been distributed under these terms. A "work based on the Library" means either
the Library or any derivative work under copyright law: that is to say, a
work containing the Library or a portion of it, either verbatim or with modifications
and/or translated straightforwardly into another language. (Hereinafter, translation
is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making modifications
to it. For a library, complete source code means all the source code for all
modules it contains, plus any associated interface definition files, plus
the scripts used to control compilation and installation of the library.
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running a program
using the Library is not restricted, and output from such a program is covered
only if its contents constitute a work based on the Library (independent of
the use of the Library in a tool for writing it). Whether that is true depends
on what the Library does and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and disclaimer
of warranty; keep intact all the notices that refer to this License and to
the absence of any warranty; and distribute a copy of this License along with
the Library.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of it,
thus forming a work based on the Library, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all
of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices stating that
you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no charge to all
third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a table of
data to be supplied by an application program that uses the facility, other
than as an argument passed when the facility is invoked, then you must make
a good faith effort to ensure that, in the event an application does not supply
such function or table, the facility still operates, and performs whatever
part of its purpose remains meaningful.
(For example, a function in a library to compute square roots has a purpose
that is entirely well-defined independent of the application. Therefore, Subsection
2d requires that any application-supplied function or table used by this function
must be optional: if the application does not supply it, the square root function
must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Library, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Library, the distribution of the whole must be
on the terms of this License, whose permissions for other licensees extend
to the entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise
the right to control the distribution of derivative or collective works based
on the Library.
In addition, mere aggregation of another work not based on the Library with
the Library (or with a work based on the Library) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License.
3. You may opt to apply the terms of the ordinary GNU General Public License
instead of this License to a given copy of the Library. To do this, you must
alter all the notices that refer to this License, so that they refer to the
ordinary GNU General Public License, version 2, instead of to this License.
(If a newer version than version 2 of the ordinary GNU General Public License
has appeared, then you can specify that version instead if you wish.) Do not
make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that copy,
so the ordinary GNU General Public License applies to all subsequent copies
and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the Library
into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of
it, under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you accompany it with the complete corresponding
machine-readable source code, which must be distributed under the terms of
Sections 1 and 2 above on a medium customarily used for software interchange.
If distribution of object code is made by offering access to copy from a designated
place, then offering equivalent access to copy the source code from the same
place satisfies the requirement to distribute the source code, even though
third parties are not compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the Library, but
is designed to work with the Library by being compiled or linked with it,
is called a "work that uses the Library". Such a work, in isolation, is not
a derivative work of the Library, and therefore falls outside the scope of
this License.
However, linking a "work that uses the Library" with the Library creates an
executable that is a derivative of the Library (because it contains portions
of the Library), rather than a "work that uses the library". The executable
is therefore covered by this License. Section 6 states terms for distribution
of such executables.
When a "work that uses the Library" uses material from a header file that
is part of the Library, the object code for the work may be a derivative work
of the Library even though the source code is not. Whether this is true is
especially significant if the work can be linked without the Library, or if
the work is itself a library. The threshold for this to be true is not precisely
defined by law.
If such an object file uses only numerical parameters, data structure layouts
and accessors, and small macros and small inline functions (ten lines or less
in length), then the use of the object file is unrestricted, regardless of
whether it is legally a derivative work. (Executables containing this object
code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute
the object code for the work under the terms of Section 6. Any executables
containing that work also fall under Section 6, whether or not they are linked
directly with the Library itself.
6. As an exception to the Sections above, you may also combine or link a "work
that uses the Library" with the Library to produce a work containing portions
of the Library, and distribute that work under terms of your choice, provided
that the terms permit modification of the work for the customer's own use
and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the Library
is used in it and that the Library and its use are covered by this License.
You must supply a copy of this License. If the work during execution displays
copyright notices, you must include the copyright notice for the Library among
them, as well as a reference directing the user to the copy of this License.
Also, you must do one of these things:
a) Accompany the work with the complete corresponding machine-readable source
code for the Library including whatever changes were used in the work (which
must be distributed under Sections 1 and 2 above); and, if the work is an
executable linked with the Library, with the complete machine-readable "work
that uses the Library", as object code and/or source code, so that the user
can modify the Library and then relink to produce a modified executable containing
the modified Library. (It is understood that the user who changes the contents
of definitions files in the Library will not necessarily be able to recompile
the application to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the Library. A
suitable mechanism is one that (1) uses at run time a copy of the library
already present on the user's computer system, rather than copying library
functions into the executable, and (2) will operate properly with a modified
version of the library, if the user installs one, as long as the modified
version is interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least three years,
to give the same user the materials specified in Subsection 6a, above, for
a charge no more than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy from a designated
place, offer equivalent access to copy the above specified materials from
the same place.
e) Verify that the user has already received a copy of these materials or
that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library" must
include any data and utility programs needed for reproducing the executable
from it. However, as a special exception, the materials to be distributed
need not include anything that is normally distributed (in either source or
binary form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component itself
accompanies the executable.
It may happen that this requirement contradicts the license restrictions of
other proprietary libraries that do not normally accompany the operating system.
Such a contradiction means you cannot use both them and the Library together
in an executable that you distribute.
7. 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 not covered by
this License, and distribute such a combined library, provided that the separate
distribution of the work based on the Library and of the other library facilities
is otherwise permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities. This must be distributed
under the terms of the Sections above.
b) Give prominent notice with the combined library of the fact that part of
it is a work based on the Library, and explaining where to find the accompanying
uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the Library
except as expressly provided under this License. Any attempt otherwise to
copy, modify, sublicense, link with, or distribute the Library is void, and
will automatically terminate your rights under this License. However, parties
who have received copies, or rights, from you under this License will not
have their licenses terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Library or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the Library
(or any work based on the Library), you indicate your acceptance of this License
to do so, and all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library),
the recipient automatically receives a license from the original licensor
to copy, distribute, link with or modify the Library subject to these terms
and conditions. You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for enforcing
compliance by third parties with this License.
11. If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of
this License. If you cannot distribute so as to satisfy simultaneously your
obligations under this License and any other pertinent obligations, then as
a consequence you may not distribute the Library at all. For example, if a
patent license would not permit royalty-free redistribution of the Library
by all those who receive copies directly or indirectly through you, then the
only way you could satisfy both it and this License would be to refrain entirely
from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims;
this section has the sole purpose of protecting the integrity of the free
software distribution system which is implemented by public license practices.
Many people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Library under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this
License incorporates the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions of
the 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 specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that version
or of any later version published by the Free Software Foundation. If the
Library does not specify a license version number, you may choose any version
ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs
whose distribution conditions are incompatible with these, write to the author
to ask for permission. For software which is copyrighted by the Free Software
Foundation, write to the Free Software Foundation; we sometimes make exceptions
for this. Our decision will be guided by the two goals of preserving the free
status of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible
use to the public, we recommend making it free software that everyone can
redistribute and change. You can do so by permitting redistribution under
these terms (or, alternatively, under the terms of the ordinary General Public
License).
To apply these terms, attach the following notices to the library. It is safest
to attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the "copyright"
line and a pointer to where the full notice is found.
<one line to give the library's name and an idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2.1 of the License, or (at your option)
any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License along
with this library; if not, write to the Free Software Foundation, Inc., 51
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your school,
if any, to sign a "copyright disclaimer" for the library, if necessary. Here
is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
< signature of Ty Coon > , 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

163
LICENSES/LGPL-3.0-only.txt Normal file
View File

@ -0,0 +1,163 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
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.

View File

@ -0,0 +1,12 @@
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the license or (at your option) any later version
that is accepted by the membership of KDE e.V. (or its successor
approved by the membership of KDE e.V.), which shall act as a
proxy as defined in Section 6 of version 3 of the license.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

View File

@ -13,19 +13,27 @@ image formats.
The following image formats have read-only support:
- Animated Windows cursors (ani)
- Camera RAW images (arw, cr2, cr3, dcs, dng, ...)
- Gimp (xcf)
- Krita (kra)
- OpenEXR (exr)
- Photoshop documents (psd)
- Sun Raster (ras)
- OpenRaster (ora)
- Photoshop documents (psd, psb, pdd, psdt)
- Radiance HDR (hdr)
- Sun Raster (im1, im8, im24, im32, ras, sun)
The following image formats have read and write support:
- AV1 Image File Format (AVIF)
- Encapsulated PostScript (eps)
- High Efficiency Image File Format (heif). Can be enabled with the KIMAGEFORMATS_HEIF build option.
- JPEG XL (jxl)
- Personal Computer Exchange (pcx)
- Quite OK Image format (qoi)
- SGI images (rgb, rgba, sgi, bw)
- Softimage PIC (pic)
- Targa (tga): supports more formats than Qt's version
- XView (xv)
## Contributing

View File

@ -1,9 +1,6 @@
#find_package(Qt5Test ${REQUIRED_QT_VERSION} NO_MODULE)
include(ECMMarkAsTest)
include(CMakeParseArguments)
add_definitions(-DPLUGIN_DIR="${CMAKE_CURRENT_BINARY_DIR}/../src")
add_definitions(-DPLUGIN_DIR="${CMAKE_CURRENT_BINARY_DIR}/../bin")
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
macro(kimageformats_read_tests)
@ -15,7 +12,7 @@ macro(kimageformats_read_tests)
if (NOT TARGET readtest)
add_executable(readtest readtest.cpp)
target_link_libraries(readtest Qt5::Gui)
target_link_libraries(readtest Qt6::Gui)
target_compile_definitions(readtest
PRIVATE IMAGEDIR="${CMAKE_CURRENT_SOURCE_DIR}/read")
ecm_mark_as_test(readtest)
@ -30,23 +27,35 @@ macro(kimageformats_read_tests)
endmacro()
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)
add_executable(writetest writetest.cpp)
target_link_libraries(writetest Qt5::Gui)
target_link_libraries(writetest Qt6::Gui)
target_compile_definitions(writetest
PRIVATE IMAGEDIR="${CMAKE_CURRENT_SOURCE_DIR}/write")
ecm_mark_as_test(writetest)
endif()
foreach(_testname ${ARGN})
foreach(_testname ${KIF_RT_UNPARSED_ARGUMENTS})
string(REGEX MATCH "-lossless$" _is_lossless "${_testname}")
string(REGEX MATCH "-nodatacheck" _is_no_data_check "${_testname}")
unset(lossless_arg)
unset(no_data_check_arg)
if (_is_lossless)
set(lossless_arg "--lossless")
string(REGEX REPLACE "-lossless$" "" _testname "${_testname}")
endif()
if (_is_no_data_check)
set(no_data_check_arg "--no-data-check")
string(REGEX REPLACE "-nodatacheck$" "" _testname "${_testname}")
endif()
add_test(
NAME kimageformats-write-${_testname}
COMMAND writetest ${lossless_arg} ${_testname}
COMMAND writetest ${lossless_arg} ${no_data_check_arg} ${_fuzzarg} ${_testname}
)
endforeach(_testname)
endmacro()
@ -55,20 +64,50 @@ endmacro()
# Loads each <format> image in read/<format>/, and compares the
# result against the data read from the corresponding png file
kimageformats_read_tests(
hdr
pcx
psd
qoi
ras
rgb
tga
)
if (KF5Archive_FOUND)
if (KF6Archive_FOUND)
kimageformats_read_tests(
kra
ora
)
endif()
if (TARGET avif)
kimageformats_read_tests(
avif
)
kimageformats_write_tests(
avif-nodatacheck-lossless
)
endif()
if (LibHeif_FOUND)
kimageformats_read_tests(
heif
)
# because the plug-ins use RGB->YUV conversion which sometimes results in 1 value difference.
kimageformats_write_tests(FUZZ 1
heif-nodatacheck-lossless
)
endif()
if (LibJXL_FOUND AND LibJXLThreads_FOUND)
kimageformats_read_tests(
jxl
)
kimageformats_write_tests(
jxl-nodatacheck-lossless
)
endif()
# Allow some fuzziness when reading this formats, to allow for
# rounding errors (eg: in alpha blending).
kimageformats_read_tests(FUZZ 1
@ -84,6 +123,7 @@ kimageformats_read_tests(FUZZ 1
kimageformats_write_tests(
pcx-lossless
pic-lossless
qoi-lossless
rgb-lossless
tga # fixme: the alpha images appear not to be written properly
)
@ -95,17 +135,30 @@ kimageformats_write_tests(
# kimageformats_write_tests(eps)
#endif()
if (OpenEXR_FOUND)
# FIXME: OpenEXR tests
kimageformats_read_tests(
exr
)
endif()
find_package(Qt5Test ${REQUIRED_QT_VERSION} CONFIG QUIET)
if (LibRaw_FOUND)
kimageformats_read_tests(
raw
)
endif()
if(NOT Qt5Test_FOUND)
message(STATUS "Qt5Test not found, some autotests will not be built.")
find_package(Qt6Test ${REQUIRED_QT_VERSION} CONFIG QUIET)
if(NOT TARGET Qt6::Test)
message(STATUS "Qt6Test not found, some autotests will not be built.")
return()
endif()
add_executable(pictest pictest.cpp)
target_link_libraries(pictest Qt5::Gui Qt5::Test)
target_link_libraries(pictest Qt6::Gui Qt6::Test)
ecm_mark_as_test(pictest)
add_test(NAME kimageformats-pic COMMAND pictest)
add_executable(anitest anitest.cpp)
target_link_libraries(anitest Qt6::Gui Qt6::Test)
ecm_mark_as_test(anitest)
add_test(NAME kimageformats-ani COMMAND anitest)

BIN
autotests/ani/test.ani Normal file

Binary file not shown.

BIN
autotests/ani/test_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

BIN
autotests/ani/test_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

BIN
autotests/ani/test_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 810 B

119
autotests/anitest.cpp Normal file
View File

@ -0,0 +1,119 @@
/*
SPDX-FileCopyrightText: 2020 Kai Uwe Broulik <kde@broulik.de>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include <QImage>
#include <QImageReader>
#include <QTest>
static bool imgEquals(const QImage &im1, const QImage &im2)
{
const int height = im1.height();
const int width = im1.width();
for (int i = 0; i < height; ++i) {
const auto *line1 = reinterpret_cast<const quint8 *>(im1.scanLine(i));
const auto *line2 = reinterpret_cast<const quint8 *>(im2.scanLine(i));
for (int j = 0; j < width; ++j) {
if (line1[j] - line2[j] != 0) {
return false;
}
}
}
return true;
}
class AniTests : public QObject
{
Q_OBJECT
private Q_SLOTS:
void initTestCase()
{
QCoreApplication::addLibraryPath(QStringLiteral(PLUGIN_DIR));
}
void testReadMetadata()
{
QImageReader reader(QFINDTESTDATA("ani/test.ani"));
QVERIFY(reader.canRead());
QCOMPARE(reader.imageCount(), 4);
QCOMPARE(reader.size(), QSize(32, 32));
QCOMPARE(reader.text(QStringLiteral("Title")), QStringLiteral("ANI Test"));
QCOMPARE(reader.text(QStringLiteral("Author")), QStringLiteral("KDE Community"));
}
void textRead()
{
QImageReader reader(QFINDTESTDATA("ani/test.ani"));
QVERIFY(reader.canRead());
QCOMPARE(reader.currentImageNumber(), 0);
QImage aniFrame;
QVERIFY(reader.read(&aniFrame));
QImage img1(QFINDTESTDATA("ani/test_1.png"));
img1.convertTo(aniFrame.format());
QVERIFY(imgEquals(aniFrame, img1));
QCOMPARE(reader.nextImageDelay(), 166); // 10 "jiffies"
QVERIFY(reader.canRead());
// that read() above should have advanced us to the next frame
QCOMPARE(reader.currentImageNumber(), 1);
QVERIFY(reader.read(&aniFrame));
QImage img2(QFINDTESTDATA("ani/test_2.png"));
img2.convertTo(aniFrame.format());
QVERIFY(imgEquals(aniFrame, img2));
// The "middle" frame has a longer delay than the others
QCOMPARE(reader.nextImageDelay(), 333); // 20 "jiffies"
QVERIFY(reader.canRead());
QCOMPARE(reader.currentImageNumber(), 2);
QVERIFY(reader.read(&aniFrame));
QImage img3(QFINDTESTDATA("ani/test_3.png"));
img3.convertTo(aniFrame.format());
QVERIFY(imgEquals(aniFrame, img3));
QCOMPARE(reader.nextImageDelay(), 166);
QVERIFY(reader.canRead());
QCOMPARE(reader.currentImageNumber(), 3);
QVERIFY(reader.read(&aniFrame));
// custom sequence in the ANI file should get us back to img2
QVERIFY(imgEquals(aniFrame, img2));
QCOMPARE(reader.nextImageDelay(), 166);
// We should have reached the end now
QVERIFY(!reader.canRead());
QVERIFY(!reader.read(&aniFrame));
// Jump back to the start
QVERIFY(reader.jumpToImage(0));
QVERIFY(reader.canRead());
QCOMPARE(reader.currentImageNumber(), 0);
QCOMPARE(reader.nextImageDelay(), 166);
QVERIFY(reader.read(&aniFrame));
QVERIFY(imgEquals(aniFrame, img1));
}
};
QTEST_MAIN(AniTests)
#include "anitest.moc"

37
autotests/fuzzyeq.cpp Normal file
View File

@ -0,0 +1,37 @@
/*
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);
}

View File

@ -1,23 +1,8 @@
/*
* Copyright 2014 Alex Merry <alex.merry@kdemail.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) version 3, or any
* later version accepted by the membership of KDE e.V. (or its
* successor approved by the membership of KDE e.V.), which shall
* act as a proxy defined in Section 6 of version 3 of the license.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
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
*/
#include <stdio.h>
@ -50,61 +35,27 @@ private:
QTest::addColumn<QImage::Format>("pngformat");
QTest::addColumn<bool>("compress");
QTest::newRow("4x4 no alpha RLE")
<< QFINDTESTDATA("pic/4x4-simple-color.pic")
<< QFINDTESTDATA("pic/4x4-simple-color.png")
<< QString()
<< false
<< QImage::Format_RGB32
<< true;
QTest::newRow("4x4 no alpha RLE") << QFINDTESTDATA("pic/4x4-simple-color.pic") << QFINDTESTDATA("pic/4x4-simple-color.png") << QString() << false
<< QImage::Format_RGB32 << true;
QTest::newRow("4x4 no alpha raw")
<< QFINDTESTDATA("pic/4x4-simple-color-uncompressed.pic")
<< QFINDTESTDATA("pic/4x4-simple-color.png")
<< QString()
<< false
<< QImage::Format_RGB32
<< false;
QTest::newRow("4x4 no alpha raw") << QFINDTESTDATA("pic/4x4-simple-color-uncompressed.pic") << QFINDTESTDATA("pic/4x4-simple-color.png") << QString()
<< false << QImage::Format_RGB32 << false;
QTest::newRow("Short comment")
<< QFINDTESTDATA("pic/short-comment.pic")
<< QFINDTESTDATA("pic/4x4-simple-color.png")
<< QStringLiteral("Test comment value")
<< false
<< QImage::Format_RGB32
<< true;
QTest::newRow("Short comment") << QFINDTESTDATA("pic/short-comment.pic") << QFINDTESTDATA("pic/4x4-simple-color.png")
<< QStringLiteral("Test comment value") << false << QImage::Format_RGB32 << true;
QTest::newRow("Long comment")
<< QFINDTESTDATA("pic/long-comment.pic")
<< QFINDTESTDATA("pic/4x4-simple-color.png")
<< QStringLiteral("Test comment value that goes right up to the end of the comment field and has no")
<< false
<< QImage::Format_RGB32
<< true;
QTest::newRow("Long comment") << QFINDTESTDATA("pic/long-comment.pic") << QFINDTESTDATA("pic/4x4-simple-color.png")
<< QStringLiteral("Test comment value that goes right up to the end of the comment field and has no") << false
<< QImage::Format_RGB32 << true;
QTest::newRow("Long run-lengths")
<< QFINDTESTDATA("pic/long-runs.pic")
<< QFINDTESTDATA("pic/long-runs.png")
<< QString()
<< false
<< QImage::Format_RGB32
<< true;
QTest::newRow("Long run-lengths") << QFINDTESTDATA("pic/long-runs.pic") << QFINDTESTDATA("pic/long-runs.png") << QString() << false
<< QImage::Format_RGB32 << true;
QTest::newRow("4x4 with alpha RLE")
<< QFINDTESTDATA("pic/4x4-alpha.pic")
<< QFINDTESTDATA("pic/4x4-alpha.png")
<< QString()
<< true
<< QImage::Format_ARGB32
<< true;
QTest::newRow("4x4 with alpha RLE") << QFINDTESTDATA("pic/4x4-alpha.pic") << QFINDTESTDATA("pic/4x4-alpha.png") << QString() << true
<< QImage::Format_ARGB32 << true;
QTest::newRow("4x4 with alpha raw")
<< QFINDTESTDATA("pic/4x4-alpha-uncompressed.pic")
<< QFINDTESTDATA("pic/4x4-alpha.png")
<< QString()
<< true
<< QImage::Format_ARGB32
<< false;
QTest::newRow("4x4 with alpha raw") << QFINDTESTDATA("pic/4x4-alpha-uncompressed.pic") << QFINDTESTDATA("pic/4x4-alpha.png") << QString() << true
<< QImage::Format_ARGB32 << false;
}
private Q_SLOTS:
@ -121,13 +72,8 @@ private Q_SLOTS:
// so there is no actual data loss in converting to RGB16.
// This just tests that the pic plugin can deal with different
// input formats.
QTest::newRow("altered format")
<< QFINDTESTDATA("pic/4x4-simple-color.pic")
<< QFINDTESTDATA("pic/4x4-simple-color.png")
<< QString()
<< false
<< QImage::Format_RGB16
<< true;
QTest::newRow("altered format") << QFINDTESTDATA("pic/4x4-simple-color.pic") << QFINDTESTDATA("pic/4x4-simple-color.png") << QString() << false
<< QImage::Format_RGB16 << true;
}
void testRead_data()
@ -163,17 +109,12 @@ private Q_SLOTS:
imgWriter.write(pngImage);
if (expData != picData) {
QString fileNameBase = QUuid::createUuid().toString()
.remove(QLatin1Char('{'))
.remove(QLatin1Char('}'));
QString fileNameBase = QUuid::createUuid().toString().remove(QLatin1Char('{')).remove(QLatin1Char('}'));
QFile dumpFile(fileNameBase + QStringLiteral(".pic"));
QVERIFY2(dumpFile.open(QIODevice::WriteOnly), qPrintable(dumpFile.errorString()));
dumpFile.write(picData);
QString msg = QStringLiteral("Written data (")
+ dumpFile.fileName()
+ QStringLiteral(") differed from expected data (")
+ picfile
+ QLatin1Char(')');
QString msg =
QStringLiteral("Written data (") + dumpFile.fileName() + QStringLiteral(") differed from expected data (") + picfile + QLatin1Char(')');
QFAIL(qPrintable(msg));
}
}
@ -197,29 +138,20 @@ private Q_SLOTS:
QCOMPARE(inputImage.width(), expImage.width());
QCOMPARE(inputImage.height(), expImage.height());
QCOMPARE(inputImage.hasAlphaChannel(), alpha);
QCOMPARE(inputImage.format(), alpha ? QImage::Format_ARGB32
: QImage::Format_RGB32);
QCOMPARE(inputImage.format(), alpha ? QImage::Format_ARGB32 : QImage::Format_RGB32);
expImage = expImage.convertToFormat(pngformat);
expImage = expImage.convertToFormat(alpha ? QImage::Format_ARGB32
: QImage::Format_RGB32);
expImage = expImage.convertToFormat(alpha ? QImage::Format_ARGB32 : QImage::Format_RGB32);
if (inputImage != expImage) {
QString fileNameBase = QUuid::createUuid().toString()
.remove(QLatin1Char('{'))
.remove(QLatin1Char('}'));
QString fileNameBase = QUuid::createUuid().toString().remove(QLatin1Char('{')).remove(QLatin1Char('}'));
QFile picDumpFile(fileNameBase + QStringLiteral("-expected.data"));
QVERIFY2(picDumpFile.open(QIODevice::WriteOnly), qPrintable(picDumpFile.errorString()));
picDumpFile.write(reinterpret_cast<const char *>(inputImage.bits()),
inputImage.byteCount());
picDumpFile.write(reinterpret_cast<const char *>(inputImage.bits()), inputImage.sizeInBytes());
QFile pngDumpFile(fileNameBase + QStringLiteral("-actual.data"));
QVERIFY2(pngDumpFile.open(QIODevice::WriteOnly), qPrintable(pngDumpFile.errorString()));
pngDumpFile.write(reinterpret_cast<const char *>(expImage.bits()),
expImage.byteCount());
QString msg = QStringLiteral("Read image (")
+ picDumpFile.fileName()
+ QStringLiteral(") differed from expected image (")
+ pngDumpFile.fileName()
+ QLatin1Char(')');
pngDumpFile.write(reinterpret_cast<const char *>(expImage.bits()), expImage.sizeInBytes());
QString msg = QStringLiteral("Read image (") + picDumpFile.fileName() + QStringLiteral(") differed from expected image (") + pngDumpFile.fileName()
+ QLatin1Char(')');
QFAIL(qPrintable(msg));
}
}
@ -267,8 +199,7 @@ private Q_SLOTS:
QImageReader inputReader(picfile, "pic");
QCOMPARE(inputReader.imageFormat(),
alpha ? QImage::Format_ARGB32 : QImage::Format_RGB32);
QCOMPARE(inputReader.imageFormat(), alpha ? QImage::Format_ARGB32 : QImage::Format_RGB32);
}
};

BIN
autotests/read/avif/bw.avif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

BIN
autotests/read/avif/bw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

BIN
autotests/read/avif/bwa.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
autotests/read/avif/rgb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
autotests/read/hdr/rgb.hdr Normal file

Binary file not shown.

BIN
autotests/read/hdr/rgb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

BIN
autotests/read/heif/rgb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
autotests/read/jxl/rgb.jxl Normal file

Binary file not shown.

BIN
autotests/read/jxl/rgb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 KiB

BIN
autotests/read/jxl/rgba.jxl Normal file

Binary file not shown.

BIN
autotests/read/jxl/rgba.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
autotests/read/pcx/mono.pcx Normal file

Binary file not shown.

BIN
autotests/read/pcx/mono.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Some files were not shown because too many files have changed in this diff Show More