Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#879989: calibre registers as application/pdf handler, overrides better ones

10 views
Skip to first unread message

Steve Langasek

unread,
Oct 28, 2017, 12:40:03 AM10/28/17
to
Package: calibre
Version: 3.7.0+dfsg-2

Hi Norbert,

I'm not sure if this is a calibre or mime-support bug.

The calibre package ships a
/usr/share/applications/calibre-ebook-viewer.desktop file that declares
itself as a mime handler for application/pdf. Due to bug #877774 being
present in this version of the package (which is the version that wound up
being shipped in Ubuntu 17.10), it doesn't work at all as a mailcap handler;
but even with that bug fixed, it is taking precedence over evince, which is
the default pdf handler that I have installed and the one that I expect to
see used.

I don't know if this is just a matter of 'calibre-ebook-viewer' sorting
alphabetically before 'evince', or what; but having calibre installed in
order to read ebooks should not make it the default mailcap handler for
pdfs.

I suppose this issue would possibly also be resolved if bug #802767 were
fixed.

Thanks,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slan...@ubuntu.com vor...@debian.org
signature.asc

Norbert Preining

unread,
Oct 28, 2017, 1:00:02 AM10/28/17
to
Hi Steve,

> I'm not sure if this is a calibre or mime-support bug.

I am quite sure that it is a mime-support.

> I don't know if this is just a matter of 'calibre-ebook-viewer' sorting
> alphabetically before 'evince', or what; but having calibre installed in

I have never understood how mime-support handles this. The defaults
are somehow determined by the last package installed - my feeling.

I have seen this with pdfs, html, most recently with .txt files that
are now tried to be opened with wine+notepad (!!!). Without me
touching anything in the configurations.

I am tempted to through out all and everything of these mime-crap,
or rewrite it from scratch.

> I suppose this issue would possibly also be resolved if bug #802767 were
> fixed.

You mean separating out the ebook-viewer? How would this solve the
problem? Probably (trying to read your mind) by renaming the
calibre-ebook-viewer to ebook-viewer, but then it still sorts before
evince ;-)

Sorry, no idea.

I have decided do define each and every handler necessary in
~/.config/mimeapps.list
BTW, also this is a huge fun to find out where one should configure it.

