Merge branch 'vips' into 'develop'

Replace ImageMagick with Vips

See merge request pleroma/pleroma!3771
This commit is contained in:
lain 2023-11-29 06:03:37 +00:00
commit 1955b3c557
14 changed files with 79 additions and 64 deletions

BIN
test/fixtures/png_with_transparency.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View file

@ -20,6 +20,20 @@ defmodule Pleroma.Upload.Filter.AnalyzeMetadataTest do
assert meta.blurhash
end
test "it blurhashes images with an alpha component" do
upload = %Pleroma.Upload{
name: "an… image.jpg",
content_type: "image/jpeg",
path: Path.absname("test/fixtures/png_with_transparency.png"),
tempfile: Path.absname("test/fixtures/png_with_transparency.png")
}
{:ok, :filtered, meta} = AnalyzeMetadata.filter(upload)
assert %{width: 320, height: 320} = meta
assert meta.blurhash == "eXJi-E:SwCEm5rCmn$+YWYn+15K#5A$xxCi{SiV]s*W:Efa#s.jE-T"
end
test "adds the dimensions for videos" do
upload = %Pleroma.Upload{
name: "coolvideo.mp4",