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: not built with HEIF support #26444

Closed
5 of 6 tasks
DavidCWGA opened this issue Apr 11, 2018 · 11 comments
Closed
5 of 6 tasks

imagemagick: not built with HEIF support #26444

DavidCWGA opened this issue Apr 11, 2018 · 11 comments
Labels
outdated PR was locked due to age

Comments

@DavidCWGA
Copy link

  • are reporting a bug others will be able to reproduce and not asking a question. If you're not sure or want to ask a question do so on our Discourse: https://discourse.brew.sh
  • have a problem with brew install (or upgrade, reinstall) a single, official formula (not cask)? If it's a general brew problem please file this issue at Homebrew/brew: https://github.com/Homebrew/brew/issues/new. If it's a brew cask problem please file this issue at https://github.com/caskroom/homebrew-cask/issues/new. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.
  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

doctor.txt
config.txt

To help us debug your issue please explain:

  • What you were trying to do (and why)

Support for HEIF was added to ImageMagick 7.0.7-22: ImageMagick/ImageMagick#507

However ImageMagick 7.0.7-28 as built with Homebrew does not include this support, and it does not appear as a buildable option under "brew info imagemagick".

  • What happened (include command output)
$ identify IMG_0868.HEIC 
identify: no decode delegate for this image format `HEIC' @ error/constitute.c/ReadImage/509.

$ mogrify -format jpeg IMG_0868.HEIC 
mogrify: no decode delegate for this image format `HEIC' @ error/constitute.c/ReadImage/509.

$ convert IMG_0868.HEIC IMG_0868.jpg
convert: no decode delegate for this image format `HEIC' @ error/constitute.c/ReadImage/509.
convert: no images defined `IMG_0868.jpg' @ error/convert.c/ConvertImageCommand/3275.
  • What you expected to happen

As per the issue referenced above, ImageMagick should now support HEIF images.

  • Step-by-step reproduction instructions (by running brew install commands)

brew install imagemagick

@DomT4
Copy link
Member

DomT4 commented Apr 11, 2018

It requires a library that Homebrew doesn't ship currently, and more problematically, a library that doesn't build using a recent version of clang. That's been fixed in master upstream but there's no current release with that in, so a new release would need to be requested.

If you want to play around with it, this should work as long as you build the dep with --HEAD:

diff --git a/Formula/imagemagick.rb b/Formula/imagemagick.rb
index b65ef07a0c..f932b38381 100644
--- a/Formula/imagemagick.rb
+++ b/Formula/imagemagick.rb
@@ -17,6 +17,7 @@ class Imagemagick < Formula
 
   option "with-fftw", "Compile with FFTW support"
   option "with-hdri", "Compile with HDRI support"
+  option "with-libde265", "Compile with HEIC support"
   option "with-opencl", "Compile with OpenCL support"
   option "with-openmp", "Compile with OpenMP support"
   option "with-perl", "Compile with PerlMagick"
@@ -42,6 +43,7 @@ class Imagemagick < Formula
   depends_on "fontconfig" => :optional
   depends_on "little-cms" => :optional
   depends_on "little-cms2" => :optional
+  depends_on "libde265" => :optional
   depends_on "libwmf" => :optional
   depends_on "librsvg" => :optional
   depends_on "liblqr" => :optional
diff --git a/Formula/libde265.rb b/Formula/libde265.rb
new file mode 100644
index 0000000000..b41b31be59
--- /dev/null
+++ b/Formula/libde265.rb
@@ -0,0 +1,32 @@
+class Libde265 < Formula
+  desc "Open h.265 video codec implementation"
+  homepage "https://github.com/strukturag/libde265"
+  url "https://github.com/strukturag/libde265/releases/download/v1.0.2/libde265-1.0.2.tar.gz"
+  sha256 "eaa0348839c2935dd90647d72c6dd4a043e36361cb3c33d2b04df10fbcebd3cb"
+
+  head do
+    url "https://github.com/strukturag/libde265.git"
+    depends_on "autoconf" => :build
+    depends_on "automake" => :build
+    depends_on "libtool" => :build
+  end
+
+  def install
+    system "autoreconf", "-fvi" if build.head?
+    system "./configure", "--disable-dependency-tracking",
+                          "--disable-silent-rules",
+                          "--disable-sherlock265",
+                          "--disable-dec265",
+                          "--prefix=#{prefix}"
+    system "make", "install"
+
+    # Install the test-related executables in libexec.
+    (libexec/"bin").install bin/"acceleration_speed",
+                            bin/"block-rate-estim",
+                            bin/"tests"
+  end
+
+  test do
+    system libexec/"bin/tests"
+  end
+end

@fxcoudert
Copy link
Member

Closing, as @DomT4 explained: this will need to be built on stable released versions before we can integrate it into homebrew.

@Panajev
Copy link

Panajev commented Apr 17, 2018

Could we reopen it when the issue is solved or at least put a link to the PR’s for the next steps? It is not clear from this thread what the timelines for this are. iOS 11 is now the vast majority of Apple users and there is real scarcity of good encoders, but tons and tons of decoders.

@DomT4
Copy link
Member

DomT4 commented Apr 17, 2018

strukturag/libde265#166

@ilovezfs
Copy link
Contributor

You can now

brew install --with-libde265 imagemagick

@shamrin
Copy link

shamrin commented May 8, 2018

@ilovezfs Thank you! I've tried --with-libde265 option but it didn't give me support for HEIC files. Do I need to provide more options?

