Replace magic Ghostscript raster device strings with StrEnum

This commit is contained in:
James R. Barlow
2026-01-20 10:44:25 -08:00
parent c818ad5e75
commit bc745d4d81
7 changed files with 44 additions and 21 deletions
+2 -1
View File
@@ -19,6 +19,7 @@ from ocrmypdf._exec import jbig2enc, pngquant
from ocrmypdf._exec.ghostscript import rasterize_pdf
from ocrmypdf.helpers import IMG2PDF_KWARGS, Resolution
from ocrmypdf.optimize import PdfImage, extract_image_filter
from ocrmypdf.pluginspec import GhostscriptRasterDevice
from tests.conftest import check_ocrmypdf
needs_pngquant = pytest.mark.skipif(
@@ -54,7 +55,7 @@ def test_mono_not_inverted(resources, outdir):
rasterize_pdf(
outdir / 'out.pdf',
outdir / 'im.png',
raster_device='pnggray',
raster_device=GhostscriptRasterDevice.PNGGRAY,
raster_dpi=Resolution(10, 10),
)