[Pkg-gmagick-im-team] Bug#562959: imagemagick: mime command cannot handle filenames with spaces

Drew Parsons dparsons at debian.org
Tue Dec 29 15:28:44 UTC 2009


Package: imagemagick
Version: 7:6.5.8.3-1
Severity: normal
Tags: patch

Mime type handling is defined in /usr/lib/mime/packages/imagemagick,
for instance invoking display for image/* files.  The image type is
used rather than looking up magic numbers inside the file.  

e.g. for jpeg files, the jpeg: prefix is placed before the filename:
    image/jpeg; display 'jpeg:%s'; test=test -n "$DISPLAY"; priority=2
(placed into /etc/mailcap by update-mime).

Unfortunately this handling breaks down if the file name has irregular
characters such as space characters.  Instead of displaying the file,
display goes to the "Browse and Select a File" dialog box.

"Correct" behaviour, at least for jpeg files, can be obtained by
removing the jpeg: prefix,
    image/jpeg; display '%s'; test=test -n "$DISPLAY"; priority=2

The use of single quotes alongside a %s is tricky, it doesn't work the
same way as ordinary shell quotes. Variants such as 'jpeg:"%s"' or
'jpeg:\"%s\"' don't work.

However, moving the image type outside the quotes,
    image/jpeg; display jpeg:'%s'; test=test -n "$DISPLAY"; priority=2
does seem to work.  As far as I can tell this modification is allowed
by the mailcap format.

I guess the fix should be applied to all the entries in
/usr/lib/mime/packages/imagemagick,, not just jpeg!


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages imagemagick depends on:
ii  libbz2-1.0              1.0.5-3          high-quality block-sorting file co
ii  libc6                   2.10.2-2         GNU C Library: Shared libraries
ii  libfontconfig1          2.6.0-4.2        generic font configuration library
ii  libfreetype6            2.3.11-1         FreeType 2 font engine, shared lib
ii  libglib2.0-0            2.22.3-2         The GLib library of C routines
ii  libgomp1                4.4.2-7          GCC OpenMP (GOMP) support library
ii  libice6                 2:1.0.6-1        X11 Inter-Client Exchange library
ii  libjpeg62               6b-15            The Independent JPEG Group's JPEG 
ii  liblcms1                1.18.dfsg-1.1    Color management library
ii  liblqr-1-0              0.4.1-1          converts plain array images into m
ii  libltdl7                2.2.6b-2         A system independent dlopen wrappe
ii  libmagickcore2          7:6.5.8.3-1      low-level image manipulation libra
ii  libmagickwand2          7:6.5.8.3-1      image manipulation library
ii  libsm6                  2:1.1.1-1        X11 Session Management library
ii  libtiff4                3.9.2-1          Tag Image File Format (TIFF) libra
ii  libx11-6                2:1.3.2-1        X11 client-side library
ii  libxext6                2:1.0.4-1        X11 miscellaneous extension librar
ii  libxt6                  1:1.0.7-1        X11 toolkit intrinsics library
ii  zlib1g                  1:1.2.3.4.dfsg-3 compression library - runtime

Versions of packages imagemagick recommends:
ii  ghostscript               8.70~dfsg-2+b1 The GPL Ghostscript PostScript/PDF
ii  libmagickcore2-extra      7:6.5.8.3-1    low-level image manipulation libra
ii  netpbm                    2:10.0-12      Graphics conversion tools
ii  ufraw                     0.16-1         standalone importer for raw camera

Versions of packages imagemagick suggests:
pn  autotrace                  <none>        (no description available)
ii  cups-bsd [lpr]             1.4.2-6       Common UNIX Printing System(tm) - 
ii  curl                       7.19.7-1      Get a file from an HTTP, HTTPS or 
pn  enscript                   <none>        (no description available)
pn  ffmpeg                     <none>        (no description available)
ii  gimp                       2.6.7-1.1     The GNU Image Manipulation Program
ii  gnuplot                    4.2.6-1       A command-line driven interactive 
pn  grads                      <none>        (no description available)
ii  groff-base                 1.20.1-6      GNU troff text-formatting system (
pn  hp2xx                      <none>        (no description available)
pn  html2ps                    <none>        (no description available)
pn  imagemagick-doc            <none>        (no description available)
ii  libwmf-bin                 0.2.8.4-6.1   Windows metafile conversion tools
pn  mplayer                    <none>        (no description available)
pn  povray                     <none>        (no description available)
pn  radiance                   <none>        (no description available)
ii  sane-utils                 1.0.20-11     API library for scanners -- utilit
ii  texlive-base-bin           2007.dfsg.2-8 TeX Live: Essential binaries
ii  transfig                   1:3.2.5.a-2   Utilities for converting XFig figu
ii  xdg-utils                  1.0.2-6.1     desktop integration utilities from

-- no debconf information





More information about the Pkg-gmagick-im-team mailing list