Skip to content

Conversation

@Kakueeen
Copy link

@Kakueeen Kakueeen commented Aug 15, 2025

  • Fixed CMYK image display issue Fixed CMYK image display issue
  • update version to 6.5.30

Summary by Sourcery

Fix CMYK image display issue by converting loaded images to sRGB under Qt6 and update application version to 6.5.30.1 across packaging

Bug Fixes:

  • Convert loaded images to sRGB color space under Qt6 to correct CMYK and other non-sRGB format display issues

Chores:

  • Bump application version to 6.5.30.1 in all packaging files

Fixed CMYK image display issue

Log: Fixed CMYK image display issue
bug: https://pms.uniontech.com/bug-view-326991.html
as title

Log: update version
@github-actions
Copy link

TAG Bot

TAG: 6.5.30
EXISTED: no
DISTRIBUTION: unstable

@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. 文件名拼写错误

    • filehander.cpp 文件名中的 hander 应该是 handler
  2. 重复包含头文件

    • #include <QtGlobal>filehander.cpp 中被重复包含,应该删除重复的包含行。
  3. Qt版本检查

    • filehander.cpp 中,使用 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 进行了Qt版本检查,这是正确的做法。但是,建议在文件顶部添加一个注释,说明这个检查的目的是为了支持Qt6。
  4. 颜色空间转换函数

    • convertToSRgbColorSpace 函数实现中,使用了多个 qDebug()qWarning() 来记录转换过程和结果,这在调试阶段是有帮助的。但是,在生产环境中,这些调试信息可能会影响性能,建议在发布版本中移除或减少这些调试信息的输出。
  5. 异常处理

    • convertToSRgbColorSpace 函数中,使用了 try-catch 块来捕获转换过程中可能抛出的异常。这是一个好的做法,但是应该确保所有可能的异常都被捕获,并且有适当的错误处理逻辑。
  6. 颜色空间转换方法的选择

    • convertToSRgbColorSpace 函数中使用了三种不同的方法来转换颜色空间,每种方法都有不同的适用场景。但是,这些方法的选择和优先级应该根据具体的图像格式和颜色空间来确定,以确保转换的准确性和效率。
  7. 代码注释

    • convertToSRgbColorSpace 函数的注释应该更详细,包括对每个参数的说明、返回值的描述以及函数的用途。此外,注释应该使用中文,以便于理解和维护。
  8. 代码风格

    • convertToSRgbColorSpace 函数中的代码风格不一致,例如,qDebug()qWarning() 的输出格式应该统一,以提高代码的可读性。
  9. 错误处理

    • loadImage 函数中,如果图像加载失败,应该返回一个空图像而不是 img,以避免潜在的空指针引用。
  10. 版本号更新

    • linglong.yamldebian/changelog 文件中,版本号从 6.5.29.1 更新到 6.5.30.1,这是一个好的做法,但是应该确保所有相关的文档和配置文件都已经更新,以反映新的版本号。

以上是针对代码审查的几点意见,希望能够对您有所帮助。

@sourcery-ai
Copy link

sourcery-ai bot commented Aug 15, 2025

Reviewer's Guide

Adds a Qt6-only helper that converts non-sRGB images (including CMYK) to sRGB using multi-stage fallbacks and hooks it into the image loading flow; also bumps the package version to 6.5.30.1.

Sequence diagram for image loading and color space conversion in Qt6

sequenceDiagram
    participant FileHander
    participant QImage
    participant QColorSpace
    participant DebugLog
    FileHander->>QImage: loadImage(file)
    QImage-->>FileHander: img
    alt Qt6
        FileHander->>FileHander: convertToSRgbColorSpace(img)
        FileHander->>QColorSpace: Check color space
        QImage-->>DebugLog: Log color space info
        alt Needs conversion
            FileHander->>QImage: convertedToColorSpace(sRGB)
            QImage-->>DebugLog: Log conversion result
            alt Conversion fails
                FileHander->>QImage: Manual color space setting
                QImage-->>DebugLog: Log conversion result
                alt Conversion fails
                    FileHander->>QImage: Basic format conversion
                    QImage-->>DebugLog: Log conversion result
                end
            end
        end
        FileHander-->>QImage: Return converted image
    else Qt5
        FileHander->>QImage: convertToFormat(ARGB32)
        FileHander-->>QImage: Return converted image
    end
Loading

Class diagram for FileHander and color space conversion helper

classDiagram
    class FileHander {
        +QImage loadImage(QString file)
    }
    class FileHander_private
    FileHander --> FileHander_private
    class QImage {
        +bool isNull()
        +QColorSpace colorSpace()
        +QImage convertedToColorSpace(QColorSpace)
        +QImage copy()
        +void setColorSpace(QColorSpace)
        +QImage convertToFormat(Format)
        +Format format()
    }
    class QColorSpace {
        +static QColorSpace SRgb
        +bool isValid()
        +QString description()
    }
    FileHander ..> QImage
    FileHander ..> QColorSpace
    class convertToSRgbColorSpace {
        +static QImage convertToSRgbColorSpace(const QImage &image)
    }
    FileHander ..> convertToSRgbColorSpace
Loading

File-Level Changes

Change Details Files
Implement Qt6 sRGB color space conversion for images
  • Add QColorSpace include under Qt6 guard
  • Introduce convertToSRgbColorSpace helper with logging and three fallback methods
  • Wrap conversion code in QT_VERSION checks and apply it in loadImage()
src/service/filehander.cpp
Bump application version to 6.5.30.1
  • Update version in arm64/linglong.yaml
  • Update version in linglong.yaml
  • Update version in loong64/linglong.yaml
  • Reflect new version in debian/changelog
arm64/linglong.yaml
linglong.yaml
loong64/linglong.yaml
debian/changelog

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Kakueeen, lzwind

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Kakueeen
Copy link
Author

/forcemerge

@deepin-bot deepin-bot bot merged commit 664b994 into linuxdeepin:develop/snipe Aug 15, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants