Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

ImageMagick package missing PNG? #14325

Closed
dfischer opened this issue Aug 20, 2012 · 34 comments
Closed

ImageMagick package missing PNG? #14325

dfischer opened this issue Aug 20, 2012 · 34 comments

Comments

@dfischer
Copy link

identify source/logo.png
identify: unable to load module /usr/local/Cellar/imagemagick/6.7.7-6/lib/ImageMagick/modules-Q16/coders/png.la': file not found @ error/module.c/OpenModule/1278. identify: no decode delegate for this image formatsource/logo.png' @ error/constitute.c/ReadImage/544.

identify -list format
https://gist.github.com/55e1814cb3a009affffe

No PNG in formats.

@dfischer
Copy link
Author

I guess it depends upon XQuartz being installed. That's lame. #2415

@jacknagel
Copy link
Contributor

It shouldn't. If XQuartz isn't installed, libpng should be installed as a dependency automatically.

@dfischer
Copy link
Author

libpng is installed but it still doesn't compile with png support. I rather not install XQuartz. What can I do to help? :)

@jacknagel
Copy link
Contributor

ping @MikeMcQuaid

@Sharpie
Copy link
Contributor

Sharpie commented Aug 21, 2012

Could be a bottle issue. Did you do brew install imagemagick or did you pass options or use --build-from-source?

@dfischer
Copy link
Author

I tried brew install imagemagick shall I try --build-from-source ?

@Sharpie
Copy link
Contributor

Sharpie commented Aug 21, 2012

Try --build-from-source and let us know. We originally pulled the ImageMagick bottles because our binary distribution system wasn't robust enough to handle things that have dependency trees without the loader links breaking every time a dependency is upgraded.

I've been out of the loop for a couple of months, so some improvements on this front could have occurred that enabled the re-bottling of ImageMagick---but this looks like the same old issue.

@MikeMcQuaid
Copy link
Member

https://github.com/mxcl/homebrew/wiki/Bug-Fixing-Checklist

Please gist your brew doctor output.

@MikeMcQuaid
Copy link
Member

And brew --config please.

@dfischer
Copy link
Author

brew doctor | jist
https://gist.github.com/0cc2fee43a98761b30cd

brew --config | jist
https://gist.github.com/e5c04b0d59b5609daca7


brew install imagemagick --build-from-source made it work. Thanks @Sharpie

@MikeMcQuaid
Copy link
Member

Ok, this breaks if libpng is unlinked on 10.8 without XQuartz.

@MikeMcQuaid
Copy link
Member

