This commit is contained in:
saqib mir
2026-07-23 13:53:22 +05:30
parent 626156642e
commit ffc846cf17
2 changed files with 4 additions and 17 deletions
+2 -17
View File
@@ -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);
+2
View File
@@ -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