Merge branch 'metadata-for-all' into 'develop'
Support metadata for video files too See merge request pleroma/pleroma!3441
This commit is contained in:
commit
1175023687
5 changed files with 57 additions and 4 deletions
BIN
test/fixtures/video.mp4
vendored
Normal file
BIN
test/fixtures/video.mp4
vendored
Normal file
Binary file not shown.
|
|
@ -6,7 +6,7 @@ defmodule Pleroma.Upload.Filter.AnalyzeMetadataTest do
|
|||
use Pleroma.DataCase, async: true
|
||||
alias Pleroma.Upload.Filter.AnalyzeMetadata
|
||||
|
||||
test "adds the image dimensions" do
|
||||
test "adds the dimensions and blurhash for images" do
|
||||
upload = %Pleroma.Upload{
|
||||
name: "an… image.jpg",
|
||||
content_type: "image/jpeg",
|
||||
|
|
@ -14,6 +14,20 @@ defmodule Pleroma.Upload.Filter.AnalyzeMetadataTest do
|
|||
tempfile: Path.absname("test/fixtures/image.jpg")
|
||||
}
|
||||
|
||||
assert {:ok, :filtered, %{width: 1024, height: 768}} = AnalyzeMetadata.filter(upload)
|
||||
{:ok, :filtered, meta} = AnalyzeMetadata.filter(upload)
|
||||
|
||||
assert %{width: 1024, height: 768} = meta
|
||||
assert meta.blurhash
|
||||
end
|
||||
|
||||
test "adds the dimensions for videos" do
|
||||
upload = %Pleroma.Upload{
|
||||
name: "coolvideo.mp4",
|
||||
content_type: "video/mp4",
|
||||
path: Path.absname("test/fixtures/video.mp4"),
|
||||
tempfile: Path.absname("test/fixtures/video.mp4")
|
||||
}
|
||||
|
||||
assert {:ok, :filtered, %{width: 480, height: 480}} = AnalyzeMetadata.filter(upload)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue