Commit Graph
975 Commits
Author SHA1 Message Date
Ana BobilloandMirco Miranda 296444189e IFF: set every pixel of each line
Images are allocated without being initialized, so a reader must write
every pixel of every line. The IFF reader did not always:

- Maya: nothing checked that the tiles cover the image: areas no tile
  covers are now opaque black.
- readStandardImage(), readCDIImage(), readRGFXImage() and
  readDEEPImage() copied min(bytesPerLine, decoded line) bytes, and some
  decoded lines are shorter than the image line:
  - a PBM with 8 bitplanes and a 64 color CMAP was taken for HAM and
    allocated as RGB888, while PBM data are one index per pixel: HAM is
    no longer applied to PBM images;
  - other mismatches (e.g. HAM without CMAP, RGB8 with 32 bitplanes, CD-i
    CLUT3 or RGB888, a truncated CD-i line) are now an error: a decoded
    line that does not cover the image line is refused.

Added the read test pbm_64colors.iff, which fails without this change.
2026-10-29 08:27:06 +01:00
Mirco MirandaandMirco Miranda d6e97b1bd1 ANI: bound previousImage in nextImageDelay() 2026-10-29 07:57:44 +01:00
Mirco MirandaandMirco Miranda 12538e5ec0 Increase single test timeout due to continue failure of some CIs 2026-10-29 07:34:48 +01:00
Mirco Miranda a464c89078 Fix oss-fuzz compilation error 2026-10-28 14:42:13 +01:00
Mirco MirandaandMirco Miranda 26d960cb72 DDS: add DX10 BC6H support
Add read support for BC6H textures declared in the DX10 extended
header (DXGI formats BC6H_TYPELESS, BC6H_UF16 and BC6H_SF16).
2026-10-28 07:49:26 +01:00
Ana BobilloandMirco Miranda 5e406e76ba PCX: set every pixel of each line
Images are allocated without being initialized, so a reader must write
every pixel of every line. The PCX reader did not always:

- readImage2() and readImage4v2() decoded width / 4 and width / 2 bytes,
  so the last pixels of lines whose width is not a multiple of 4 (2 bits)
  or 2 (4 bits) were not set. They now decode every pixel.
- With a BytesPerLine smaller than a line of pixels, readImage1(),
  readImage8() and readImage24() left the end of each line unset: such
  headers are now refused by isSupported(), which replaces the check
  readImage4() had.

Added the read tests indexed2_w13.pcx and indexed4_w13.pcx, which fail
without this change.
2026-10-28 07:43:33 +01:00
Ana Bobillo 32ff79442c RAS: unpack 1-bit images with a color map
1-bit images with a color map are loaded as Indexed8, but their lines
were copied packed: the first (width + 7) / 8 bytes (rounded up to an
even number) of each line held packed bits read as indexes, and the rest
of the line was not set, so it kept whatever the memory held (images are
allocated without being initialized). The bits are now unpacked to one
index per pixel.

Added the read test pal1bit.ras, which fails without this change.
2026-10-27 10:39:33 +01:00
Wang ZichongandMirco Miranda e07c5386ff DDS: simply use 0 for blue channel for readATI2()
Originally we uses getNormalZ() for the image, which treat the
image as a normal map. Visual Studio simply fill the blue channel
with 0 instead. Since DDS is for DirectX which is a MS stuff, align
to Visual Studio might be a good idea.

Also, red and green channel should be swapped.
2026-10-27 07:23:35 +01:00
Wang ZichongandMirco Miranda 67ee4cb720 DDS: vendoring and using bcdec.h for DDS BC decompression
This can also make it easier to support BC6H in the future.
2026-10-27 07:23:35 +01:00
Mirco Miranda 477e9ea542 IFF: fix stack overflow in PLTEChunk::count() 2026-10-26 16:20:44 +01:00
Mirco Miranda a9faf5feee MicroExif: fix wrong software tag in MicroExif::fromImage 2026-10-23 10:31:18 +02:00
Nicolas FellaandMirco Miranda 7488f8ff2c Revert "Disable LSAN due to obsolete JXRLIB on CI"
This reverts commit 8b8eb91f2b
2026-10-20 05:32:36 +02:00
Wang ZichongandMirco Miranda 3b18b654b0 DDS: add DX10 BC4/BC5/BC7 support
DX10 DDS files using the BC (block compression) formats were reported as
unsupported: knownDXGIFormat() only mapped the floating point DXGI
formats, so getFormat() returned FormatUnknown and ensureScanned() failed,
e.g. for a BC7_UNORM_SRGB (dxgi 99) image.

The following changes have been made:

- Added a self-contained BC7 decoder following the "BC7 Format"
  specification, supporting all 8 modes, for both the UNORM and the
  UNORM_SRGB variants (loaded as ARGB32)