Mine has:
[Default Applications]
application/pdf=evince.desktop;
image/*=eom.desktop;
text/plain=pluma.desktop;
image/jpeg=eom.desktop
video/mp4=smplayer.desktop
text/html=firefox.desktop
x-scheme-handler/http=firefox.desktop
x-scheme-handler/https=firefox.desktop
inode/directory=nemo.desktop


Because even such stupid things as opening a folder does the wrong
thing.

Simpy put,
MIME support is completely broken in Debian.

Best

Norbert

--
PREINING Norbert http://www.preining.info
Accelia Inc. + JAIST + TeX Live + Debian Developer
GPG: 0x860CDC13 fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13

Alexandre Lymberopoulos

unread,
May 12, 2023, 10:50:04 PM5/12/23
to
Package: calibre
Version: 6.17.0-1
Followup-For: Bug #879989

Dear Maintainer,

Just to confirm that this "bug" remains in the current version and
state that IMHO the mimetypes associated to calibre is "too
greedy". For instance it doesn't make sense to me open a .docx file
sent by e-mail in ebook-edit or ebook-viewer instead of libreofffice.

Best, Alexandre

-- System Information:
Debian Release: 12.0
APT prefers testing
APT policy: (900, 'testing'), (800, 'unstable'), (500, 'stable-security')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-8-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages calibre depends on:
ii ca-certificates 20230311
ii calibre-bin 6.17.0-1
ii fonts-liberation2 2.1.5-1
ii libjpeg-turbo-progs 1:2.1.5-2
ii libjxr-tools 1.2~git20170615.f752187-5
ii libqt6webenginecore6-bin 6.4.2-final+dfsg-1
ii optipng 0.7.7-2+b1
ii poppler-utils 22.12.0-2+b1
ii pyqt6-dev-tools 6.4.2-1
ii python3 3.11.2-1+b1
ii python3-apsw 3.40.0.0-2+b1
ii python3-bs4 4.11.2-2
ii python3-chm 0.8.6-3+b4
ii python3-css-parser 1.0.8-1
ii python3-cssselect 1.2.0-2
ii python3-dateutil 2.8.2-2
ii python3-feedparser 6.0.10-1
ii python3-fonttools 4.38.0-1+b1
ii python3-html2text 2020.1.16-2
ii python3-html5-parser 0.4.10-8+b1
ii python3-html5lib 1.1-3
ii python3-jeepney 0.8.0-3
ii python3-lxml 4.9.2-1+b1
ii python3-markdown 3.4.1-2
ii python3-mechanize 1:0.4.8+pypi-5
ii python3-msgpack 1.0.3-2+b1
ii python3-netifaces 0.11.0-2+b1
ii python3-pil 9.4.0-1.1+b1
ii python3-pkg-resources 66.1.1-1
ii python3-py7zr 0.11.3+dfsg-5
ii python3-pycryptodome 3.11.0+dfsg1-4
ii python3-pygments 2.14.0+dfsg-1
ii python3-pyparsing 3.0.9-1
ii python3-pyqt6 6.4.2-1
ii python3-pyqt6.qtquick 6.4.2-1
ii python3-pyqt6.qtsvg 6.4.2-1
ii python3-pyqt6.qtwebengine 6.4.0-1
ii python3-pyqt6.sip 13.4.1-1
ii python3-regex 0.1.20221031-1+b1
ii python3-routes 2.5.1-3
ii python3-speechd 0.11.4-2
ii python3-zeroconf 0.47.3-1
ii python3.11 3.11.2-6
ii webp 1.2.4-0.1
ii xdg-utils 1.1.3-4.1

Versions of packages calibre recommends:
pn python3-dnspython <none>
ii python3-ipython 8.5.0-4
pn qt6-wayland <none>
ii udisks2 2.9.4-4

Versions of packages calibre suggests:
pn python3-unrardll <none>

-- no debconf information

yokota

unread,
May 13, 2023, 1:42:06 PM5/13/23
to
Hello, Alexandre.

> Just to confirm that this "bug" remains in the current version and
> state that IMHO the mimetypes associated to calibre is "too
> greedy". For instance it doesn't make sense to me open a .docx file
> sent by e-mail in ebook-edit or ebook-viewer instead of libreofffice.

System default application choice may vary on your applications
installation order, or some other reasons.
For example, .docx uses LibreOffice even I installs Calibre on my machine.

You can choose your favorite applications as default application from
GNOME file manager application: "Files"
or other file managers.

The help file of this application describes how to change default
application choice (See blow).
Don't forget to set "Always use for this file type" switch to keep your choice.

> Change the default application
> You can change the default application that is used to open files of a given type. This will allow you
> to open your preferred application when you double-click to open a file. For example, you might want
> your favorite music player to open when you double-click an MP3 file.
>
> 1. Select a file of the type whose default application you want to change. For example, to change
> which application is used to open MP3 files, select a .mp3 file.
> 2. Right-click the file and select "Open with...".
> 3. Open "Open File" window.
> 4. Select the application you want and click "Always use for this file type".
> 5. Click "Open" button to open the file with selected application.
> 6. Next time, selected application will uses as default application.
>
> This changes the default application not just for the selected file, but for all files with the same type.

--
YOKOTA

Alexandre Lymberopoulos

unread,
May 13, 2023, 6:00:06 PM5/13/23
to
Hi, Yokota!

I use XFCE here and despite choosing LibreOffice to open the docx files
are opened by ebook-edit or ebokk-viewer when selecting them as
attachments of an e-mail message in mutt.

Reinstalling libreoffice again in aptitude didn't fixed anything. The
workaournd I found here is to edit the mailcap (/etc/mailcap) file,
commenting the lines linking that type of file to ebook-edit and
ebook-viewer programs.

I insist on my suggestion to keep associtaion of files to its more
obvious options programs and let specific users change it to their
needs. In this concrete situation calibre, or any other software, should
not claim the preference for opening .docx files over libreoffice.

Best, Alexandre
--
===============================================================================
Alexandre Lymberopoulos - lym...@gmail.com
===============================================================================

Nicholas D Steeves

unread,
May 13, 2023, 7:20:05 PM5/13/23
to
Hi Yokota,

yokota <yokot...@gmail.com> writes:

> System default application choice may vary on your applications
> installation order, or some other reasons.
> For example, .docx uses LibreOffice even I installs Calibre on my machine.
>
> You can choose your favorite applications as default application from
> GNOME file manager application: "Files"
> or other file managers.
>
> The help file of this application describes how to change default
> application choice (See blow).
> Don't forget to set "Always use for this file type" switch to keep your choice.
>

You're writing about the XDG case, which can be tested in a
desktop-agnostic way with "xdg-open".

Alexandre is writing about mailcap-defined MIME types. These can be
tested with "run-mailcap".

There's a nice article on this topic here:
https://unix.stackexchange.com/questions/472245/how-to-make-xdg-open-follow-mailcap-settings-in-debian

Alexandre Lymberopoulos <lym...@gmail.com> writes:

> Reinstalling libreoffice again in aptitude didn't fixed anything. The
> workaournd I found here is to edit the mailcap (/etc/mailcap) file,
> commenting the lines linking that type of file to ebook-edit and
> ebook-viewer programs.

Have you tried /etc/mailcap.order? It might let you work around this
bug while you wait for it to be resolved, and IIRC it means your
customisation[s] won't be cloberred by a future update. I vaguely
remember that mimeview or mimeopen might be able to define per-user
mappings, but I'm not sure, because it's been so many years.

If I remember correctly mailcap.order is for admin use only, and not for
Debian packages, but it might be worth asking someone if this would be
alternative to patching upstream `resources/mime.types`.

> I insist on my suggestion to keep associtaion of files to its more
> obvious options programs and let specific users change it to their
> needs. In this concrete situation calibre, or any other software, should
> not claim the preference for opening .docx files over libreoffice.

To be fair, would you please install "antiword" and then try to open a
.doc (not a docx) from mutt? I'm not sure if antiword supports docx,
but the point is to use a well-established Debian package with
well-established mailcap behaviour.

Alternatively, install upstream `resources/mime.types` to
/usr/share/doc/calibre/examples, and let users opt-in. The XDG
mechanism should continue to work correctly in this case, it may break
the workflows of users who use minimal window managers. This solution
is the least work.

Regards,
Nicholas
signature.asc
0 new messages