759 Commits

Author SHA1 Message Date
eae41980b2 dds: Fix assert when reading broken data
oss-fuzz testcase 6027629841154048
2025-09-06 22:39:16 +00:00
3bf2281610 GIT_SILENT: Use Qt CamelCase includes 2025-09-04 08:32:52 +02:00
59089855fa Unified maximum pixel value for large image plugins 2025-08-30 09:17:58 +02:00
5a067130af Removed the conversion of the entire image to a compatible format when saving from the PCX, PIC, and RGB plugins.
For example, the PCX plugin converts all RGB images to RGB(A)32. So if you try to save a 1 GiB RGB888 image, it will be converted to RGB32 image so, you need additional 1.25GiB of ram. The conversion now occurs line by line, significantly saving memory.
2025-08-30 09:17:40 +02:00
9c6c0c01ae TGA: Support for TGA specification 2.0
Adds TGA 2.0 compliance:
- Support for Extension Area, Developer Area and Footer (metadata support)
- Support for 15-bit and 16-bit per pixel images (both RGB and Indexed)
- Full support for rotation on reading (we cannot use Qt transformations because only a subset is part of the TGA specification)
- When writing you can choose the supported version (subType)
- Improved writing speed (approximately 10 times) and removed whole image conversions (significant memory savings)

It pass the [TrueVision TGA 2.0 conformance suite](https://github.com/zigimg/test-suite/tree/master/fixtures/tga).

Test changes:
- Read test: added ability to skip a specific test on sequential devices (via JSON behavior file)
- Write test: added the ability to set the subType when writing (via JSON properties file)

Closes #37
2025-08-23 09:20:09 +00:00
f933cbe12d Fix possible buffer overflow on corrupted images 2025-08-22 08:08:17 +02:00
ebc366b3c5 TGA: memory optimizations and native grayscale support
- Removed temporary buffer of uncompressed image size when reading (loads images using half the memory)
- Added native support for Grayscale images (they are no longer converted to RGB(A) 32 when reading/writing)
- Fixes wrong X channel value on RGBX32 images (CCBUG: 499584)

It should also reduce loading times for corrupted images.

Closes #33
2025-08-20 21:53:00 +00:00
bc8b5b56b1 Move fuzz target and build script into KImageFormats repository 2025-08-20 22:57:06 +05:30
35a1ed0227 GIT_SILENT: Bump kf ecm_set_disabled_deprecation_versions. Make sure that it compiles fine without kf 6.17 deprecated methods 2025-08-15 08:29:20 +02:00
f63b082c85 IFF: add support for a different palette per line 2025-08-12 08:28:31 +02:00
68cc915132 IFF: Fix possible undefined-shift 2025-08-09 11:46:05 +02:00
e912a4ac9b RAW: Error out on malformed files
Internally, LibRaw often doesn't check the return values of various functions. It's not uncommon to find things like:

fseek(ifp, oAtom, SEEK_SET);
szAtom = get4();
... (more read operations without checking the result)

This means is up to us to error our properly when something went wrong. We do that by keeping an error counter and calling IOERROR once we've reached enough errors. IOERROR will throw an exception that will be internally caught by libraw itself.
2025-08-07 20:39:55 +00:00
480ea8dba0 IFF: add support for RGBN/RGB8 image data and CAT chunk
Add the following features:
- RGB8 image data support (test case added)
- RGBN image data support ([Clouds.iff](/uploads/9db869350f74421bf1813fa7d4332f4f/Clouds.iff))
- CAT chunk support: you can have more than one image for file (test case added)
- Image transformation support via EXIF data

[RGBN/RGB8](https://wiki.amigaos.net/wiki/RGBN_and_RGB8_IFF_Image_Data) files are used in Impulse's Turbo Silver and Imagine.

Closes #34
2025-08-07 20:17:09 +00:00
37e3c65a05 ILBM 64-bit extension support 2025-08-04 13:47:00 +02:00
4b44f8474f Fix oss-fuzz compilation error 2025-08-04 13:46:16 +02:00
c2a1d4b401 IFF: Fix halfbride detection, 1-bitplane colors and PBM line size calculation. It also ignore ZBuffer flag on Maya images (like Photoshop does) amd adds CMYK palette support. 2025-08-01 15:29:52 +02:00
cd39c36621 Update version to 6.18.0 2025-08-01 13:33:36 +02:00
1bfae6f171 Update dependency version to 6.17.0 v6.17.0-rc1 v6.17.0 2025-08-01 12:14:50 +02:00
fd864e6f55 IFF: add support for uncompressed ACBM type 2025-07-24 07:37:58 +02:00
16b669d63d Bump kf ecm_set_disabled_deprecation_versions. Make sure that it compiles fine without kf 6.16 deprecated methods 2025-07-21 20:30:44 +02:00
457f3afa24 Fix CI
GIT_SILENT
2025-07-20 21:43:36 +00:00
080fd3c72d It compiles fine without qt 6.10 deprecated methods 2025-07-20 21:42:04 +02:00
1d69f6af57 IFF: add mime types and extensions 2025-07-17 07:32:26 +02:00
083680eb77 chunks.cpp - send info and warning messages to the iff logging category
For example:
`IFFChunk::innerFromDevice: unkwnown chunk "\x89PNG"`

becomes:
`kf.imageformats.plugins.iff: IFFChunk::innerFromDevice: unknown chunk "\x89PNG"`

bonus: we can filter out such messages if we want using QT_LOGGING_RULES

also note the spelling fix
2025-07-16 11:00:54 -04:00
0a9f9fe106 IFF: support for Ham8, HalfBride, Pbm and ILBM 32-bits modes 2025-07-15 07:38:19 +02:00
21b3b890ec tga: Be less strict about palette
There's images in the wild that claim to not have a palette
but still have one.
2025-07-09 13:17:20 +02:00
aef4bd7e1c Fix unused param in MicroExif::toByteArray() 2025-07-07 08:17:36 +02:00
ea1983a7d1 IFF: Fix possible stack overflow 2025-07-05 09:59:06 +00:00
775b53f1f6 Update version to 6.17.0 2025-07-04 18:28:45 +02:00
02cf1502c0 Update dependency version to 6.16.0 v6.16.0-rc1 2025-07-04 16:29:08 +02:00
f6c718a789 TGA: add indexed write support
Indexed images are saved as uncompressed TGA with color map.

Closes #30
2025-07-03 07:36:33 +02:00
4f2f2425d3 IFF: read only support to Interchange Format Files
Read-only support for most common Interchange Format Files (IFF). Supports IFF saved by Photoshop for the Amiga and Maya platform and HAM6 coded files.

Closes #29
2025-07-01 21:59:03 +00:00
e6357c22f7 tga: Use Format_Indexed8 for indexed formats and support 32-bit BGRA colormap 2025-06-26 16:00:11 +02:00
094177a01c Update version to 6.16.0 2025-06-06 16:31:26 +02:00
7420f47c17 Update dependency version to 6.15.0 v6.15.0 v6.15.0-rc1 2025-06-06 15:19:44 +02:00
888bca7387 cmake: add cmake config
That way, other projects can declare to have a runtime dependency on KImageFormats
2025-05-21 17:39:44 +02:00
e3aefd2aa1 JXR: Restore device position after reading options 2025-05-14 02:50:03 +02:00
aa8134ee0d README.md: minor fixes and improvements 2025-05-06 07:33:27 +02:00
9f09473aa0 It compiles fine without kf_6_13 deprecated methods 2025-05-04 21:31:49 +02:00
62eb1d28cb Add README about autotests 2025-05-03 11:01:46 +02:00
15bece40ec Update version to 6.15.0 2025-05-02 17:10:02 +02:00
1b3d2afbe3 Update dependency version to 6.14.0 v6.14.0-rc1 v6.14.0 2025-05-02 16:02:43 +02:00
850068c1dc JXR: fix compilation error on 32-bit systems 2025-04-22 08:01:02 +02:00
6bf38ea638 Improved EXIF V3 compatibility (2)
This patch improve the string read/write in case of non ASCII encoding.
- When reading, checks for UTF-8 text even on ASCII data type. If it fails, Latin1 converter is used.
- When writing using V3 specs, a better check is done to identify 7-bit ASCII text.

Related to MR !358
2025-04-21 11:29:13 +00:00
2adca7c0ca jxr: Use qsizetype for image size variables
Fixes type mismatch on 32-bit architectures.

/builddir/build/BUILD/kf6-kimageformats-6.13.0-build/kimageformats-6.13.0/src/imageformats/jxr.cpp: In member function ‘virtual bool JXRHandler::read(QImage*)’:
/builddir/build/BUILD/kf6-kimageformats-6.13.0-build/kimageformats-6.13.0/src/imageformats/jxr.cpp:994:88: error: no matching function for call to ‘min(qint64&, qsizetype)’
  994 |                 std::memcpy(img.scanLine(y), ba.data() + convStrideSize * y, (std::min)(convStrideSize, img.bytesPerLine()));
      |                                                                              ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-04-21 10:07:00 +02:00
dd69fdaea9 lib prefix on Android
Qt's original qtimageformats plug-ins use lib prefix too,
without the lib prefix, the image plug-ins don't work on Android.
2025-04-19 14:16:18 +00:00
ae62ea3dfc Improved EXIF V3 compatibility
EXIF specs V3 added the UTF-8 data type. The MicroExif class now allows serializations to choose whether to support the V2 or V3 format. To maximize compatibility with old readers, even when V3 is set, the ASCII data type is used if possible.

The JXR plugin, based on TIFF V6 container, does not allow to use the V3 format (it does not recognize the UTF-8 data type) and therefore V2 has been forced. For all other plugins using MicroExif, it is now possible to save, e.g., descriptions in Japanese.

Please note that this patch is also a bugfix: when saving, version 3 was set but the strings were always saved as ASCII.
2025-04-18 13:53:12 +00:00
9c47845f15 Update version to 6.14.0 2025-04-10 19:53:58 +02:00
7c7fa73020 Remove conditions for no longer supported Qt versions 2025-04-08 18:46:13 +02:00
92e4271e84 GIT_SILENT Upgrade Qt6 version requirement to 6.7.0. 2025-04-07 10:13:41 +02:00