Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Speculation: Ghostscript 9.56 new PDF interpreter breaks things
  • Loading branch information
James Barlow committed Apr 4, 2022
1 parent 41efd3b commit 84b9d4d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/ocrmypdf/_exec/ghostscript.py
Expand Up @@ -217,15 +217,19 @@ def generate_pdfa(
# Older versions of Ghostscript expect a leading slash in
# sColorConversionStrategy, newer ones should not have it. See Ghostscript
# git commit fe1c025d.
strategy = ('/' + strategy) if version() < '9.19' else strategy
gs_version = version()
strategy = ('/' + strategy) if gs_version < '9.19' else strategy

if version() == '9.23':
if gs_version == '9.23':
# 9.23: added JPEG passthrough as a new feature, but with a bug that
# incorrectly formats some images. Fixed as of 9.24. So we disable this
# feature for 9.23.
# https://bugs.ghostscript.com/show_bug.cgi?id=699216
compression_args.append('-dPassThroughJPEGImages=false')

elif gs_version == '9.56':
# 9.56 breaks our OCR...?
compression_args.append('-dNEWPDF=false')

# nb no need to specify ProcessColorModel when ColorConversionStrategy
# is set; see:
# https://bugs.ghostscript.com/show_bug.cgi?id=699392
Expand Down

3 comments on commit 84b9d4d

@mjg
Copy link

@mjg mjg commented on 84b9d4d Sep 7, 2022

Choose a reason for hiding this comment

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

As there is no reference to an issue: What is broken by gs 9.56?
A later commit narrows this down to 9.56.0. Does 9.56.1 unbreak what you considered broken in 9.56.0?
(Local tests here with ocrmypdf and 9.56.1 work fine.)

@jbarlow83
Copy link
Collaborator

@jbarlow83 jbarlow83 commented on 84b9d4d Sep 7, 2022 via email

Choose a reason for hiding this comment

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

@mjg
Copy link

@mjg mjg commented on 84b9d4d Sep 7, 2022

Choose a reason for hiding this comment

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

Perfect, thanks for the pointer!
It also means another report that we have in Fedora has a different cause.

Please sign in to comment.