Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kimageformats for openSUSE:Factory checked in at 2022-04-11 23:47:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kimageformats (Old) and /work/SRC/openSUSE:Factory/.kimageformats.new.1900 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kimageformats" Mon Apr 11 23:47:14 2022 rev:105 rq:968170 version:5.93.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kimageformats/kimageformats.changes 2022-03-14 19:35:58.502047873 +0100 +++ /work/SRC/openSUSE:Factory/.kimageformats.new.1900/kimageformats.changes 2022-04-11 23:48:35.951512248 +0200 @@ -1,0 +2,13 @@ +Sun Apr 3 10:47:16 UTC 2022 - Christophe Giboudeaux <christo...@krop.fr> + +- Update to 5.93.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/frameworks/5/5.93.0 +- Changes since 5.92.0: + * Fix XCF parasites metadata in QImage and support to ICC profile + * avif: encoder speed 7->6 + * avif: fix jumpToImage + * avif: warn about non-recommended libavif configuration + +------------------------------------------------------------------- Old: ---- kimageformats-5.92.0.tar.xz kimageformats-5.92.0.tar.xz.sig New: ---- kimageformats-5.93.0.tar.xz kimageformats-5.93.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kimageformats.spec ++++++ --- /var/tmp/diff_new_pack.Wk0awh/_old 2022-04-11 23:48:36.487506121 +0200 +++ /var/tmp/diff_new_pack.Wk0awh/_new 2022-04-11 23:48:36.491506075 +0200 @@ -22,7 +22,7 @@ %if 0%{?suse_version} > 1500 || (0%{?is_opensuse} && 0%{?sle_version} >= 150300) %define with_heif 1 %endif -%define _tar_path 5.92 +%define _tar_path 5.93 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) @@ -30,7 +30,7 @@ # Only needed for the package signature condition %bcond_without released Name: kimageformats -Version: 5.92.0 +Version: 5.93.0 Release: 0 Summary: Image format plugins for Qt License: LGPL-2.1-or-later ++++++ kimageformats-5.92.0.tar.xz -> kimageformats-5.93.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kimageformats-5.92.0/CMakeLists.txt new/kimageformats-5.93.0/CMakeLists.txt --- old/kimageformats-5.92.0/CMakeLists.txt 2022-03-05 12:15:00.000000000 +0100 +++ new/kimageformats-5.93.0/CMakeLists.txt 2022-04-02 12:00:12.000000000 +0200 @@ -3,7 +3,7 @@ project(KImageFormats) include(FeatureSummary) -find_package(ECM 5.92.0 NO_MODULE) +find_package(ECM 5.93.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) Binary files old/kimageformats-5.92.0/autotests/read/xcf/fruktpilot_icc.png and new/kimageformats-5.93.0/autotests/read/xcf/fruktpilot_icc.png differ Binary files old/kimageformats-5.92.0/autotests/read/xcf/fruktpilot_icc.xcf and new/kimageformats-5.93.0/autotests/read/xcf/fruktpilot_icc.xcf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kimageformats-5.92.0/src/imageformats/avif.cpp new/kimageformats-5.93.0/src/imageformats/avif.cpp --- old/kimageformats-5.92.0/src/imageformats/avif.cpp 2022-03-05 12:15:00.000000000 +0100 +++ new/kimageformats-5.93.0/src/imageformats/avif.cpp 2022-04-02 12:00:12.000000000 +0200 @@ -446,6 +446,16 @@ return false; } + const char *encoder_name = avifCodecName(AVIF_CODEC_CHOICE_AUTO, AVIF_CODEC_FLAG_CAN_ENCODE); + if (!encoder_name) { + qWarning("Cannot save AVIF images because libavif was built without AV1 encoders!"); + return false; + } + + if (m_quality >= 100 && !avifCodecName(AVIF_CODEC_CHOICE_AOM, AVIF_CODEC_FLAG_CAN_ENCODE)) { + qWarning("You are using %s encoder. It is recommended to enable libAOM encoder in libavif for better near-lossless compression.", encoder_name); + } + int maxQuantizer = AVIF_QUANTIZER_WORST_QUALITY * (100 - qBound(0, m_quality, 100)) / 100; int minQuantizer = 0; int maxQuantizerAlpha = 0; @@ -738,7 +748,7 @@ encoder->maxQuantizerAlpha = maxQuantizerAlpha; } - encoder->speed = 7; + encoder->speed = 6; res = avifEncoderWrite(encoder, avif, &raw); avifEncoderDestroy(encoder); @@ -891,7 +901,8 @@ return false; } - if (imageNumber == m_decoder->imageCount) { // we are here already + if (imageNumber == m_decoder->imageIndex) { // we are here already + m_must_jump_to_next_image = false; return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kimageformats-5.92.0/src/imageformats/xcf.cpp new/kimageformats-5.93.0/src/imageformats/xcf.cpp --- old/kimageformats-5.92.0/src/imageformats/xcf.cpp 2022-03-05 12:15:00.000000000 +0100 +++ new/kimageformats-5.93.0/src/imageformats/xcf.cpp 2022-04-02 12:00:12.000000000 +0200 @@ -16,8 +16,9 @@ #include <QStack> #include <QVector> #include <QtEndian> -#include <stdlib.h> +#include <QColorSpace> +#include <stdlib.h> #include <string.h> #include "gimp_p.h" @@ -351,6 +352,8 @@ bool initialized; //!< Is the QImage initialized? QImage image; //!< final QImage + QHash<QString,QByteArray> parasites; //!< parasites data + XCFImage(void) : initialized(false) { @@ -405,6 +408,7 @@ bool composeTiles(XCFImage &xcf_image); void setGrayPalette(QImage &image); void setPalette(XCFImage &xcf_image, QImage &image); + void setImageParasites(const XCFImage &xcf_image, QImage &image); static void assignImageBytes(Layer &layer, uint i, uint j); bool loadHierarchy(QDataStream &xcf_io, Layer &layer); bool loadLevel(QDataStream &xcf_io, Layer &layer, qint32 bpp); @@ -665,6 +669,9 @@ return false; } + // The image was created: now I can set metadata and ICC color profile inside it. + setImageParasites(xcf_image, xcf_image.image); + *outImage = xcf_image.image; return true; } @@ -715,15 +722,15 @@ property.readBytes(tag, size); quint32 flags; - char *data = nullptr; + QByteArray data; property >> flags >> data; - if (tag && strncmp(tag, "gimp-comment", strlen("gimp-comment")) == 0) { - xcf_image.image.setText(QStringLiteral("Comment"), QString::fromUtf8(data)); - } + // WARNING: you cannot add metadata to QImage here because it can be null. + // Adding a metadata to a QImage when it is null, does nothing (metas are lost). + if(tag) // store metadata for future use + xcf_image.parasites.insert(QString::fromUtf8(tag), data); delete[] tag; - delete[] data; } break; @@ -1235,6 +1242,77 @@ } /*! + * Copy the parasites info to QImage. + * \param xcf_image XCF image containing the parasites read from the data stream. + * \param image image to apply the parasites data. + * \note Some comment taken from https://gitlab.gnome.org/GNOME/gimp/-/blob/master/devel-docs/parasites.txt + */ +void XCFImageFormat::setImageParasites(const XCFImage &xcf_image, QImage &image) +{ + auto&& p = xcf_image.parasites; + auto keys = p.keys(); + for (auto&& key : qAsConst(keys)) { + auto value = p.value(key); + if(value.isEmpty()) + continue; + + // "icc-profile" (IMAGE, PERSISTENT | UNDOABLE) + // This contains an ICC profile describing the color space the + // image was produced in. TIFF images stored in PhotoShop do + // oftentimes contain embedded profiles. An experimental color + // manager exists to use this parasite, and it will be used + // for interchange between TIFF and PNG (identical profiles) + if (key == QStringLiteral("icc-profile")) { + auto cs = QColorSpace::fromIccProfile(value); + if(cs.isValid()) + image.setColorSpace(cs); + continue; + } + + // "gimp-comment" (IMAGE, PERSISTENT) + // Standard GIF-style image comments. This parasite should be + // human-readable text in UTF-8 encoding. A trailing \0 might + // be included and is not part of the comment. Note that image + // comments may also be present in the "gimp-metadata" parasite. + if (key == QStringLiteral("gimp-comment")) { + value.replace('\0', QByteArray()); + image.setText(QStringLiteral("Comment"), QString::fromUtf8(value)); + continue; + } + + // "gimp-image-metadata" + // Saved by GIMP 2.10.30 but it is not mentioned in the specification. + // It is an XML block with the properties set using GIMP. + if (key == QStringLiteral("gimp-image-metadata")) { + // NOTE: I arbitrary defined the metadata "XML:org.gimp.xml" because it seems + // a GIMP proprietary XML format (no xmlns defined) + value.replace('\0', QByteArray()); + image.setText(QStringLiteral("XML:org.gimp.xml"), QString::fromUtf8(value)); + continue; + } + +#if 0 // Unable to generate it using latest GIMP version + // "gimp-metadata" (IMAGE, PERSISTENT) + // The metadata associated with the image, serialized as one XMP + // packet. This metadata includes the contents of any XMP, EXIF + // and IPTC blocks from the original image, as well as + // user-specified values such as image comment, copyright, + // license, etc. + if (key == QStringLiteral("gimp-metadata")) { + // NOTE: "XML:com.adobe.xmp" is the meta set by Qt reader when an + // XMP packet is found (e.g. when reading a PNG saved by Photoshop). + // I reused the same key because some programs could search for it. + value.replace('\0', QByteArray()); + image.setText(QStringLiteral("XML:com.adobe.xmp"), QString::fromUtf8(value)); + continue; + } +#endif + + } +} + + +/*! * Copy the bytes from the tile buffer into the image tile QImage, taking into * account all the myriad different modes. * \param layer layer containing the tile buffer and the image tile matrix.