Skip to content

fix: correct image format constant spelling - #32

Merged
deepin-bot[bot] merged 2 commits into
linuxdeepin:masterfrom
re2zero:bugfix
Dec 30, 2025
Merged

fix: correct image format constant spelling#32
deepin-bot[bot] merged 2 commits into
linuxdeepin:masterfrom
re2zero:bugfix

Conversation

@re2zero

@re2zero re2zero commented Dec 30, 2025

Copy link
Copy Markdown
Contributor

Updated the image format constant from 'JPG' to 'JPEG' to ensure
proper file format recognition and maintain consistency with standard
image format nomenclature in the scanning component.

Updated the image format constant from 'JPG' to 'JPEG' to ensure
proper file format recognition and maintain consistency with standard
image format nomenclature in the scanning component.

Log: correct image format constant spelling.
Bug: https://pms.uniontech.com/bug-view-345985.html
update version

Log: update version
@github-actions

Copy link
Copy Markdown

TAG Bot

TAG: 0.1.20
EXISTED: no
DISTRIBUTION: unstable

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

我来对这个diff进行审查:

  1. 语法逻辑:
  • 代码修改语法正确,只是将字符串常量"JPG"改为"JPEG"
  • 修改位置合理,在FORMATS常量数组中
  1. 代码质量:
  • 修改是有意义的,因为"JPEG"是更标准的格式名称
  • 使用static const定义格式列表是好的实践
  • 变量名FORMATS使用全大写符合常量命名规范
  1. 代码性能:
  • 这个修改不会对性能产生影响
  • 仍然使用QStringList存储格式列表,这是合理的实现方式
  1. 代码安全:
  • 修改不会引入任何安全风险
  • 只是字符串的修改,不涉及内存操作或其他安全问题

改进建议:

  1. 虽然将"JPG"改为"JPEG"更符合标准,但建议考虑:

    • 确保代码中其他使用这些格式的地方都做了相应修改
    • 确保用户界面显示的格式名称与实际保存的文件扩展名保持一致
    • 考虑是否需要同时支持"JPG"和"JPEG"两种格式名称,因为很多用户习惯使用JPG
  2. 建议添加注释说明:

// 支持的图像格式列表,使用标准格式名称
static const QStringList FORMATS = { "PNG", "JPEG", "BMP", "TIFF", "PDF", "OFD" };
  1. 考虑使用enum class来定义格式类型,这样可以提供更好的类型安全性:
enum class ImageFormat {
    PNG,
    JPEG,
    BMP,
    TIFF,
    PDF,
    OFD
};
  1. 建议在changelog中提供更详细的修改说明,说明为什么需要这个修改,以及这个修改可能带来的影响。

总的来说,这是一个简单但合理的修改,主要是为了使用更标准的格式名称。建议确保相关的代码和文档都保持一致。

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@re2zero

re2zero commented Dec 30, 2025

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot
deepin-bot Bot merged commit 71407fe into linuxdeepin:master Dec 30, 2025
15 checks passed
@re2zero
re2zero deleted the bugfix branch December 30, 2025 01:06
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