- Added BC4 support (single channel, loaded as Grayscale8)
- Added BC5 support, reusing the existing ATI2/3Dc normal map decoder
- Added DX10 mappings for BC1/BC2/BC3, which were previously handled only
  as the legacy DXT1/DXT3/DXT5 fourCC formats
- Added read tests for BC4, BC5, BC7 and BC7_UNORM_SRGB, plus DX10
  variants of the existing BC1/BC2/BC3 test images

BC6H (HDR) is not supported.

The test data was generated from the existing rgba.png test image, encoded
with bc7enc_rdo and decoded with bcdec.

BUG: 524495
2026-10-20 03:38:47 +02:00
Mirco Miranda ae6031c02e expose the underlying library version in the image metadata 2026-10-16 16:20:42 +02:00
Roland BusaandDaniel Novomeský dc714be934 heif: apply all rotation and mirror combinations
read_orientation_helper() mapped the irot/imir properties to an EXIF
orientation with a list of conditions that misses several combinations,
e.g. a 90 degrees counterclockwise rotation followed by a mirroring,
which is how iPhone front-camera photos are stored. For those it still
returned true, so libheif was told to ignore the transformations while
Qt got no orientation either, and the image was shown sideways.

The orientation is now chosen by a switch on the rotation and, in each
case, on the mirroring, which is applied after the rotation as MIAF
requires. Other rotation values are left to libheif.

The new read tests cover the twelve rotation and mirroring combinations,
named like the AVIF ones. All of them display the same picture (colored
corners and an "F"): the stored pixels are that picture with the
transformations undone, written as uncompressed HEIF with libheif. Four
of them fail without this change.
2026-10-14 09:59:31 +00:00
Mirco MirandaandMirco Miranda b94001fe46 Fix packbits for unsigned-char platforms 2026-10-13 22:06:45 +02:00
Daniel Novomeský 83c1b0ceb1 heif: reject large images prior decoding
Renamed HEIC (too specific) to HEIF (more general)
in error messages as the plugin now handles more formats than HEIC.
2026-10-13 19:20:59 +00:00
Antonio Rojas 418da3bbf4 Fix jxrlib detection with vanilla jxrlib
Current cmake module assumes the headers are installed in $(INCLUDEDIR)/jxrlib, which is only true if using a custom CMakeLists (as provided by eg. Fedora)

Fix detection of jxrlib compiled with the upstream Makefile by checking the pc file first, and fallback to manual detection as before.
2026-10-13 18:24:24 +00:00
Daniel Novomeský 5dafbe2d2f ossfuzz: use baseline SIMD for libjxl
libjxl with SIMD disabled (HWY_COMPILE_ONLY_SCALAR) and with
O1 optimization level is very slow for real use,
leading to timeouts.
HWY_COMPILE_ONLY_STATIC enables baseline SIMD, which should be
always supported by current arch. (for example SSE2 on x86_64)
2026-10-09 15:47:33 +02:00
Mirco MirandaandMirco Miranda 60d2638e63 Fix for alpha channel handling and sRGB color profiles. 2026-10-07 23:22:36 +02:00
Daniel Novomeský aee9dd7fe1 ossfuzz: update dependencies
openexr 3.5.x
libaom 3.15.1
added libjpeg-turbo (dependency of libheif)
Remove obsolete patch for libheif/security_limits.h
2026-10-07 19:36:59 +02:00
Albert Astals Cid 40ed3e4e27 oss-fuzz: Get a newer cmake from pip 2026-10-06 22:38:24 +02:00
Sertonix NorsonandMirco Miranda e539ca748f Enable perceptiveFuzzer for write tests
Fixes kimageformats-write-exr test on Alpine Linux armhf, armv7,
loongarch64, ppc64le, riscv64 and s390x.

Working alternatives are increasing fuzziness to 10 or using 64bpp
formats as compareFormat.
2026-10-06 04:37:46 +02:00
Sertonix Norson cb74a20421 EXIF: always use little-endian for UTF-16
In practice UTF-16 (especially from windows) uses little-endian without
a BOM. By default Qt uses host endianess which causes TIFF_XPTITLE and
TIFF_XPKEYWORDS to not be read correctly.

Fixes c21b50d699
2026-10-05 12:28:36 +02:00
Sertonix NorsonandDaniel Novomeský af34c774d3 avif: increase fuzziness in invalid-exif.avif.json to 44
Fixes kimageformats-read-avif test failure on Alpine Linux s390x

