fix invalid mime error on reverse search

This commit is contained in:
byte[] 2020-09-08 00:02:24 -04:00
parent f2c1dbab0b
commit bd2e9b4171

View file

@ -26,8 +26,10 @@ defmodule PhilomenaWeb.ImageReverse do
end
defp analyze(%Plug.Upload{path: path}) do
{:ok, analysis} = Analyzers.analyze(path)
{analysis, path}
case Analyzers.analyze(path) do
{:ok, analysis} -> {analysis, path}
_ -> :error
end
end
defp analyze(_upload), do: :error