From a6c2c345e64f9d80c1896be8ce50fb283a54886c Mon Sep 17 00:00:00 2001 From: danblooomberg Date: Thu, 13 Jun 2024 18:47:33 -0700 Subject: [PATCH] Fix leptonica issue #747 * genImpliedFileFormat() is not returning IFF_PNM for .pbm extensions * augmented the extension_map array * also added mappings for .pgm and .j2k --- src/writefile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/writefile.c b/src/writefile.c index ceabeed63..e13e1b506 100644 --- a/src/writefile.c +++ b/src/writefile.c @@ -159,9 +159,12 @@ static const struct ExtensionMap extension_map[] = { ".tif", IFF_TIFF }, { ".tiff", IFF_TIFF }, { ".tiffg4", IFF_TIFF_G4 }, + { ".pbm", IFF_PNM }, + { ".pgm", IFF_PNM }, { ".pnm", IFF_PNM }, { ".gif", IFF_GIF }, { ".jp2", IFF_JP2 }, + { ".j2k", IFF_JP2 }, { ".ps", IFF_PS }, { ".pdf", IFF_LPDF }, { ".webp", IFF_WEBP } };