After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 670895 - "Error creating XPS file: Source _rels/.rels not found in archive"
"Error creating XPS file: Source _rels/.rels not found in archive"
Status: RESOLVED FIXED
Product: libgxps
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libgxps maintainers
libgxps maintainers
Depends on:
Blocks:
 
 
Reported: 2012-02-27 15:09 UTC by Savvas Radević
Modified: 2017-09-06 19:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
xps files, examples that do not work (495.23 KB, application/zip)
2012-02-27 15:09 UTC, Savvas Radević
Details

Description Savvas Radević 2012-02-27 15:09:34 UTC
Created attachment 208495 [details]
xps files, examples that do not work

I'm trying to convert an xps file to one of the supported output formats, but it doesn't work.

$ xpstopdf lorem-ipsum-and-image.xps out.pdf
Error creating XPS file: Source _rels/.rels not found in archive

$ xpstopng lorem-ipsum-and-image.xps out.png
Error creating XPS file: Source _rels/.rels not found in archive

$ xpstops lorem-ipsum-and-image.xps out.ps
Error creating XPS file: Source _rels/.rels not found in archive

The xps documents were created with Microsoft XPS Document Writer (virtual printer) on Windows 7. They open file using XPS viewer on Windows.
Comment 1 Savvas Radević 2012-02-27 15:12:12 UTC
> They open file using XPS viewer on Windows.
They open fine [...]

Also, if it matters, the installed version is a debian package I created I want to submit to Debian. The contents of the packages (if it matters):

    $ dpkg -L libgxps2 libgxps-utils
    /.
    /usr
    /usr/lib
    /usr/lib/libgxps.so.2.1.0
    /usr/share
    /usr/share/doc
    /usr/share/doc/libgxps2
    /usr/share/doc/libgxps2/copyright
    /usr/share/doc/libgxps2/AUTHORS
    /usr/share/doc/libgxps2/TODO
    /usr/share/doc/libgxps2/NEWS.gz
    /usr/share/doc/libgxps2/changelog.gz
    /usr/share/doc/libgxps2/changelog.Debian.gz
    /usr/share/doc/libgxps2/README
    /usr/lib/libgxps.so.2
     
    /.
    /usr
    /usr/share
    /usr/share/man
    /usr/share/man/man1
    /usr/share/man/man1/xpstops.1.gz
    /usr/share/man/man1/xpstosvg.1.gz
    /usr/share/man/man1/xpstopng.1.gz
    /usr/share/man/man1/xpstopdf.1.gz
    /usr/share/man/man1/xpstojpeg.1.gz
    /usr/share/doc
    /usr/share/doc/libgxps-utils
    /usr/share/doc/libgxps-utils/copyright
    /usr/share/doc/libgxps-utils/AUTHORS
    /usr/share/doc/libgxps-utils/TODO
    /usr/share/doc/libgxps-utils/NEWS.gz
    /usr/share/doc/libgxps-utils/changelog.gz
    /usr/share/doc/libgxps-utils/changelog.Debian.gz
    /usr/share/doc/libgxps-utils/README
    /usr/bin
    /usr/bin/xpstopng
    /usr/bin/xpstopdf
    /usr/bin/xpstosvg
    /usr/bin/xpstojpeg
    /usr/bin/xpstops

(Sorry for the long post)
Comment 2 Jason Crain 2012-02-28 00:53:03 UTC
This is a issue in libarchive that has been fixed in 3.0.
See libarchive issue tracker: <http://code.google.com/p/libarchive/issues/detail?id=152>

A XPS document is a ZIP file.  Prior to 3.0 libarchive could not read ZIP files where the file size information is missing.  I believe Windows' built-in XPS document printer doesn't set the file size.

You should link against libarchive3 or libarchive12 or whatever they are calling it.  If not, some XPS documents will be unreadable.  As a workaround, you could unzip and re-zip the XPS document to get the file sizes set correctly.
Comment 3 Savvas Radević 2012-02-28 10:12:26 UTC
Indeed, it works. Fortunately, libarchive 3.x is in the debian repositories: http://packages.qa.debian.org/liba/libarchive.html
I'll put 3.0.0 as the minimal version to avoid this problem.

Thank you very much!!
Comment 4 Michael Biebl 2012-03-03 21:10:47 UTC
LIBARCHIVE_REQUIRED=2.8.0(In reply to comment #2)
> This is a issue in libarchive that has been fixed in 3.0.
> See libarchive issue tracker:
> <http://code.google.com/p/libarchive/issues/detail?id=152>

Would it make sense to bump the configure check to
LIBARCHIVE_REQUIRED=3.0 in configure.ac then?
Comment 5 Savvas Radević 2012-03-05 10:39:39 UTC
I agree, setting back to unconfirmed
Comment 6 Savvas Radević 2012-03-05 10:42:44 UTC
Actually, there is one more important bugfix that is not released yet:
https://code.google.com/p/libarchive/issues/detail?id=226#c5
https://github.com/libarchive/libarchive/commit/f7cd53ca1eda0d08fc3b3876ed474321b9f70ac7

Perhaps the required version should be bumped when the new release includes this bugfix.
Comment 7 Carlos Garcia Campos 2012-03-05 17:07:14 UTC
There are a lot of documents that are not affected by this bugs, so I'm not sure we should bump libarchive requirements.
Comment 8 Al-Scandar Solstag 2012-03-21 20:39:03 UTC
Ni!

I have xpstopdf linked to libarchive-3.0.3 and still experience this problem, or at least a very similar one.

# ldd /usr/bin/xpstopdf | grep libarchive
	libarchive.so.12 => /usr/lib64/libarchive.so.12 (0x00007f2372ed0000)

If I run 'xpstopdf file.xps', the program juts keeps running forever at 100% cpu.

If I do the unzip+zip procedure, everything works fine with the regenerated archive.

I can provide the file I'm trying to open privately, but can't post it here, just send me an e-mail if you want it.

Hugs,

ale
Comment 9 Al-Scandar Solstag 2012-03-21 20:43:58 UTC
(In reply to comment #8)
> I can provide the file I'm trying to open privately, but can't post it here,
> just send me an e-mail if you want it.

Actually, there's no need for that, the examples already provided by Savvas give the exact same problem I described.

btw, I'm using libgxps-0.2.1

tx!
Comment 10 Savvas Radević 2012-03-21 21:45:06 UTC
I described that bug in comment #6 :) The fix is in git upstream (libarchive).

Origin: https://code.google.com/p/libarchive/issues/detail?id=226
Description: Fix issue 226 (infinite loop while using libgxps-utils). The patch is from this merge (adopted to match 3.0.3 release): https://github.com/libarchive/libarchive/commit/f7cd53ca1eda0d08fc3b3876ed474321b9f70ac7

I adopted the patch to match 3.0.3 release files: https://gist.github.com/1974141/ (uses quilt as a patch system)
Comment 11 Al-Scandar Solstag 2012-03-21 23:21:51 UTC
(In reply to comment #10)
> I described that bug in comment #6 :) The fix is in git upstream (libarchive).

Oops I'm really sorry, completely overlooked that, should have followed the link :P

> I adopted the patch to match 3.0.3 release files:
> https://gist.github.com/1974141/ (uses quilt as a patch system)

Thanks! Everything works now ;-) - and can wait for update in peace.
One little "=" huh... and not easy to figure out.

ale
Comment 12 Ignacio Casal Quinteiro (nacho) 2017-09-06 19:50:40 UTC
I guess this can be marked as fixed.