diff options
-rw-r--r-- | activestorage/app/models/active_storage/preview.rb | 4 | ||||
-rw-r--r-- | activestorage/lib/active_storage/analyzer/video_analyzer.rb | 4 | ||||
-rw-r--r-- | activestorage/lib/active_storage/previewer.rb | 2 | ||||
-rw-r--r-- | guides/source/active_storage_overview.md | 11 | ||||
-rw-r--r-- | guides/source/development_dependencies_install.md | 28 |
5 files changed, 39 insertions, 10 deletions
diff --git a/activestorage/app/models/active_storage/preview.rb b/activestorage/app/models/active_storage/preview.rb index de58763399..dd50494799 100644 --- a/activestorage/app/models/active_storage/preview.rb +++ b/activestorage/app/models/active_storage/preview.rb @@ -22,8 +22,8 @@ # Outside of a Rails application, modify +ActiveStorage.previewers+ instead. # # The built-in previewers rely on third-party system libraries. Specifically, the built-in video previewer requires -# {ffmpeg}[https://www.ffmpeg.org]. Two PDF previewers are provided: one requires {Poppler}[https://poppler.freedesktop.org], -# and the other requires {mupdf}[https://mupdf.com] (version 1.8 or newer). To preview PDFs, install either Poppler or mupdf. +# {FFmpeg}[https://www.ffmpeg.org]. Two PDF previewers are provided: one requires {Poppler}[https://poppler.freedesktop.org], +# and the other requires {muPDF}[https://mupdf.com] (version 1.8 or newer). To preview PDFs, install either Poppler or muPDF. # # These libraries are not provided by Rails. You must install them yourself to use the built-in previewers. Before you # install and use third-party software, make sure you understand the licensing implications of doing so. diff --git a/activestorage/lib/active_storage/analyzer/video_analyzer.rb b/activestorage/lib/active_storage/analyzer/video_analyzer.rb index e31bdb0edb..18d8ff8237 100644 --- a/activestorage/lib/active_storage/analyzer/video_analyzer.rb +++ b/activestorage/lib/active_storage/analyzer/video_analyzer.rb @@ -16,7 +16,7 @@ module ActiveStorage # # When a video's angle is 90 or 270 degrees, its width and height are automatically swapped for convenience. # - # This analyzer requires the {ffmpeg}[https://www.ffmpeg.org] system library, which is not provided by Rails. + # This analyzer requires the {FFmpeg}[https://www.ffmpeg.org] system library, which is not provided by Rails. class Analyzer::VideoAnalyzer < Analyzer def self.accept?(blob) blob.video? @@ -107,7 +107,7 @@ module ActiveStorage JSON.parse(output.read) end rescue Errno::ENOENT - logger.info "Skipping video analysis because ffmpeg isn't installed" + logger.info "Skipping video analysis because FFmpeg isn't installed" {} end diff --git a/activestorage/lib/active_storage/previewer.rb b/activestorage/lib/active_storage/previewer.rb index 13657bf13e..fb202f029a 100644 --- a/activestorage/lib/active_storage/previewer.rb +++ b/activestorage/lib/active_storage/previewer.rb @@ -31,7 +31,7 @@ module ActiveStorage # Executes a system command, capturing its binary output in a tempfile. Yields the tempfile. # - # Use this method to shell out to a system library (e.g. mupdf or ffmpeg) for preview image + # Use this method to shell out to a system library (e.g. muPDF or FFmpeg) for preview image # generation. The resulting tempfile can be used as the +:io+ value in an attachable Hash: # # def preview diff --git a/guides/source/active_storage_overview.md b/guides/source/active_storage_overview.md index cb9acdadcf..e7a94fc510 100644 --- a/guides/source/active_storage_overview.md +++ b/guides/source/active_storage_overview.md @@ -446,11 +446,12 @@ the box, Active Storage supports previewing videos and PDF documents. </ul> ``` -WARNING: Extracting previews requires third-party applications, `ffmpeg` for -video and `mutool` for PDFs. These libraries are not provided by Rails. You must -install them yourself to use the built-in previewers. Before you install and use -third-party software, make sure you understand the licensing implications of -doing so. +WARNING: Extracting previews requires third-party applications, `FFmpeg` for +video and `muPDF` for PDFs, and on macOS also `XQuartz` and `Poppler`. +These libraries are not provided by Rails. You must install them yourself to +use the built-in previewers. Before you install and use third-party software, +make sure you understand the licensing implications of doing so. + Direct Uploads -------------- diff --git a/guides/source/development_dependencies_install.md b/guides/source/development_dependencies_install.md index 50274d700b..fdd560ccf3 100644 --- a/guides/source/development_dependencies_install.md +++ b/guides/source/development_dependencies_install.md @@ -376,3 +376,31 @@ command inside of the `activestorage` directory to install the dependencies: ```bash yarn install ``` + +Extracting previews, tested in ActiveStorage's test suite requires third-party +applications, `FFmpeg` for video and `muPDF` for PDFs, and on macOS also +`XQuartz` and `Poppler`.. Without these applications installed, ActiveStorage +tests will raise errors. + +On macOS you can run: + +```bash +brew install ffmpeg +brew cask install xquartz +brew install mupdf-tools +brew install poppler +``` + +On Ubuntu, you can run: + +```bash +sudo apt-get update && install ffmpeg +sudo apt-get update && install mupdf mupdf-tools +``` + +On Fedora or CentOS, just run: + +```bash +sudo yum install ffmpeg +sudo yum install mupdf +``` |