[#2497] Configurability of :min_content_length (preview proxy). Refactoring, documentation, tests.

This commit is contained in:
Ivan Tashkinov 2020-09-17 17:13:40 +03:00
commit 7cdbd91d83
8 changed files with 329 additions and 63 deletions

View file

@ -444,7 +444,8 @@ config :pleroma, :media_preview_proxy,
enabled: false,
thumbnail_max_width: 600,
thumbnail_max_height: 600,
image_quality: 85
image_quality: 85,
min_content_length: 100 * 1024
config :pleroma, :chat, enabled: true

View file

@ -1961,17 +1961,25 @@ config :pleroma, :config_description, [
%{
key: :thumbnail_max_width,
type: :integer,
description: "Max width of preview thumbnail."
description:
"Max width of preview thumbnail for images (video preview always has original dimensions)."
},
%{
key: :thumbnail_max_height,
type: :integer,
description: "Max height of preview thumbnail."
description:
"Max height of preview thumbnail for images (video preview always has original dimensions)."
},
%{
key: :image_quality,
type: :integer,
description: "Quality of the output. Ranges from 0 (min quality) to 100 (max quality)."
},
%{
key: :min_content_length,
type: :integer,
description:
"Min content length to perform preview, in bytes. If greater than 0, media smaller in size will be served as is, without thumbnailing."
}
]
},