Add resizing filter to make sure pictures are not too big

Closes #810

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-08-05 12:48:22 +02:00
parent f3a05929d9
commit 51cd066a14
4 changed files with 67 additions and 2 deletions

View File

@@ -60,9 +60,11 @@ defmodule Mobilizon.Web.Upload do
tempfile: String.t(),
content_type: String.t(),
path: String.t(),
size: integer()
size: integer(),
width: integer(),
height: integer()
}
defstruct [:id, :name, :tempfile, :content_type, :path, :size]
defstruct [:id, :name, :tempfile, :content_type, :path, :size, :width, :height]
@spec store(source, options :: [option()]) :: {:ok, map()} | {:error, any()}
def store(upload, opts \\ []) do