Commit Graph
38 Commits
Author SHA1 Message Date
Mirco MirandaandAlbert Astals Cid c38a1a0248 PFM: extended to half float format
The Portable HalfMap is a format supported by ImageMagick. The test cases was generated by converting pfm to phm using ImageMagick: `convert image.pfm image.phm`.
2024-11-06 21:12:05 +00:00
Mirco Miranda 2ea724c241 Rename SCT plugin for OSS-FUZZ
To make OSS fuzz build script happy, the test folder and the cpp file must have the same name.
2024-11-05 12:17:52 +00:00
Mirco Miranda ecfbff8197 PCX: support for more formats
Added support for:
- (R/O) 1 bit, 3 planes (ICONDOC.pcx) -> test case from internet archive
- (R/O) 2 bits, 1 planes (CGA_FSD.pcx) -> test case from internet archive
- (R/W) 8 bits, 4 planes (dice_rgba.pcx) -> supported by ImageMagick and GIMP 3

Fix write support for:
- Grayscale 8/16-bits (saved as indexed)
- Alpha 8 (saved as indexed)
- RGB 16-bits depth (saved as RGB 24/32)
2024-11-05 06:36:18 +00:00
Mirco Miranda 4dedd88c08 SCT: added read only support
I keep adding old formats to ensure interoperability with as many programs as possible...

This plugin adds read-only support for the Scitex SCT format only. This format is also supported by Photoshop in read and write (SCT test cases were created by Photoshop).

[Scitex HandShake Formats Specifications](/uploads/a3e213e48349d898b260375d6c052521/Scitex_HandShake_Formats.pdf)
2024-11-04 13:05:59 +00:00
Mirco MirandaandAlbert Astals Cid 0378bd67e1 TGA: Fixed GrayA image loading error
Gray TGA images with alpha were loading incorrectly and tests did not detect the error since the BW(A).TGA images were actually RGB(A) images.
2024-10-24 15:07:44 +00:00
Mirco Miranda b5d5abe0ea JXL improvements
Highlights of the patch:
- Supersede MR !249
- Added FP16 and FP32 images support thus preserving HDR values (read / write, required libjxl 0.9+).
- Added Gray8 and Gray16 support (read / write).
- Indexed images are saved as Gray8 when palette is gray scale.
- Binary images are saved as Gray8 (does JXL natively support binary images?).
- Simplified writing process by partially removing the use of additional buffers.
- Added XMP metadata support by decoding/encoding Boxes.
- Changed maximum image size in pixels in accordance with JXL feature level 5 (still limited to 256 megapixels).

Compatibility: 
- Older versions of this plugin load FP images correctly as UINT16 (obviously losing HDR info).
- HDR images saved with this patch are also loaded correctly by Gimp and Photoshop.
- Grayscale images saved with this patch are also loaded correctly by Gimp and Photoshop.

Compilation modifiers for cmake file:
- `JXL_HDR_PRESERVATION_DISABLED`: disable the FP support (behaves like previous versions).
- `JXL_DECODE_BOXES_DISABLED`: disable metadata reading (behaves like previous versions).
2024-10-11 12:42:42 +00:00
Mirco MirandaandAlbert Astals Cid ac1006cc66 JXR: Fixed image reading on sequential devices
The following changes are done:
- Fixed an error when copying image from sequential device
- Return error when the image exceed 4GB size on writing*
- Enabled JXR tests

(*) Note that when writing an image larger than 4GiB, the JXRLib does not give any error but the resulting saved image id wrong.
2024-10-09 21:34:32 +00:00
Mirco MirandaandAlbert Astals Cid 97120b2537 Simplified read/verify header process
Where possible, QIODevice::peek has been used instead of transactions or instead of using ungetchar() for sequential access devices and seek() for random access devices.

