Skip to content

Commit

Permalink
Merge pull request #43119 from brian-kephart/main
Browse files Browse the repository at this point in the history
Add HEIF image types to variable content types
  • Loading branch information
guilleiguaran committed Aug 29, 2021
2 parents 0a4410d + 87f3741 commit 9b60111
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions activestorage/lib/active_storage/engine.rb
Expand Up @@ -42,6 +42,9 @@ class Engine < Rails::Engine # :nodoc:
image/vnd.adobe.photoshop
image/vnd.microsoft.icon
image/webp
image/avif
image/heic
image/heif
)

config.active_storage.web_image_content_types = %w(
Expand Down
4 changes: 2 additions & 2 deletions guides/source/configuring.md
Expand Up @@ -1050,9 +1050,9 @@ You can find more detailed configuration options in the
config.active_storage.paths[:ffprobe] = '/usr/local/bin/ffprobe'
```

* `config.active_storage.variable_content_types` accepts an array of strings indicating the content types that Active Storage can transform through ImageMagick. The default is `%w(image/png image/gif image/jpg image/jpeg image/pjpeg image/tiff image/bmp image/vnd.adobe.photoshop image/vnd.microsoft.icon image/webp)`.
* `config.active_storage.variable_content_types` accepts an array of strings indicating the content types that Active Storage can transform through ImageMagick. The default is `%w(image/png image/gif image/jpg image/jpeg image/pjpeg image/tiff image/bmp image/vnd.adobe.photoshop image/vnd.microsoft.icon image/webp image/avif image/heic image/heif)`.

* `config.active_storage.web_image_content_types` accepts an array of strings regarded as web image content types in which variants can be processed without being converted to the fallback PNG format. If you want to use `WebP` variants in your application you can add `image/webp` to this array. The default is `%w(image/png image/jpeg image/jpg image/gif)`.
* `config.active_storage.web_image_content_types` accepts an array of strings regarded as web image content types in which variants can be processed without being converted to the fallback PNG format. If you want to use `WebP` or `AVIF` variants in your application you can add `image/webp` or `image/avif` to this array. The default is `%w(image/png image/jpeg image/jpg image/gif)`.

* `config.active_storage.content_types_to_serve_as_binary` accepts an array of strings indicating the content types that Active Storage will always serve as an attachment, rather than inline. The default is `%w(text/html
text/javascript image/svg+xml application/postscript application/x-shockwave-flash text/xml application/xml application/xhtml+xml application/mathml+xml text/cache-manifest)`.
Expand Down

0 comments on commit 9b60111

Please sign in to comment.