pypdf icon indicating copy to clipboard operation
pypdf copied to clipboard

Image handling: Mode from RGB path will always be overwritten

Open stefan6419846 opened this issue 5 months ago • 2 comments

We have the following section for image mode retrieval: https://github.com/py-pdf/pypdf/blob/d9649d0d5f22c2710da238aa555c7dfdf8ff6eb3/pypdf/_xobj_image_helpers.py#L348-L375

As far as I can tell from the execution flow, the value of line 356 will always be overwritten by the following conditions.

The offending change is https://github.com/py-pdf/pypdf/commit/68e2cf0c25961f8ae5277dfc9ffa8978c00e3305#diff-185702ddcfbf2e4a9ef7106622bb77505eacae032966bba39c65ffb9cd0f9bc7L667 from #1834.

We should check whether this causes any harm and evaluate a fix with a corresponding fix.

stefan6419846 avatar Jul 09 '25 13:07 stefan6419846

Hi there, my team and i would like to work on this issue if that is alright with you?

nevin-lim avatar Oct 03 '25 09:10 nevin-lim

No need to ask for permission to work on issues as long as there is no reason like somebody already having indicated working on it beforehand and actually having made progress.

stefan6419846 avatar Oct 03 '25 10:10 stefan6419846