Not sure what to do about that other than a caveat or forceful linking (if you don't have XQuartz is should be linked).

@bronson
Copy link

bronson commented Aug 21, 2012

I have xquartz installed and I still get this issue. Brew doctor says raring to brew.

$ convert tumblr.png +set date:create +set date:modify tumblr.out.png
convert: unable to load module `/usr/local/Cellar/imagemagick/6.7.7-6/lib/ImageMagick/modules-Q16/coders/png.la': file not found @ error/module.c/OpenModule/1278.
...
$ which xquartz
/opt/X11/bin/xquartz

--build-from-source worked for me too, yea @Sharpie.

@MikeMcQuaid
Copy link
Member

@bronson Can you try and do brew uninstall imagemagick; brew install imagemagick;brew install libpng; brew link libpng and see if that works?

@dylanvee
Copy link
Contributor

@MikeMcQuaid That solved the issue for me.

@MikeMcQuaid
Copy link
Member

@jacknagel @Sharpie I guess I need to add some code to make the X11 dependencies get linked automatically when we've got no XQuartz?

@MikeMcQuaid
Copy link
Member

And also this is probably borked if you have XQuartz.

@jacknagel
Copy link
Contributor

I thought that was covered by keg_only :when_xquartz_installed? They should be getting linked otherwise.

@MikeMcQuaid
Copy link
Member

Yep, should be. The problem is, I guess, if people already have it installed from before we added that and it isn't linked. Also wondering if this demonstrates that the optionally depend on XQuartz experiment doesn't really work as it isn't in the default library path lookup so won't work for bottles like this.

@jacknagel
Copy link
Contributor

Before :when_xquartz_installed was added, the keg_only bits were still guarded with if MacOS::Xquartz.installed? which is functionally the same, so nothing should have changed. Besides, FormulaInstaller will error out if there are unlinked deps, so I suspect that it failed to link completely but left a LinkedKegs symlink or something. Wouldn't be the first time.

As far as XQuartz with bottles, it is problematic. A while ago I was thinking about a writing special formula that installs symlinks to stuff in /{usr,opt}/X11. But that is fragile.

@MikeMcQuaid
Copy link
Member

Yeh, sounds like a bad link. Given the number of downloads this has compared to reports I think it must be a fairly niche issue.

With XQuartz I'm wondering if we just only depend on it for the stuff that actually needs X11 and not try and be clever and use it's libpng if it's around. Should be an easy fix.

@jacknagel
Copy link
Contributor

Yeah, I don't really see any other way around the issue.

@jacknagel
Copy link
Contributor

It will certainly make things less confusing.

@mxcl
Copy link
Contributor

mxcl commented Aug 22, 2012

Close?

@MikeMcQuaid
Copy link
Member

I'll close this when I push a commit to properly fix.

@MikeMcQuaid
Copy link
Member

Should be fixed by e6647d3. Basically this will ignore XQuartz on Mountain Lion for stuff like :libpng.

@disbelief
Copy link

Just a note on this, I still had to include the --build-from-source flag when installing the imagemagick recipe to get it working.

I'm on 10.8 and have XQuartz installed. I tried installing homebrew's libpng recipe first, but it kegs when XQuartz is found.

@MikeMcQuaid
Copy link
Member

Ah, ok, thanks.

@MikeMcQuaid
Copy link
Member

Tried another fix in 8eb5a07. Can you test? Thanks!

@disbelief
Copy link

That seems to have done the trick! Thanks.

Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Sep 11, 2012
XQuartz isn't added to the default library paths so if something is
linked against a Homebrew libpng then it doesn't work against the
XQuartz libpng. The CLT provides X11 on Lion so don't request users
install XQuartz if it isn't needed on Mountain Lion.

Fixes Homebrew#14325.
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
XQuartz isn't added to the default library paths so if something is
linked against a Homebrew libpng then it doesn't work against the
XQuartz libpng. The CLT provides X11 on Lion so don't request users
install XQuartz if it isn't needed on Mountain Lion.

Fixes Homebrew#14325.
@ghost
Copy link

ghost commented Jul 26, 2013

Thanks a lot for these hints.

I had issues with Paperclip (a Ruby Gem), and running identify spec/fixtures/image.png showed that it was identify's fault: identify: no decode delegate for this image formatspec/fixtures/image.png' @ error/constitute.c/ReadImage/550.`

Running identify -list format | grep png had no results, obviously libpng was missing. I installed it and reinstalled imagemagick as described above, but it still did not work.

brew doctor showed that the new imagemagick was still not linked, so I linked it with brew link --overwrite imagemagick. I found that I had wrong permissions on several directorys (owned by root instead of me), and after fixing that with sudo chown -R <me> <directory> everything worked fine.

Thank you!

@shedd
Copy link

shedd commented Jun 8, 2014

I'm on Mac OS X Mavericks and hit this problem with PNG support not enabled.

I tried the suggestion to use the --build-from-source option, but kept getting a compilation failure.

Running brew install -v imagemagick --build-from-source showed me that it was lzma.h that was causing the issues.

  CC       coders/coders_map_la-map.lo
  CC       coders/coders_mask_la-mask.lo
  CC       coders/coders_mat_la-mat.lo
  CC       coders/coders_matte_la-matte.lo
  CC       coders/coders_meta_la-meta.lo
  CC       coders/coders_miff_la-miff.lo
  CC       coders/coders_mono_la-mono.lo
  CC       coders/coders_mpc_la-mpc.lo
  CC       coders/coders_mpeg_la-mpeg.lo
  CC       coders/coders_mpr_la-mpr.lo
coders/miff.c:81:10: fatal error: 'lzma.h' file not found
#include "lzma.h"
         ^
1 error generated.
make[2]: *** [coders/coders_miff_la-miff.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [install-recursive] Error 1
make: *** [install] Error 2

I was tearing my hair out trying to solve this problem.

I re-installed libpng and for good measure built that from source, too.

brew uninstall libpng
brew install libpng --build-from-source

This didn't do anything.

I eventually stumbled upon a random thread (https://bugs.launchpad.net/kicad/+bug/1285317) which advised brew uninstall xz

Not having any other options, I tried this and it worked. I re-ran install with --build-from-source and it completed successfully.

Hope this helps spare someone else some time.

@unphased
Copy link

@shedd You saved my bacon! thanks

@createthis
Copy link

Strangely, none of the "easy" fixes here worked. Ultimately, I had to brew install imagemagick --build-from-source

I'm running Mavericks. Weird.

@Homebrew Homebrew locked and limited conversation to collaborators Jun 26, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests