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.
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
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
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
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
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()));
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.