Ref https://invent.kde.org/frameworks/kimageformats/-/merge_requests/530#note_1561068
2026-10-03 23:13:16 +00:00
Sertonix NorsonandAlbert Astals Cid 104643bf09 IFF: fix BODYChunk::deinterleave on big-endian
Qt accesses the data of QImage::Format_RGBX64 and QImage::Format_RGBA64
as host-endian quint16. Having BODYChunk::deinterleave write the data
with host-endian to fix parsing on big-endian systems.
2026-10-03 10:43:42 +00:00
Sertonix NorsonandAlbert Astals Cid 9a45321440 IFF: fix DBODChunk::strideRead on big-endian
On big-endian systems the uint16 data should stay big-endian.
2026-10-03 10:43:42 +00:00
Sertonix NorsonandAlbert Astals Cid f5ba223e15 TIM: fix 16BPP on big-endian
Despite the QImage::scanLine doc only warning about byte order issues
for 32-bpp formats[0] the same warning seems to apply to 16BPP formats
like QImage::Format_RGB555 as well.

[0]: https://doc.qt.io/qt-6/qimage.html#scanLine
2026-10-03 10:34:55 +00:00
Sertonix NorsonandAlbert Astals Cid e23328fda8 FF: replace broken #if Q_LITTLE_ENDIAN
Q_LITTLE_ENDIAN was used incorrectly, it should have been
"#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN"

Use qFromBigEndian since it is more explicit.

Fixes 6d5e61f0b0
2026-10-03 10:22:23 +00:00
Mirco MirandaandNicolas Fella 8b8eb91f2b Disable LSAN due to obsolete JXRLIB on CI 2026-10-02 16:02:55 +02:00
Nicolas Fella 5e3c759e21 Update version to 6.32.0 2026-10-02 15:49:57 +02:00
Nicolas Fella 6efce8ae4e Update dependency version to 6.31.0 v6.31.0-rc1 v6.31.0 2026-10-02 14:17:42 +02:00
Albert Astals Cid a8f5e16453 GIT_SILENT Upgrade CMake version requirement to 3.30.
See https://community.kde.org/Frameworks/Policies
2026-09-30 18:37:40 +02:00
Albert Astals Cid fe27d49f2f GIT_SILENT Upgrade Qt6 version requirement to 6.10.0.
See https://community.kde.org/Frameworks/Policies
2026-09-30 18:02:02 +02:00
Nicolas Fella ff1fdf660e Enable LSAN in CI
To check for leaks
2026-09-29 11:12:27 +02:00
Mirco Miranda 5e5072d590 EXR: store of "adobe_rsrc" attribute with XMP/EXIF/Resolution data 2026-09-10 16:44:54 +02:00
Mirco MirandaandMirco Miranda 6a3c7f2c86 EXR: support for metadata saved by Photoshop 2026-09-10 07:36:10 +02:00
Albert Astals Cid 43e6efb0e5 ANIHandler::nextImageDelay: Protect against overflow
oss-fuzz:
 issue #558190560
 testcase #6629308500869120
2026-09-09 18:36:51 +00:00
Daniel Novomeský b7a407a752 autotests: add AVIF image-grid image to read test 2026-09-08 16:43:31 +02:00
Daniel Novomeský 62c45582df ossfuzz: update libaom to 3.15.0 2026-09-08 14:20:50 +02:00
Mirco MirandaandMirco Miranda a738553dc9 EXR: fix alpha channel imperpretation 2026-09-04 18:40:44 +02:00
Mirco MirandaandMirco Miranda 0862db49b8 EXR: RGB / YC subtype support 2026-09-04 18:40:44 +02:00
Nicolas Fella 05af59e819 Update version to 6.31.0 2026-09-04 14:36:24 +02:00
Nicolas Fella 5d6dfb9012 Update dependency version to 6.30.0 v6.30.0-rc1 v6.30.0 2026-09-04 13:26:17 +02:00
Albert Astals Cid 72518dcc1a jp2: Fix new[] vs delete by not doing new[]
unique_ptr will call delete which is not the right thing to do with
memory allocated with new[]

BUGS: 525120
2026-09-03 00:13:53 +02:00
Mirco MirandaandAlbert Astals Cid a6027264d4 qRoundOrZero_T: fix possible assert in qRound
also:
- qRoundOrZero_T: added documentation
- EXR: I don't set the ISO Speed ​​if it's zero.

BUG: 524678
2026-08-26 22:45:12 +00:00
Daniel Novomeský 47ea774621 autotests: Add non-standard HEIF image 2026-08-24 18:49:54 +02:00
Daniel Novomeský 5ed0affc95 heif: re-enable decoding of non-standard images
BUG: 495686

IMG_20241019_195232.heic stopped decoding recently because
buffer.contains("Xiaomi") is almost all the time false
(only start of the file is stored now),
except sequential devices (full file is stored).
2026-08-24 12:02:58 +02:00
Daniel Novomeský 42e9733060 Add HEIC test files with crop transformation 2026-08-20 22:21:48 +02:00
Daniel Novomeský bae45287ad heif: check crop values 2026-08-20 19:20:10 +02:00