fix
This commit is contained in:
@@ -262,7 +262,8 @@ std::string decodedStream(QPDFObjectHandle contents) {
|
||||
}
|
||||
|
||||
std::vector<std::unique_ptr<ContentObject>> buildPageObjects(QPDFObjectHandle page) {
|
||||
Lexer lexer(decodedStream(page.getKey("/Contents")));
|
||||
std::string decodedContent = decodedStream(page.getKey("/Contents"));
|
||||
Lexer lexer(decodedContent);
|
||||
auto tokens = lexer.tokenize();
|
||||
ContentParser parser(tokens);
|
||||
auto operations = parser.parse();
|
||||
@@ -437,22 +438,6 @@ TEST(ImageXObjectVerification, JpegLogoAndPhotoDecodeAndMatchPdfiumRender) {
|
||||
QPDF qpdf;
|
||||
auto objects = buildFirstPageObjects(qpdf, pdf);
|
||||
|
||||
// DEBUG: Parse again just to print
|
||||
{
|
||||
Lexer lexer(content);
|
||||
auto tokens = lexer.tokenize();
|
||||
ContentParser parser(tokens);
|
||||
auto operations = parser.parse();
|
||||
for (const auto& op : operations) {
|
||||
std::cout << "DEBUG OP: " << op.op << " operands: ";
|
||||
for (const auto& operand : op.operands) {
|
||||
if (operand->type == AstNodeType::Number) std::cout << operand->numberValue << " ";
|
||||
else if (operand->type == AstNodeType::Name) std::cout << "/" << operand->stringValue << " ";
|
||||
else std::cout << "[type " << (int)operand->type << "] ";
|
||||
}
|
||||
std::cout << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
auto images = imageObjects(objects);
|
||||
ASSERT_EQ(images.size(), 2u);
|
||||
|
||||
@@ -12,6 +12,7 @@ RUN apt-get update \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
git \
|
||||
fonts-liberation \
|
||||
libjpeg-dev \
|
||||
zlib1g-dev \
|
||||
libpng-dev \
|
||||
@@ -91,6 +92,7 @@ RUN apt-get update \
|
||||
libjpeg62-turbo \
|
||||
zlib1g \
|
||||
libpng16-16 \
|
||||
fonts-liberation \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install the extension globally so it's not shadowed by the volume mount ./gateway:/home/app
|
||||
|
||||
Reference in New Issue
Block a user