Permalink
Browse files

Fix image decoder for PDFs (tested with U0300.pdf)

  • Loading branch information...
1 parent a4f3ff8 commit 84da5bead3842ba00b5df9ce7789b53c7567624d @gnachman committed Dec 5, 2016
Showing with 5 additions and 3 deletions.
  1. +5 −3 image_decoder/image_decoder.m
@@ -77,13 +77,14 @@ int main(int argc, const char * argv[]) {
}
serializableImage.size = imageSize;
+ BOOL isGIF = NO;
if (count > 1) {
syslog(LOG_DEBUG, "multiple frames found");
- BOOL isGIF = YES;
NSMutableArray *frameProperties = [NSMutableArray array];
+ isGIF = YES;
for (size_t i = 0; i < count; ++i) {
NSDictionary *gifProperties = GIFProperties(source, i);
- // TIFF files may have multiple pages, so make sure it's an animated GIF.
+ // TIFF and PDF files may have multiple pages, so make sure it's an animated GIF.
if (gifProperties) {
[frameProperties addObject:gifProperties];
} else {
@@ -117,7 +118,8 @@ int main(int argc, const char * argv[]) {
[serializableImage.delays addObject:@(totalDelay)];
}
}
- } else {
+ }
+ if (!isGIF) {
syslog(LOG_DEBUG, "adding decoded image");
[serializableImage.images addObject:image];
}

0 comments on commit 84da5be

Please sign in to comment.