Skip to content

Conversation

@radarhere
Copy link
Member

def _save_cjpeg(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None:
# ALTERNATIVE: handle JPEGs via the IJG command line utilities.
tempfile = im._dump()
subprocess.check_call(["cjpeg", "-outfile", filename, tempfile])
try:
os.unlink(tempfile)
except OSError:
pass

While we test this method, it is never actually called anywhere, so I'm going to suggest removing it.

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Only shows up twice in the history.

Was added but unused in PIL 1.1.1 in 2000: https://github.com/hugovk/PIL/blame/645e19c47556b9086c0d0fdccc1db1b9e6f79f7f/PIL/JpegImagePlugin.py#L473

Part of the fork in 2010: 9a640e3

Tests added in 2014: d283f77

@hugovk hugovk merged commit 7b1ba29 into python-pillow:main Jul 11, 2025
74 checks passed
@radarhere radarhere deleted the save_cjpeg branch July 11, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants