Skip to content

Remove JpegImageFile.load_djpeg() - #9916

Open
akx wants to merge 1 commit into
python-pillow:mainfrom
akx:remove-load-djpeg
Open

Remove JpegImageFile.load_djpeg()#9916
akx wants to merge 1 commit into
python-pillow:mainfrom
akx:remove-load-djpeg

Conversation

@akx

@akx akx commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Sibling of #9901 (_save_netpbm() for GIFs) and #9084 (save_cjpeg() for JPEGs).

This PR proposes to remove the undocumented JpegImageFile.load_djpeg() function and the testing infrastructure for it.

@akx
akx marked this pull request as ready for review August 27, 2026 17:14
@radarhere

Copy link
Copy Markdown
Member

Could you make an argument for why this should be removed, rather than documented?

@akx

akx commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

@radarhere Sure! _save_cjpeg(), the save counterpart of this function, was removed without much ceremony by you in #9084.

This function might have had some value if it was automatically put into place if actual JPEG loading functions weren't available, but that has never been the case, so, like #9084, I'd call this unused.

To match Hugo's research comment for #9084:

  • This was added (unused, untested and undocumented) in PIL 1.1.1 (2000): hugovk/PIL@44fbc52
  • It has since then materially been touched thereafter only to
  • The only callers for this are tests: the aforementioned security test and one added in d283f77.

Also, there's this 2014 comment expressing desire to get rid of this function, so maybe a decade and change later that could be done. #731 (comment)

EDIT: GitHub Code Search seems to find a single call from 10 years ago, from a seemingly abandoned mirror of https://launchpad.net/qa-regression-testing.

@radarhere radarhere added the Removal Removal of a feature, usually done in major releases label Aug 28, 2026
@radarhere

Copy link
Copy Markdown
Member

I think _save_cjpeg() starting with an underscore is a difference. I would suggest a deprecation, rather than a removal.

@akx

akx commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

Alright, I'll rework it to a deprecation when I get to a real terminal. But with that rationale, #9901 should be OK to merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Removal Removal of a feature, usually done in major releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants