[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:42:35 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=9389aaa

The following commit has been merged in the master branch:
commit 9389aaa89a93fa22cd84daa98111371d06019702
Author: vog <vog at notjusthosting.com>
Date:   Wed Jul 13 01:51:20 2011 +0000

    Implemented handling of %%Include DSC comments in EpsImage, adjusted and added test cases
---
 src/epsimage.cpp                                   | 14 +---
 ...of.eps => eps-flat_minimal_includeresource.eps} |  4 +-
 ...=> eps-flat_minimal_includeresource.eps.delxmp} |  3 +
 ...=> eps-flat_minimal_includeresource.eps.newxmp} |  3 +
 ...ol.xmp => eps-flat_minimal_includeresource.xmp} |  0
 ...-nested_minimal_begindocument-at-page-start.eps | 14 ++++
 test/data/eps/eps-nested_minimal_begindocument.eps | 16 ++++
 ...sted_minimal_includedocument-at-page-start.eps} |  3 +-
 ...nimal_includedocument-at-page-start.eps.delxmp} |  2 +
 ...nimal_includedocument-at-page-start.eps.newxmp} |  2 +
 ...sted_minimal_includedocument-at-page-start.xmp} |  0
 ... eps-nested_minimal_includedocument.eps.delxmp} |  4 +
 ... eps-nested_minimal_includedocument.eps.newxmp} |  4 +
 ....xmp => eps-nested_minimal_includedocument.xmp} |  0
 test/data/eps/eps-test.out                         | 91 +++++++++++++++++++++-
 15 files changed, 140 insertions(+), 20 deletions(-)

diff --git a/src/epsimage.cpp b/src/epsimage.cpp
index b8d5cae..239220b 100644
--- a/src/epsimage.cpp
+++ b/src/epsimage.cpp
@@ -451,7 +451,7 @@ namespace {
                     #endif
                 }
             }