Furthermore:
- RAS format gained the ability of read on sequential devices.
- Removed unused code in XCF (still related to ungetchar and sequential devices).
- These changes should prevent errors like the ones fixed by MR !258
2024-10-06 17:26:25 +00:00
Mirco MirandaandChristoph Cullmann f7c8eaa140 FIxed comparison of unsigned expression
Fix of [Issue 9](https://invent.kde.org/frameworks/kimageformats/-/issues/9)

Same of MR !253 to solve the `Fix of [Issue 9](https://invent.kde.org/frameworks/kimageformats/-/issues/9)` when rebasing.
2024-09-15 15:00:11 +00:00
Mirco MirandaandAlbert Astals Cid 8588c053b6 XCF: fix crash 2024-08-27 21:52:16 +00:00
Mirco MirandaandAlbert Astals Cid 145dedf360 README update
Added some information about plugins and their behaviors (when they do particular things).
2024-08-26 15:18:57 +00:00
Mirco MirandaandAlbert Astals Cid 2405a09e36 RGB: added options support
- Added support for `Size` and `Format` options and slightly improved format detection from canRead().
- Removed conversion to ARGB32 on load (improved performace with RGBA images).
- Added result checks on writing.

With this MR, all plugins have minimal support for options.
2024-08-25 21:00:08 +00:00
Mirco Miranda d02dcb064b PCX: added options support
- Added support for ```Size``` and ```Format``` options and slightly improved format detection from canRead().
- Added PCXHEADER::isValid() method to consolidate header consistency checks in one place.
2024-08-17 06:40:29 +00:00
Mirco MirandaandAlbert Astals Cid 219d9cb2c2 JXL: added ImageTransformation option
Let Qt rotate the image when the ImageAutotransform option is set to true.

In tests it also solves the image size control with the value returned by the options with certain rotations.
2024-07-30 22:46:52 +00:00
Mirco Miranda 7a0d95af92 Renamed qoi.h to qoi_p.h 2023-08-12 23:47:29 +02:00
Mirco Miranda 4c3ade04dd Minor improvements 2023-08-12 09:03:56 +02:00
Mirco MirandaandAlbert Astals Cid d787c12727 RGB/SGI writer: fix alpha detection and image limit size 2023-05-10 11:43:21 +00:00
Mirco MirandaandAlbert Astals Cid c9fec5e408 TGA writer: fix alpha detection and performance improvements 2023-05-10 11:43:21 +00:00
Mirco Miranda f5a9dd46d2 Removed unused jxl.desktop file 2023-04-22 09:31:30 +02:00
Mirco MirandaandAlbert Astals Cid 085c9c4841 HDR format removed from RAW plugin 2023-01-30 21:58:36 +00:00
Mirco Miranda 01ab0876f1 Debug code removed 2023-01-22 11:04:48 +01:00
Mirco Miranda a67dcac7d1 LAB/CMYK conversion speed improved by ~10% 2023-01-22 10:57:54 +01:00
Mirco MirandaandAlbert Astals Cid f8bfdce285 CMakeLists: enable EXR test 2022-10-02 06:01:23 +00:00
Mirco MirandaandAlbert Astals Cid 524f083ee4 Added EXR test image 2022-10-02 06:01:23 +00:00
Mirco MirandaandAlbert Astals Cid c96ad6ba8a Fixes for sequential devices 2022-10-02 06:01:23 +00:00
Mirco Miranda 6f3a326cf8 LibRaw_QIODevice::seek() avoid seek on a sequential device 2022-09-21 02:14:55 +02:00
Mirco Miranda d881a7bbb1 LibRaw_QIODevice::seek() bounding checks 2022-09-20 19:44:08 +02:00
Mirco MirandaandNicolás Alvarez 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
Mirco MirandaandAlbert Astals Cid 21928300c6 Enables opening of XCF files with Width and/or Height greater than 32K 2022-09-13 17:57:57 +00:00
Mirco MirandaandAlbert Astals Cid 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
Mirco MirandaandAlbert Astals Cid 6f44c5c52a PSD: Improve alpha detection
BUG: 182496
2022-07-25 19:34:57 +00:00
Mirco MirandaandAlbert Astals Cid 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
Mirco MirandaandMirco Miranda b0a0bb1294 PSD header checks according to specifications 2022-06-30 06:56:21 +00:00
Mirco MirandaandMirco Miranda d4966d169b Minor code optimization 2022-06-30 06:56:21 +00:00
Mirco MirandaandMirco Miranda bf52896347 Minor code improvements (tested on all my MCYK PSD/PSB files) 2022-06-30 06:56:21 +00:00
Mirco MirandaandMirco Miranda c52ffa2227 Fix Alpha + testcase images 2022-06-30 06:56:21 +00:00
Mirco MirandaandMirco Miranda e4e386babf Fix regression 2022-06-30 06:56:21 +00:00
Mirco MirandaandMirco Miranda b47a9d7022 Basic support to CMYK 8/16 bits (not fully tested) 2022-06-30 06:56:21 +00:00