|
1 |
| -# heroku-buildpack-imagemagick-heif |
2 | 1 |
|
3 |
| -[](https://github.com/yespark/heroku-imagemagick-buildpack/actions?query=workflow%3Aci) |
| 2 | +# Heroku Buildpack for ImageMagick with HEIF/HEIC/AVIF/WebP Support |
| 3 | + |
| 4 | +``` |
| 5 | + _____ _ _ |
| 6 | + \_ \_ __ ___ __ _ __ _ ___ /\/\ __ _ __ _(_) ___| | __ |
| 7 | + / /\/ '_ ` _ \ / _` |/ _` |/ _ \/ \ / _` |/ _` | |/ __| |/ / |
| 8 | + /\/ /_ | | | | | | (_| | (_| | __/ /\/\ \ (_| | (_| | | (__| < |
| 9 | + \____/ |_| |_| |_|\__,_|\__, |\___\/ \/\__,_|\__, |_|\___|_|\_\ |
| 10 | + |___/ |___/ |
| 11 | +``` |
4 | 12 |
|
5 |
| -The rise in popularity and use of HEIF/HEIC(High Efficency Image Format) means your project's image processing also needs to be able to handle this format. |
6 |
| -The current default version of imagemagick installed on heroku:24 dynos is a version 6.xx and does not support processing heic image files. |
| 13 | +[](https://github.com/yespark/heroku-imagemagick-buildpack/actions?query=workflow%3Aci) |
7 | 14 |
|
8 |
| -This [Heroku buildpack](https://devcenter.heroku.com/articles/buildpacks) vendors a version of ImageMagick with **WEBP and HEIF support** binaries into your project. |
| 15 | +# Documentation |
9 | 16 |
|
10 |
| -This one works was built for [**Heroku stack 20**](https://devcenter.heroku.com/articles/stack). |
| 17 | +With the rise in popularity of HEIF/HEIC (High Efficiency Image Format), your project needs to handle this format efficiently. The default version of ImageMagick installed on Heroku:22/24 dynos (version 7.xx) does not support processing HEIC and AVIF image files. |
11 | 18 |
|
12 |
| -The tar file in the [/build folder](./build) currently contains: |
| 19 | +This [Heroku buildpack](https://devcenter.heroku.com/articles/buildpacks) includes a version of ImageMagick with **HEIF/HEIC/AVIF/WebP support**. |
13 | 20 |
|
14 |
| -Version: ImageMagick 7.1.1-35 |
| 21 | +The binaries in this repository were built using Heroku Docker images with the [**build.sh**](./build.sh) script. The resulting tar files are stored in the `/build` directory and utilized by the [compile script](./bin/compile). |
15 | 22 |
|
16 |
| -You will need to build a new binary if you want to use a newer or different version. To build a new binary see [How to Build a New Binary](#how-to-build-a-new-binary) |
| 23 | +The `/build` directory currently contains: |
17 | 24 |
|
18 |
| -# Usage |
| 25 | +Versions: |
| 26 | + - ImageMagick 7.1.1-35 |
| 27 | + - libde265 1.0.15 |
| 28 | + - libwebp 1.4.0 |
| 29 | + - libheif 1.18.1 |
19 | 30 |
|
20 |
| -## Step 1 : Adding the buildpack |
| 31 | +# Using the Heroku Imagemagick buildpack |
21 | 32 |
|
22 |
| -From your projects "Settings" tab add this buildpack to your app in the 1st position: |
| 33 | +It's suggested that you use the latest version of the release buildpack. You can set it using the heroku-cli. |
23 | 34 |
|
24 | 35 | ```bash
|
25 |
| -https://github.com/yespark/heroku-imagemagick-buildpack |
| 36 | +heroku buildpacks:set https://github.com/yespark/heroku-imagemagick-buildpack --index 1 -a your-app-name |
26 | 37 | ```
|
27 | 38 |
|
28 |
| -**NOTE:** \__To ensure the newer version of imagemagick is found in the $PATH and installed first make sure this buildpack is added to the top of the buildpack list or at "index 1"._ |
29 |
| - |
30 |
| -## Step 2 : Clear the cache(**Not Sure if this is necessary**) |
| 39 | +Your builds will always used the latest published release of the buildpack. |
31 | 40 |
|
32 |
| -Since the installation is cached you might want to clean it out due to config changes. |
| 41 | +**NOTE:** |
| 42 | +- To ensure the newer version of ImageMagick is found in the `$PATH` and installed first, make sure this buildpack is added to the top of the buildpack list (index 1). |
| 43 | +- If needed, clear the cache due to configuration changes: |
33 | 44 |
|
34 | 45 | ```bash
|
35 | 46 | heroku plugins:install heroku-builds
|
36 | 47 | heroku builds:cache:purge -a HEROKU_APP_NAME
|
37 | 48 | ```
|
38 | 49 |
|
39 |
| -# How to Build a New Binary (if you want to make somes changes) |
40 |
| - |
41 |
| -The binary in this repo was built in a heroku:22 docker image running in a local dev environment. |
42 |
| -However, there is a script called [**build.sh**](./build.sh) made to build a tar file through docker easily, it will be copied to the `build` directory. Then you should commit this changes to your git, and adjust the buildpack url previously mentioned just above. |
43 |
| - |
44 |
| -## Prerequisites |
| 50 | +## Development |
45 | 51 |
|
46 |
| -- Docker installed and running in local dev environment. [Get Docker](https://docs.docker.com/get-docker/) |
| 52 | +This Dockerfile builds ImageMagick with updated libraries (libde265, libwebp, and libheif) on a Heroku stack. Here's a breakdown of the process: |
47 | 53 |
|
48 |
| -## Credits |
| 54 | +- Starts with a Heroku build image and sets up environment variables and arguments. |
| 55 | +- Installs necessary dependencies like `pkg-config`, `ninja-build`, and `yasm`. |
| 56 | +- Builds and installs the following libraries in order: |
| 57 | + - `libde265` |
| 58 | + - `libwebp` |
| 59 | + - `libheif` (including AOM as a dependency) |
| 60 | + - `ImageMagick` |
| 61 | +- For each library, it: |
| 62 | + - Downloads the source code from GitHub |
| 63 | + - Configures the build |
| 64 | + - Compiles the library |
| 65 | + - Installs it to `/usr/local` |
| 66 | +- Cleans up unnecessary files and strips the shared libraries. |
| 67 | +- Depending of the stack version, creates a tarball of the built binaries, libraries, and other necessary files. |
| 68 | +- Updates the `ldconfig` cache to ensure the new shared libraries are recognized. |
| 69 | +- Saves the ImageMagick configuration for reference. |
49 | 70 |
|
50 |
| -- https://medium.com/@eplt/5-minutes-to-install-imagemagick-with-heic-support-on-ubuntu-18-04-digitalocean-fe2d09dcef1 |
51 |
| -- https://github.com/brandoncc/heroku-buildpack-vips |
52 |
| -- https://github.com/steeple-dev/heroku-buildpack-imagemagick |
53 |
| -- https://github.com/retailzipline/heroku-buildpack-imagemagick-heif |
| 71 | +The result is a Docker image with updated versions of ImageMagick and its dependencies, with shared libraries (.so files) built and included in a tarball. |
54 | 72 |
|
55 |
| -## Knowledge Base |
| 73 | +## Bugs |
56 | 74 |
|
57 |
| -https://devcenter.heroku.com/articles/heroku-24-stack#upgrade-notes |
| 75 | +Please report all bugs to the issue tracker: https://github.com/yespark/heroku-imagemagick-buildpack/issues |
58 | 76 |
|
59 | 77 | ## License
|
60 | 78 |
|
61 |
| -The gem is available as open source under the terms of the [MIT License](https://github.com/yespark/heroku-imagemagick-buildpack/blob/master/LICENSE). |
| 79 | +This buildpack is available as open source under the terms of the [MIT License](https://github.com/yespark/heroku-imagemagick-buildpack/blob/master/LICENSE). |
0 commit comments