mirror of
https://github.com/qpdf/qpdf.git
synced 2024-12-22 19:08:59 +00:00
checkpoint -- will have to finish another day
git-svn-id: svn+q:///qpdf/trunk@661 71b93d88-0707-0410-a8cf-f5a4172ac649
This commit is contained in:
parent
599daddb47
commit
2af08ee398
@ -8,8 +8,8 @@
|
|||||||
structure of file, attempt to decode all stream data.
|
structure of file, attempt to decode all stream data.
|
||||||
|
|
||||||
* libqpdf/QPDFWriter.cc (QPDFWriter::writeObject): In QDF mode,
|
* libqpdf/QPDFWriter.cc (QPDFWriter::writeObject): In QDF mode,
|
||||||
write a comment to the QDF file that indicates the object ID from
|
write a comment to the QDF file before each object that indicates
|
||||||
the original file.
|
the object ID of the corresponding object from the original file.
|
||||||
|
|
||||||
* libqpdf/QPDF.cc (QPDF::pipeStreamData): Issue a warning instead
|
* libqpdf/QPDF.cc (QPDF::pipeStreamData): Issue a warning instead
|
||||||
of failing if there is a problem found while decoding stream.
|
of failing if there is a problem found while decoding stream.
|
||||||
|
@ -455,7 +455,7 @@ int main(int argc, char* argv[])
|
|||||||
// 1 2 3 4 5 6 7 8
|
// 1 2 3 4 5 6 7 8
|
||||||
// 12345678901234567890123456789012345678901234567890123456789012345678901234567890
|
// 12345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||||
std::cout
|
std::cout
|
||||||
<< whoami << " version 2.0.4" << std::endl
|
<< whoami << " version 2.0.4+" << std::endl
|
||||||
<< "Copyright (c) 2005-2009 Jay Berkenbilt"
|
<< "Copyright (c) 2005-2009 Jay Berkenbilt"
|
||||||
<< std::endl
|
<< std::endl
|
||||||
<< "This software may be distributed under the terms of version 2 of the"
|
<< "This software may be distributed under the terms of version 2 of the"
|
||||||
@ -952,6 +952,8 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
if (! pdf.getWarnings().empty())
|
if (! pdf.getWarnings().empty())
|
||||||
{
|
{
|
||||||
|
std::cerr << whoami << ": operation succeeded with warnings;"
|
||||||
|
<< " resulting file may have some problems" << std::endl;
|
||||||
exit(EXIT_WARNING);
|
exit(EXIT_WARNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -282,8 +282,8 @@ check_pdf("no recompression",
|
|||||||
show_ntests();
|
show_ntests();
|
||||||
# ----------
|
# ----------
|
||||||
$td->notify("--- Object Stream Tests ---");
|
$td->notify("--- Object Stream Tests ---");
|
||||||
$n_tests += 36 * 6;
|
$n_tests += (36 * 4) + (12 * 2);
|
||||||
$n_compare_pdfs += 36;
|
$n_compare_pdfs += 36 + 12;
|
||||||
|
|
||||||
for (my $n = 16; $n <= 19; ++$n)
|
for (my $n = 16; $n <= 19; ++$n)
|
||||||
{
|
{
|
||||||
@ -294,13 +294,23 @@ for (my $n = 16; $n <= 19; ++$n)
|
|||||||
{
|
{
|
||||||
foreach my $qdf ('-qdf', '', '-encrypt "" x 128 --')
|
foreach my $qdf ('-qdf', '', '-encrypt "" x 128 --')
|
||||||
{
|
{
|
||||||
# 6 tests + 1 compare_pdfs
|
# 4 tests + 1 compare_pdfs * 36 cases
|
||||||
|
# 2 tests + 1 compare_pdfs * 12 cases
|
||||||
$td->runtest("object stream mode",
|
$td->runtest("object stream mode",
|
||||||
{$td->COMMAND =>
|
{$td->COMMAND =>
|
||||||
"qpdf --static-id $flags $qdf $in a.pdf"},
|
"qpdf --static-id $flags $qdf $in a.pdf"},
|
||||||
{$td->STRING => "",
|
{$td->STRING => "",
|
||||||
$td->EXIT_STATUS => 0});
|
$td->EXIT_STATUS => 0});
|
||||||
compare_pdfs("good$n.pdf", "a.pdf");
|
compare_pdfs("good$n.pdf", "a.pdf");
|
||||||
|
if ($qdf eq '-qdf')
|
||||||
|
{
|
||||||
|
$td->runtest("fix-qdf identity check",
|
||||||
|
{$td->COMMAND => "fix-qdf a.pdf >| b.pdf"},
|
||||||
|
{$td->STRING => "", $td->EXIT_STATUS => 0});
|
||||||
|
$td->runtest("compare files",
|
||||||
|
{$td->FILE => "a.pdf"},
|
||||||
|
{$td->FILE => "b.pdf"});
|
||||||
|
}
|
||||||
$td->runtest("convert to qdf",
|
$td->runtest("convert to qdf",
|
||||||
{$td->COMMAND =>
|
{$td->COMMAND =>
|
||||||
"qpdf --static-id -qdf -decrypt" .
|
"qpdf --static-id -qdf -decrypt" .
|
||||||
@ -313,12 +323,15 @@ for (my $n = 16; $n <= 19; ++$n)
|
|||||||
" -object-streams=disable a.pdf b.qdf"},
|
" -object-streams=disable a.pdf b.qdf"},
|
||||||
{$td->STRING => "",
|
{$td->STRING => "",
|
||||||
$td->EXIT_STATUS => 0});
|
$td->EXIT_STATUS => 0});
|
||||||
$td->runtest("compare files",
|
# XXX The comparison is broken because of the new original
|
||||||
{$td->FILE => "a.qdf"},
|
# object comments. We need a script that compares qpdfs
|
||||||
{$td->FILE => "b.qdf"});
|
# by normalizing those comments (like replacing the object
|
||||||
$td->runtest("fix-qdf identity check",
|
# IDs with nnn) and then diffs. That will work here and
|
||||||
{$td->COMMAND => "fix-qdf a.qdf >| b.pdf"},
|
# in some of the other failure cases. For the rest where
|
||||||
{$td->STRING => "", $td->EXIT_STATUS => 0});
|
# we're actually checking the qdf itself, we will need to
|
||||||
|
# store the new qdf files with the object IDs. That can't
|
||||||
|
# be done blindly -- we need to make sure the output is
|
||||||
|
# correct!
|
||||||
$td->runtest("compare files",
|
$td->runtest("compare files",
|
||||||
{$td->FILE => "a.qdf"},
|
{$td->FILE => "a.qdf"},
|
||||||
{$td->FILE => "b.qdf"});
|
{$td->FILE => "b.qdf"});
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
WARNING: append-page-content-damaged.pdf: offset 0: file is damaged
|
WARNING: append-page-content-damaged.pdf: offset 0: file is damaged
|
||||||
WARNING: append-page-content-damaged.pdf: can't find startxref
|
WARNING: append-page-content-damaged.pdf: can't find startxref
|
||||||
WARNING: Attempting to reconstruct cross-reference table
|
WARNING: Attempting to reconstruct cross-reference table
|
||||||
|
qpdf: operation succeeded with warnings; resulting file may have some problems
|
||||||
|
@ -2,3 +2,4 @@ WARNING: heifer.pdf: offset 0: file is damaged
|
|||||||
WARNING: heifer.pdf: offset 92741: xref not found
|
WARNING: heifer.pdf: offset 92741: xref not found
|
||||||
WARNING: Attempting to reconstruct cross-reference table
|
WARNING: Attempting to reconstruct cross-reference table
|
||||||
WARNING: heifer.pdf: offset 51: attempting to recover stream length
|
WARNING: heifer.pdf: offset 51: attempting to recover stream length
|
||||||
|
qpdf: operation succeeded with warnings; resulting file may have some problems
|
||||||
|
Loading…
Reference in New Issue
Block a user