-            if (line == "%%EOF" || (line.size() >= 1 && line[0] != '%')) {
+            if (line == "%%EOF" || startsWith(line, "%%IncludeDocument:") || startsWith(line, "%%BeginDocument:") || (line.size() >= 1 && line[0] != '%')) {
                 if (posPage == posEndEps && posEndComments != posEndEps && !inDefaultsOrPrologOrSetup && !inRemovableEmbedding && !onlyWhitespaces(line)) {
                     posPage = startPos;
                     implicitPage = true;
@@ -542,12 +542,6 @@ namespace {
             } else if (line == "%%EOF") {
                 posEof = startPos;
             } else if (startsWith(line, "%%BeginDocument:")) {
-                if (posEndPageSetup == posEndEps) {
-                    #ifndef SUPPRESS_WARNINGS
-                    EXV_WARNING << "Nested document at invalid position (before explicit or implicit EndPageSetup): " << startPos << "
";
-                    #endif
-                    throw Error(write ? 21 : 14);
-                }
                 // TODO: Add support for nested documents!
                 #ifndef SUPPRESS_WARNINGS
                 EXV_WARNING << "Nested documents are currently not supported. Found nested document at position: " << startPos << "
";
@@ -564,12 +558,6 @@ namespace {
                 EXV_WARNING << "Unable to handle multiple PostScript pages. Found second page at position: " << startPos << "
";
                 #endif
                 throw Error(write ? 21 : 14);
-            } else if (startsWith(line, "%%Include")) {
-                #ifndef SUPPRESS_WARNINGS
-                EXV_WARNING << "Unable to handle PostScript %%Include DSC comments yet. Please provide your "
-                               "sample EPS file to the Exiv2 project: http://dev.exiv2.org/projects/exiv2
";
-                #endif
-                throw Error(write ? 21 : 14);
             } else {
                 #ifdef DEBUG
                 significantLine = false;
diff --git a/test/data/eps/eps-flat_minimal-eof.eps b/test/data/eps/eps-flat_minimal_includeresource.eps
similarity index 65%
copy from test/data/eps/eps-flat_minimal-eof.eps
copy to test/data/eps/eps-flat_minimal_includeresource.eps
index 86375c6..17bd31a 100644
--- a/test/data/eps/eps-flat_minimal-eof.eps
+++ b/test/data/eps/eps-flat_minimal_includeresource.eps
@@ -1,7 +1,9 @@
 %!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 5 5 105 105
+%%DocumentNeededResources: font Symbol
+
+%%IncludeResource: font Symbol
 10 setlinewidth
 10 10 moveto
 0 90 rlineto 90 0 rlineto 0 -90 rlineto closepath
 stroke
-%%EOF
diff --git a/test/data/eps/eps-flat_minimal-eof.eps.delxmp b/test/data/eps/eps-flat_minimal_includeresource.eps.delxmp
similarity index 80%
copy from test/data/eps/eps-flat_minimal-eof.eps.delxmp
copy to test/data/eps/eps-flat_minimal_includeresource.eps.delxmp
index 64ff87c..e0d2705 100644
--- a/test/data/eps/eps-flat_minimal-eof.eps.delxmp
+++ b/test/data/eps/eps-flat_minimal_includeresource.eps.delxmp
@@ -1,10 +1,13 @@
 %!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 5 5 105 105
+%%DocumentNeededResources: font Symbol
 %ADO_ContainsXMP: NoMain
 %%Pages: 1
 %Exiv2Version: _Exiv2Version_
 %Exiv2Website: http://www.exiv2.org/
 %%EndComments
+
+%%IncludeResource: font Symbol
 %%Page: 1 1
 %%EndPageComments
 10 setlinewidth
diff --git a/test/data/eps/eps-flat_minimal-eof.eps.newxmp b/test/data/eps/eps-flat_minimal_includeresource.eps.newxmp
similarity index 98%
copy from test/data/eps/eps-flat_minimal-eof.eps.newxmp
copy to test/data/eps/eps-flat_minimal_includeresource.eps.newxmp
index f9f1be0..09dce4c 100644
--- a/test/data/eps/eps-flat_minimal-eof.eps.newxmp
+++ b/test/data/eps/eps-flat_minimal_includeresource.eps.newxmp
@@ -1,11 +1,14 @@
 %!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 5 5 105 105
+%%DocumentNeededResources: font Symbol
 %%LanguageLevel: 2
 %ADO_ContainsXMP: MainFirst
 %%Pages: 1
 %Exiv2Version: _Exiv2Version_
 %Exiv2Website: http://www.exiv2.org/
 %%EndComments
+
+%%IncludeResource: font Symbol
 %%Page: 1 1
 %%EndPageComments
 %%BeginPageSetup
diff --git a/test/data/eps/eps-flat_empty-eof-noeol.xmp b/test/data/eps/eps-flat_minimal_includeresource.xmp
similarity index 100%
copy from test/data/eps/eps-flat_empty-eof-noeol.xmp
copy to test/data/eps/eps-flat_minimal_includeresource.xmp
diff --git a/test/data/eps/eps-nested_minimal_begindocument-at-page-start.eps b/test/data/eps/eps-nested_minimal_begindocument-at-page-start.eps
new file mode 100644
index 0000000..57462d6
--- /dev/null
+++ b/test/data/eps/eps-nested_minimal_begindocument-at-page-start.eps
@@ -0,0 +1,14 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%BoundingBox: 5 5 105 105
+%%BeginDocument: dummy_document.eps
+%!PS-Adobe-3.0 EPSF-3.0
+%%BoundingBox: 25 25 85 85
+20 setlinewidth
+35 35 moveto
+0 40 rlineto 40 0 rlineto 0 -40 rlineto closepath
+stroke
+%%EndDocument
+10 setlinewidth
+10 10 moveto
+0 90 rlineto 90 0 rlineto 0 -90 rlineto closepath
+stroke
diff --git a/test/data/eps/eps-nested_minimal_begindocument.eps b/test/data/eps/eps-nested_minimal_begindocument.eps
new file mode 100644
index 0000000..f65e4e7
--- /dev/null
+++ b/test/data/eps/eps-nested_minimal_begindocument.eps
@@ -0,0 +1,16 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%BoundingBox: 5 5 105 105
+save
+%%BeginDocument: dummy_document.eps
+%!PS-Adobe-3.0 EPSF-3.0
+%%BoundingBox: 25 25 85 85
+20 setlinewidth
+35 35 moveto
+0 40 rlineto 40 0 rlineto 0 -40 rlineto closepath
+stroke
+%%EndDocument
+restore
+10 setlinewidth
+10 10 moveto
+0 90 rlineto 90 0 rlineto 0 -90 rlineto closepath
+stroke
diff --git a/test/data/eps/eps-nested_minimal_includedocument.eps b/test/data/eps/eps-nested_minimal_includedocument-at-page-start.eps
similarity index 94%
copy from test/data/eps/eps-nested_minimal_includedocument.eps
copy to test/data/eps/eps-nested_minimal_includedocument-at-page-start.eps
index 727804a..10f14c2 100644
--- a/test/data/eps/eps-nested_minimal_includedocument.eps
+++ b/test/data/eps/eps-nested_minimal_includedocument-at-page-start.eps
@@ -1,9 +1,8 @@
 %!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 5 5 105 105
 %%DocumentNeededResources: dummy_document.eps
-save
+%%EndComments
 %%IncludeDocument: dummy_document.eps
-restore
 10 setlinewidth
 10 10 moveto
 0 90 rlineto 90 0 rlineto 0 -90 rlineto closepath
diff --git a/test/data/eps/eps-flat_minimal-eof.eps.delxmp b/test/data/eps/eps-nested_minimal_includedocument-at-page-start.eps.delxmp
similarity index 77%
copy from test/data/eps/eps-flat_minimal-eof.eps.delxmp
copy to test/data/eps/eps-nested_minimal_includedocument-at-page-start.eps.delxmp
index 64ff87c..bb0e14f 100644
--- a/test/data/eps/eps-flat_minimal-eof.eps.delxmp
+++ b/test/data/eps/eps-nested_minimal_includedocument-at-page-start.eps.delxmp
@@ -1,5 +1,6 @@
 %!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 5 5 105 105
+%%DocumentNeededResources: dummy_document.eps
 %ADO_ContainsXMP: NoMain
 %%Pages: 1
 %Exiv2Version: _Exiv2Version_
@@ -7,6 +8,7 @@
 %%EndComments
 %%Page: 1 1
 %%EndPageComments
+%%IncludeDocument: dummy_document.eps
 10 setlinewidth
 10 10 moveto
 0 90 rlineto 90 0 rlineto 0 -90 rlineto closepath
diff --git a/test/data/eps/eps-flat_minimal-eof.eps.newxmp b/test/data/eps/eps-nested_minimal_includedocument-at-page-start.eps.newxmp
similarity index 97%
copy from test/data/eps/eps-flat_minimal-eof.eps.newxmp
copy to test/data/eps/eps-nested_minimal_includedocument-at-page-start.eps.newxmp
index f9f1be0..4b94181 100644
--- a/test/data/eps/eps-flat_minimal-eof.eps.newxmp
+++ b/test/data/eps/eps-nested_minimal_includedocument-at-page-start.eps.newxmp
@@ -1,5 +1,6 @@
 %!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 5 5 105 105
+%%DocumentNeededResources: dummy_document.eps
 %%LanguageLevel: 2
 %ADO_ContainsXMP: MainFirst
 %%Pages: 1
@@ -58,6 +59,7 @@
     /Metadata {Exiv2_metadata_stream} def currentdict end /BDC Exiv2_pdfmark
 %Exiv2EndXMP
 %%EndPageSetup
+%%IncludeDocument: dummy_document.eps
 10 setlinewidth
 10 10 moveto
 0 90 rlineto 90 0 rlineto 0 -90 rlineto closepath
diff --git a/test/data/eps/eps-flat_empty-eof-noeol.xmp b/test/data/eps/eps-nested_minimal_includedocument-at-page-start.xmp
similarity index 100%
copy from test/data/eps/eps-flat_empty-eof-noeol.xmp
copy to test/data/eps/eps-nested_minimal_includedocument-at-page-start.xmp
diff --git a/test/data/eps/eps-flat_minimal-eof.eps.delxmp b/test/data/eps/eps-nested_minimal_includedocument.eps.delxmp
similarity index 74%
copy from test/data/eps/eps-flat_minimal-eof.eps.delxmp
copy to test/data/eps/eps-nested_minimal_includedocument.eps.delxmp
index 64ff87c..9c1d4f7 100644
--- a/test/data/eps/eps-flat_minimal-eof.eps.delxmp
+++ b/test/data/eps/eps-nested_minimal_includedocument.eps.delxmp
@@ -1,5 +1,6 @@
 %!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 5 5 105 105
+%%DocumentNeededResources: dummy_document.eps
 %ADO_ContainsXMP: NoMain
 %%Pages: 1
 %Exiv2Version: _Exiv2Version_
@@ -7,6 +8,9 @@
 %%EndComments
 %%Page: 1 1
 %%EndPageComments
+save
+%%IncludeDocument: dummy_document.eps
+restore
 10 setlinewidth
 10 10 moveto
 0 90 rlineto 90 0 rlineto 0 -90 rlineto closepath
diff --git a/test/data/eps/eps-flat_minimal-eof.eps.newxmp b/test/data/eps/eps-nested_minimal_includedocument.eps.newxmp
similarity index 97%
copy from test/data/eps/eps-flat_minimal-eof.eps.newxmp
copy to test/data/eps/eps-nested_minimal_includedocument.eps.newxmp
index f9f1be0..fe31658 100644
--- a/test/data/eps/eps-flat_minimal-eof.eps.newxmp
+++ b/test/data/eps/eps-nested_minimal_includedocument.eps.newxmp
@@ -1,5 +1,6 @@
 %!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 5 5 105 105
+%%DocumentNeededResources: dummy_document.eps
 %%LanguageLevel: 2
 %ADO_ContainsXMP: MainFirst
 %%Pages: 1
@@ -58,6 +59,9 @@
     /Metadata {Exiv2_metadata_stream} def currentdict end /BDC Exiv2_pdfmark
 %Exiv2EndXMP
 %%EndPageSetup
+save
+%%IncludeDocument: dummy_document.eps
+restore
 10 setlinewidth
 10 10 moveto
 0 90 rlineto 90 0 rlineto 0 -90 rlineto closepath
diff --git a/test/data/eps/eps-flat_empty-eof-noeol.xmp b/test/data/eps/eps-nested_minimal_includedocument.xmp
similarity index 100%
copy from test/data/eps/eps-flat_empty-eof-noeol.xmp
copy to test/data/eps/eps-nested_minimal_includedocument.xmp
diff --git a/test/data/eps/eps-test.out b/test/data/eps/eps-test.out
index da30296..84a2690 100644
--- a/test/data/eps/eps-test.out
+++ b/test/data/eps/eps-test.out
@@ -291,6 +291,31 @@ Exit code: 0
 Command: exiv2 -f -ex eps-flat_minimal_exiftool-8.56.eps
 Exit code: 0
 
+-----> eps-flat_minimal_includeresource.eps <-----
+
+Command: exiv2 -u -pa eps-flat_minimal_includeresource.eps
+Exit code: 253
+
+Command: exiv2 -dx eps-flat_minimal_includeresource.eps
+Exit code: 0
+
+Command: exiv2 -f -ex eps-flat_minimal_includeresource.eps
+Exit code: 0
+
+Restore: eps-flat_minimal_includeresource.eps
+
+Command: exiv2 -f -eX eps-flat_minimal_includeresource.eps
+Exit code: 0
+
+Command: exiv2 -ix eps-flat_minimal_includeresource.eps
+Exit code: 0
+
+Command: (2) exiv2 -ix eps-flat_minimal_includeresource.eps
+Exit code: 0
+
+Command: exiv2 -f -ex eps-flat_minimal_includeresource.eps
+Exit code: 0
+
 -----> eps-flat_minimal_irremovable-xmp-after-endpagesetup.eps <-----
 
 Command: exiv2 -u -pa eps-flat_minimal_irremovable-xmp-after-endpagesetup.eps
@@ -3523,14 +3548,72 @@ Exit code: 0
 Command: exiv2 -f -ex eps-flat_photoshop-e9-win_exiv2.eps
 Exit code: 0
 
------> eps-nested_minimal_includedocument.eps <-----
+-----> eps-nested_minimal_begindocument-at-page-start.eps <-----
 
-Command: exiv2 -u -pa eps-nested_minimal_includedocument.eps
-Warning: Unable to handle PostScript %%Include DSC comments yet. Please provide your sample EPS file to the Exiv2 project: http://dev.exiv2.org/projects/exiv2
-Exiv2 exception in print action for file eps-nested_minimal_includedocument.eps:
+Command: exiv2 -u -pa eps-nested_minimal_begindocument-at-page-start.eps
+Warning: Nested document at invalid position (before explicit or implicit EndPageSetup): 51
+Exiv2 exception in print action for file eps-nested_minimal_begindocument-at-page-start.eps:
+Failed to read image data
+Exit code: 1
+
+-----> eps-nested_minimal_begindocument.eps <-----
+
+Command: exiv2 -u -pa eps-nested_minimal_begindocument.eps
+Warning: Nested documents are currently not supported. Found nested document at position: 56
+Exiv2 exception in print action for file eps-nested_minimal_begindocument.eps:
 Failed to read image data
 Exit code: 1
 
+-----> eps-nested_minimal_includedocument-at-page-start.eps <-----
+
+Command: exiv2 -u -pa eps-nested_minimal_includedocument-at-page-start.eps
+Exit code: 253
+
+Command: exiv2 -dx eps-nested_minimal_includedocument-at-page-start.eps
+Exit code: 0
+
+Command: exiv2 -f -ex eps-nested_minimal_includedocument-at-page-start.eps
+Exit code: 0
+
+Restore: eps-nested_minimal_includedocument-at-page-start.eps
+
+Command: exiv2 -f -eX eps-nested_minimal_includedocument-at-page-start.eps
+Exit code: 0
+
+Command: exiv2 -ix eps-nested_minimal_includedocument-at-page-start.eps
+Exit code: 0
+
+Command: (2) exiv2 -ix eps-nested_minimal_includedocument-at-page-start.eps
+Exit code: 0
+
+Command: exiv2 -f -ex eps-nested_minimal_includedocument-at-page-start.eps
+Exit code: 0
+
+-----> eps-nested_minimal_includedocument.eps <-----
+
+Command: exiv2 -u -pa eps-nested_minimal_includedocument.eps
+Exit code: 253
+
+Command: exiv2 -dx eps-nested_minimal_includedocument.eps
+Exit code: 0
+
+Command: exiv2 -f -ex eps-nested_minimal_includedocument.eps
+Exit code: 0
+
+Restore: eps-nested_minimal_includedocument.eps
+
+Command: exiv2 -f -eX eps-nested_minimal_includedocument.eps
+Exit code: 0
+
+Command: exiv2 -ix eps-nested_minimal_includedocument.eps
+Exit code: 0
+
+Command: (2) exiv2 -ix eps-nested_minimal_includedocument.eps
+Exit code: 0
+
+Command: exiv2 -f -ex eps-nested_minimal_includedocument.eps
+Exit code: 0
+
 -----> eps-nested_noxmp_ai-3-lev2.eps <-----
 
 Command: exiv2 -u -pa eps-nested_noxmp_ai-3-lev2.eps

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list