DjVu Files cannot be opened

Bug #1778088 reported by Felix Eckhofer
30
This bug affects 7 people
Affects Status Importance Assigned to Milestone
djvulibre (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When trying to open a .djvu document, evince shows an error:

  File type DjVu image (image/vnd.djvu) is not supported

Apparently, upstream has removed the image/vnd.djvu mimetype in an effort to treat single-page .djvu files more like images (https://bugzilla.gnome.org/show_bug.cgi?id=754467). The file in question is however a multi-page, yet the mime-type is not the expected "image/vnd.djvu+multipage":

  $ file book.djvu
  book.djvu: DjVu multiple page document
  $ file --mime-type book.djvu
  book.djvu: image/vnd.djvu

This happens on all bionic machines I have access to.

Tags: bionic
madbiologist (me-again)
tags: added: bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in evince (Ubuntu):
status: New → Confirmed
Revision history for this message
Gro-Tsen (david-madore) wrote :

Cross-reference to Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=876710

As suggested there, removing the "djvulibre-desktop" package worked around the problem.

affects: evince (Ubuntu) → djvulibre (Ubuntu)
Revision history for this message
Gro-Tsen (david-madore) wrote :

Up to recently, this bug was easily fixed by removing the "djvulibre-desktop" package, but some recent upgrade seems to have brought it back with a vengeance (some time before but not long before 2019-05-15).

Since Ubuntu is visibly in no hurry to fix this, let me offer a workaround: create ~/.local/share/mime/packages/override.xml with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
  <!-- Created on 2019-05-15 to fix a reappearance of this bug: -->
  <!-- https://bugs.launchpad.net/ubuntu/+source/djvulibre/+bug/1778088 -->
  <!-- (DjVu seen as image/vnd.djvu instead of image/vnd.djvu+multipage) -->
  <!-- https://twitter.com/gro_tsen/status/1128645721614356480 -->
  <!-- Run "update-mime-database ~/.local/share/mime" after creating this. -->
  <!-- Use "xdg-mime query filetype some-file.djvu" to test. -->
  <!-- - David A. Madore -->
  <mime-type type="image/vnd.djvu+multipage">
    <comment>DjVu image</comment>
    <alias type="image/x-djvu"/>
    <magic priority="99">
      <match value="AT&amp;TFORM" type="string" offset="0">
        <match value="DJVU" type="string" offset="12"/>
      </match>
      <match value="FORM" type="string" offset="0">
        <match value="DJVU" type="string" offset="8"/>
      </match>
    </magic>
    <glob pattern="*.djvu"/>
    <glob pattern="*.djv"/>
  </mime-type>
</mime-info>

— and then run “update-mime-database ~/.local/share/mime” to regenerate the local MIME cache.

See also https://twitter.com/gro_tsen/status/1128645721614356480 and https://gist.github.com/Gro-Tsen/2961f34df4a29d143c7b3499fac7e130

Revision history for this message
Serge Gavrilov (serge-pdmi) wrote :

This is really ugly solution to disable to open single page DjVu. Why not to do the same with single page PDF??? This is also something like images, we do not want to see this :)

My suggestion is to apply reversed patch at

https://bug754467.bugzilla-attachments.gnome.org/attachment.cgi?id=355963

to restore img/vnd.djvu support.

Revision history for this message
Serge Gavrilov (serge-pdmi) wrote :

I mean in evince

Revision history for this message
Tigran Aivazian (aivazian-tigran) wrote :

I agree with Serge that disabling support for single-page DjVu files is a mistake. There is no valid reason to do so whatsoever.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.