Repository navigation
fix(office): preserve CMYK pictures with ICC-aware PNG conversion - #4598
Merged
PeterStaar-IBM merged 1 commit intoOct 6, 2026
Merged
Conversation
Signed-off-by: guoyuchen <2273345925@qq.com>
Contributor
|
✅ DCO Check Passed Thanks @iluv7, all your commits are properly signed off. 🎉 |
Contributor
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Oct 8, 2026
PeterStaar-IBM
pushed a commit
that referenced
this pull request
Oct 8, 2026
PNG can't store CMYK, so ImageRef.from_pil raised for a CMYK picture in an ODT, ODP or ODS file, and _add_odf_images skipped the picture with only a debug log. Normalize the picture first, like the Word and PowerPoint backends do since #4598. Resolves #4665 Signed-off-by: usmanmateen <usmanmateen255@gmail.com>
PeterStaar-IBM
pushed a commit
that referenced
this pull request
Oct 8, 2026
#4664) Unlike the Word and PowerPoint backends since #4598, the Excel backend did not normalize pictures before PNG serialization. A CMYK picture loaded by openpyxl failed in ImageRef.from_pil and was dropped, and the PNG probe in the unsupported-image scan took the same picture for an EMF/WMF image and rendered it through LibreOffice. Normalize the picture in both paths, so it is kept once, as stored, with or without LibreOffice. Resolves #4658 Signed-off-by: usmanmateen <usmanmateen255@gmail.com>
This was referenced Oct 8, 2026
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
CMYK JPEG pictures are lost during PowerPoint conversion because Pillow cannot save CMYK images as PNG. Word hits the same error and loses the image data when LibreOffice is unavailable, although conversion still reports success.
Add a shared image-mode helper before PNG serialization in both backends. Use embedded ICC profiles to convert unsupported modes to sRGB, with an RGB fallback for absent or unusable profiles. Convert PA images to RGBA to preserve per-pixel alpha, and leave PNG-compatible modes unchanged.
Validation:
make validatepassed.Issue resolved by this Pull Request:
Resolves #4586
Checklist: