aboutsummaryrefslogtreecommitdiffstats
path: root/examples/pdf-invert-images.cc
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-01-26 09:00:23 +0100
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-01-27 14:31:12 +0100
commit07db3200cb0ef058b8a66ece8d9757adfba49fd1 (patch)
tree084c94a5778581451bb42e5cd38fffeb36a12e2b /examples/pdf-invert-images.cc
parent710d2e54f0762b7702640766d33b7e0977ba69de (diff)
downloadqpdf-07db3200cb0ef058b8a66ece8d9757adfba49fd1.tar.zst
Remove some if statements and simplify some boolean expressions
Use QPDFObjectHandle::isNameAndEquals, isDictionaryOfType and isStreamOfType.
Diffstat (limited to 'examples/pdf-invert-images.cc')
-rw-r--r--examples/pdf-invert-images.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/pdf-invert-images.cc b/examples/pdf-invert-images.cc
index bb8541e3..b410bca5 100644
--- a/examples/pdf-invert-images.cc
+++ b/examples/pdf-invert-images.cc
@@ -167,9 +167,8 @@ int main(int argc, char* argv[])
// keys to determine the image type.
if (image.pipeStreamData(0, qpdf_ef_compress,
qpdf_dl_all) &&
- color_space.isName() &&
+ color_space.isNameAndEquals("/DeviceGray") &&
bits_per_component.isInteger() &&
- (color_space.getName() == "/DeviceGray") &&
(bits_per_component.getIntValue() == 8))
{
inv->registerImage(image, p);