Closed trevorprinn closed 9 years ago
Technically a 1bpp file is indexed. It's either 0 or 1. In fact, a 1bpp file isn't even necessarily black and white.
I would suspect that the index detection has an error then. Do you have an example of the dictionary header for the images. Or optionally send me the file (or a page from the file in question) so that I can inspect it.
I've uploaded the file to http://www.mediafire.com/view/bee6b00j31gs6vx/THE_NEW_REAL_BOOK_VOL.I.pdf
Thanks. I got the file so you can remove the link if there might be copyright problems, etc.
I'll try to look at it tomorrow if time permits, otherwise sometime next week (or this weekend if I get bored...).
Looking over things, the fix you made was appropriate. Thanks! Updated NuGet packages.
I'm extracting all the images from a PDF (actually a jazz real book) where most of the pages are 1bbp. GetImages failed in PdfDictionaryExtensions.GetPixelFormat with "The specified pixel depth '1' is not supported". It seemed a bit odd that it would really need to be indexed so I tried taking out
if (isIndexed) { return (PixelFormat.Format1bppIndexed);}
and replacing it with justreturn (PixelFormat.Format1bppIndexed);
That seems to work fine, at least on the pdf I've tested it on so far.