mate-desktop / atril

A document viewer for MATE
http://www.mate-desktop.org
GNU General Public License v2.0
206 stars 62 forks source link

Atril should not use the filename extension to determine the file type #595

Open vinc17fr opened 1 year ago

vinc17fr commented 1 year ago

Expected behaviour

Atril should determine the file type by looking at the file contents, not by using the filename extension, which is unreliable for files downloaded from the web.

Actual behaviour

Atril currently takes the file extension into account, as this can be seen by changing the filename (see below).

Steps to reproduce the behaviour

  1. Download https://www.vinc17.net/defi14.ps.gz (this is a gzipped PostScript file).
  2. Rename the file to defi14.ps-1.gz (note: with Firefox 119, if you download the file twice, you will get this filename, because defi14.ps.gz already exists due to the first download).
  3. Open this file (under the name defi14.ps-1.gz) with Atril, either from the command line (with the pathname in argument) or directly from Atril with the File → Open menu.

I get the following error:

Unable to open document File type Gzip archive (application/gzip) is not supported

Note that there is no such issue with the filename defi14.ps.gz.

MATE general version

n/a (I am not using any desktop environment)

Package version

Atril 1.26.0 (atril 1.26.0-2+b1 Debian package)

Linux Distribution

Debian/unstable

Link to bugreport of your Distribution (requirement)

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1055971