Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imagemagick cannot convert from pdf to png #16454

Closed
romildo opened this issue Jun 23, 2016 · 11 comments
Closed

imagemagick cannot convert from pdf to png #16454

romildo opened this issue Jun 23, 2016 · 11 comments

Comments

@romildo
Copy link
Contributor

romildo commented Jun 23, 2016

Issue description

With imagemagick installed in the NixOS unstable, convertion from PDF to PNG (or other image formats) fails because gs cannot be found:

$ convert /tmp/a.pdf /tmp/b.png
convert: no images defined `/tmp/b.png' @ error/convert.c/ConvertImageCommand/3252.

$ locate -r bin/gs$
/nix/store/45iygd09ig723zczx4ys0mxr03sgfg4i-ghostscript-9.18/bin/gs
/nix/store/c0q1dq2ahhsig95a9c5gwis29rzwmzg3-cups-progs/bin/gs

$ export PATH=/nix/store/45iygd09ig723zczx4ys0mxr03sgfg4i-ghostscript-9.18/bin:$PATH

$ convert /tmp/a.pdf /tmp/b.png

$ ls /tmp/b.png
/tmp/b.png

Probably imagemagick needs a propagated runtime dependency on ghostscript.

Technical details

  • System: (NixOS: nixos-version, Ubuntu/Fedora: lsb_release -a, ...)
    16.09pre85639.453086a (Flounder)
  • Nix version: (run nix-env --version)
    nix-env (Nix) 1.11.2
  • Nixpkgs version: (run nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion)
    "16.09pre85639.453086a"
@romildo
Copy link
Contributor Author

romildo commented Jun 23, 2016

cc @the-kenny @wkennington

@the-kenny
Copy link
Contributor

Do we really want to pull ghostscript into the closure for imagemagick? It's a pretty big dependency.

@the-kenny
Copy link
Contributor

Workaround: Install ghostscript to your system or your profile manually.

@vrthra
Copy link
Member

vrthra commented Jun 23, 2016

Doesn't imagemagicBig have ghostscript?

@the-kenny
Copy link
Contributor

Right, it has.

@romildo
Copy link
Contributor Author

romildo commented Jun 24, 2016

imagemagickBig is not in the binary cache, right?

@domenkozar
Copy link
Member

http://hydra.nixos.org/search?query=imagemagickBig

@vcunat
Copy link
Member

vcunat commented Jun 24, 2016

It should be. It's even used as dependency for ikiwiki.

@romildo
Copy link
Contributor Author

romildo commented Jun 24, 2016

For some reason imagemagick is being compiled from source on my unstable system (x86_64-linux) when I add imamagickBig on environment.systemPackages. I expected it to be fetched from the binary cache.

# nixos-version
16.09pre85639.453086a (Flounder)

# nixos-rebuild switch 2>&1 | tee /var/tmp/nix-rebuild.log
building Nix...
building the system configuration...
these derivations will be built:
  /nix/store/czvm39vhzimsds7h69zmvnkpyi6byzzl-imagemagick-6.9.3-9.drv
  /nix/store/xw7rj6ydbggr27bc3lbkb2gblj4pcqms-system-path.drv
  /nix/store/m51dfadnz79fhapiawb3771nqk4gh812-xsession.drv
  /nix/store/lvdjxxjvcs8m9nxlwfs3bwc4sn3lqacs-desktops.drv
  /nix/store/1m4fjn6cyacci0s4ir3spd2xzh03w7s7-lightdm.conf.drv
  /nix/store/ylgjgvkp50qbysa78zv0bx5j8mjrddw0-dbus-conf.drv
  /nix/store/xzqq8hppp5smqy85cy7pzgkwmypwmfwc-unit-dbus.service.drv
  /nix/store/ymrs9va8siz5p7dh192mvc3kraw3hcg0-unit-polkit.service.drv
  /nix/store/xag3l95j6z49m2q5fp67ykha5mzjh70m-system-units.drv
  /nix/store/fdkjvwingy8p6fsqwnfi86xcq45szkbq-unit-emacs.service.drv
  /nix/store/xsrixq1656h4mzx51i0ab097jmvfmddx-user-units.drv
  /nix/store/asp2ldc15c7lam00b5456clyp5vpjzgf-etc.drv
  /nix/store/a5i2ykj8dsg3lm0jxv25xf4ww1d3x4cc-nixos-system-jrm.no-ip.org-16.09pre85639.453086a.drv
these paths will be fetched (8.38 MiB download, 8.40 MiB unpacked):
  /nix/store/fz049636n3zak05c6jwdvz135iy2w2r4-ImageMagick-6.9.3-9.tar.xz
  /nix/store/x8zsjkxzi6xy3vyasfy93zl7c4g2kbyl-stage-2-init.sh
  /nix/store/zwcvckg82fc7spbjnip73pynxr5pz5xc-stdenv
fetching path ‘/nix/store/x8zsjkxzi6xy3vyasfy93zl7c4g2kbyl-stage-2-init.sh’...
fetching path ‘/nix/store/zwcvckg82fc7spbjnip73pynxr5pz5xc-stdenv’...
fetching path ‘/nix/store/fz049636n3zak05c6jwdvz135iy2w2r4-ImageMagick-6.9.3-9.tar.xz’...
[...]
building path(s) ‘/nix/store/f1ys84ax50sc7zfc48i3p3jpipl7fwf1-imagemagick-6.9.3-9-dev’, ‘/nix/store/psgzqab3bspd00swj3ls996j2yxlah47-imagemagick-6.9.3-9’, ‘/nix/store/rda3ylzgkkqzdcdzjjh4y0diz6zf5dfd-imagemagick-6.9.3-9-doc’
unpacking sources
[...]

$ find /nix/store -maxdepth 1 -ls | grep -vE '\.drv|tar.xz$' | grep --color -i imagemagick
     2660      4 dr-xr-xr-x   3  root     root         4096 Dec 31  1969 /nix/store/rda3ylzgkkqzdcdzjjh4y0diz6zf5dfd-imagemagick-6.9.3-9-doc
     4498      4 dr-xr-xr-x   6  root     root         4096 Dec 31  1969 /nix/store/f1ys84ax50sc7zfc48i3p3jpipl7fwf1-imagemagick-6.9.3-9-dev
      762      4 dr-xr-xr-x   6  root     root         4096 Dec 31  1969 /nix/store/psgzqab3bspd00swj3ls996j2yxlah47-imagemagick-6.9.3-9

@vcunat Edited to show the output of nixos-rebuild.

@vcunat
Copy link
Member

vcunat commented Jun 24, 2016

With current nixos-unstable (453086a), all outputs get fetched OK on my computer (x86_64-linux). /nix/store/pl7dbl8d38lv7pxc7sfcdn08md9dn943-imagemagick-6.9.3-9 in particular, to check hashes.

@Profpatsch
Copy link
Member

Since there is imagemagickBig, I’ll close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants