forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 0
Build libvips #27
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
Closed
Closed
Build libvips #27
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enhances the production Dockerfile by converting from installing the versions of
libvips
andffmpeg
that are available in the Debian repos, to using with custom built versions of those applications. This has the following advantages:ffmpeg
andlibvips
are installed from the Debian repo, they include a number of dependencies to support file formats that are not used or explicitly not desired in Mastodon, including the unused X11 server. Additionally,libvips
will install ImageMagick as a fallback for some image formats, when the ultimate goal of Add support for libvips in addition to ImageMagick mastodon/mastodon#30090 is to ultimately remove IM from the codebase entirely for all the reasons why Vips is superior. The size of the resulting Docker image built under this PR is 691MB!ffmpeg
is currently at 5.1.4 when 7.0.1 is available, andlibvips
is at 8.14.1 when 8.15.2 is available.Vips compile/library settings
[--build-arg VIPS_VERSION="8.15.2"]
libjpeg-turbo
is used for JPEG processing which is 2-6x faster than standardlibjpeg
. Another option would be to usemozjpeg
but this library is not available in Debian and would required another direct compilation.cgif
is used for GIF processing, which if not present would require Vips to fallback to ImageMagick.libspng
is used for PNG processing, which is similarly more performant than the standardlibpng
package.libwebp
is used for WebP processing.libheif
is used for processing HEIC/HEIF images.orc-0.4
is used for some SIMD operations instead ofhighway
due to the Debian repos not containing a version that is suitable forlibvips
but this could either be compiled directly or evaluated later if Debian packages are updated.libimagequant
is used for libvips to write 8-bit PNG and GIF files, with an alternative beingquantizr
that is not available in Debian repos but could be built directly.ffmpeg compile/library settings
[--build-arg FFMPEG_VERSION="7.0.1"]
libx264
is used for H.264 video encodinglibx265
is used for HEVC video encoding (unclear on if this is necessary)libvpx
is used for VP8/VP9 video encoding/decodinglibopus
is used for Opus audio encoding/decodinglibdav1d
is used for AV1 decodinglibmp3lame
is used for MP3 audio processinglibvorbis
is used for Vorbis audio processingUltimately I would like to become more restrictive about what formats are compiled as supported in ffmpeg as most are not needed by Mastodon.