$ identify some-photo.heic
identify: no decode delegate for this image format `HEIC' @ error/constitute.c/ReadImage/512.
$ convert some-photo.heic some-photo.jpg
convert: no decode delegate for this image format `HEIC' @ error/constitute.c/ReadImage/512.
convert: no images defined `some-photo.jpg' @ error/convert.c/ConvertImageCommand/3275.

Install log:

$ brew uninstall imagemagick
Uninstalling /usr/local/Cellar/imagemagick/7.0.7-31... (1,526 files, 23.2MB)
imagemagick 7.0.7-8 1 is still installed.
Remove all versions with `brew uninstall --force imagemagick`.
$ brew uninstall --force imagemagick
Uninstalling imagemagick... (1,523 files, 23.2MB)
$ brew install --with-libde265 imagemagick
==> Reinstalling imagemagick --with-libde265
==> Installing dependencies for imagemagick: libde265
==> Installing imagemagick dependency: libde265
==> Downloading https://homebrew.bintray.com/bottles/libde265-1.0.3.el_capitan.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/94/942f19c7b70c6bc6510715c13752bb99e7a4793f1f028245fd2f2b79
######################################################################## 100.0%
==> Pouring libde265-1.0.3.el_capitan.bottle.tar.gz
🍺  /usr/local/Cellar/libde265/1.0.3: 22 files, 2.0MB
==> Installing imagemagick --with-libde265
==> Downloading https://dl.bintray.com/homebrew/mirror/imagemagick-7.0.7-31.tar.xz
==> Downloading from https://akamai.bintray.com/00/002f305567b21906a689ce1f98769069907b2700c5bb2b0ddad2264f
######################################################################## 100.0%
==> ./configure --disable-osx-universal-binary --prefix=/usr/local/Cellar/imagemagick/7.0.7-31 --disable-si
==> make install
🍺  /usr/local/Cellar/imagemagick/7.0.7-31: 1,526 files, 23.2MB, built in 3 minutes 23 seconds

Some more info:

$ convert --version
Version: ImageMagick 7.0.7-31 Q16 x86_64 2018-05-08 https://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: https://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules 
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
$ brew info imagemagick
imagemagick: stable 7.0.7-31 (bottled), HEAD
Tools and libraries to manipulate images in many formats
https://www.imagemagick.org/
/usr/local/Cellar/imagemagick/7.0.7-31 (1,526 files, 23.2MB) *
  Built from source on 2018-05-08 at 14:51:50 with: --with-libde265
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/imagemagick.rb
==> Dependencies
...

@DomT4
Copy link
Member

DomT4 commented May 8, 2018

I think the latest version of imagemagick merged the changes mentioned in my PR at the time, so it'll need rewriting again once #26960 is done/merged/etc. Upstream moved faster than I was expecting.

@DavidCWGA
Copy link
Author

Confirming this is still broken per the above - should the issue be reopened?

In case it's useful to anyone else I was able to restore the working version with "brew switch imagemagick 7.0.7-28".

@DomT4
Copy link
Member

DomT4 commented May 22, 2018

It should be fixed again by the end of the week.

@DomT4
Copy link
Member

DomT4 commented May 26, 2018

Should be a simple brew reinstall imagemagick once #26960 is 🚢'd, for those of you who had already built with the libde265 option previously.

@ltavoletti
Copy link

This work for me on mac osx 10.13.4: brew install --with-libheif imagemagick

$ identify IMG_1898.HEIC 
IMG_1898.HEIC HEIC 3024x4032 3024x4032+0+0 8-bit YCbCr 3.29732MiB 0.020u 0:00.009

Install log:

$ brew install libde265
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core, homebrew/cask).
==> New Formulae
drafter
==> Updated Formulae
certbot                           erlang                            gromacs                           ios-sim                           jfrog-cli-go

==> Downloading https://homebrew.bintray.com/bottles/libde265-1.0.3.high_sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/31/318155fde344fe1742f354396bd65fbd2b1ed14f420131f3ed5ff569d5a6b38f?__gda__=exp=1528969345~hmac=87d1b33d32efec69a81823e5c6d
######################################################################## 100.0%
==> Pouring libde265-1.0.3.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libde265/1.0.3: 22 files, 2MB
$ brew install --with-libheif imagemagick
==> Installing dependencies for imagemagick: x265, libheif
==> Installing imagemagick dependency: x265
==> Downloading https://homebrew.bintray.com/bottles/x265-2.8.high_sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/f3/f3709d31e52cc5e59e691223a73655fce69ae43ec65e28e23928cdcb2d898edf?__gda__=exp=1528970962~hmac=8aa7ac4042d87ea8ec186f01d10
######################################################################## 100.0%
==> Pouring x265-2.8.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/x265/2.8: 11 files, 34.4MB
==> Installing imagemagick dependency: libheif
==> Downloading https://homebrew.bintray.com/bottles/libheif-1.2.0.high_sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/d9/d93963bed0c1d05eaba7e839b8fa1e9924f31b9f665089c6e8fb8471cd0e35f5?__gda__=exp=1528970964~hmac=6f9efd2afb8a0167a96ca5f442c
######################################################################## 100.0%
==> Pouring libheif-1.2.0.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libheif/1.2.0: 19 files, 2.0MB
==> Installing imagemagick --with-libheif
==> Downloading https://dl.bintray.com/homebrew/mirror/imagemagick-7.0.8-0.tar.xz
==> Downloading from https://akamai.bintray.com/56/5698ab3211879246a75fc9ea0d3303d510dbec194feba577ca3288102b4b9685?__gda__=exp=1528970968~hmac=3557c3c3e30ff7b92fe116dab0a
######################################################################## 100.0%
==> ./configure --disable-osx-universal-binary --prefix=/usr/local/Cellar/imagemagick/7.0.8-0 --disable-silent-rules --enable-shared --enable-static --with-modules --disab
==> make install
🍺  /usr/local/Cellar/imagemagick/7.0.8-0: 1,518 files, 23MB, built in 2 minutes 34 seconds

@lock lock bot added the outdated PR was locked due to age label Jul 14, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

7 participants