logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 3a5231ec8fd0583d7f4bf05378d8bb81096c4f40
parent dd1de994d57e3d9c99bb4e4c7019c696b5153f50
Author: Mark Felder <feld@FreeBSD.org>
Date:   Thu, 27 Aug 2020 16:33:37 -0500

Keep args construction within video/image scopes instead of mangling down in fifo town

Diffstat:

Mlib/pleroma/helpers/media_helper.ex7+------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/lib/pleroma/helpers/media_helper.ex b/lib/pleroma/helpers/media_helper.ex @@ -16,6 +16,7 @@ defmodule Pleroma.Helpers.MediaHelper do {:ok, env} <- Pleroma.HTTP.get(url), {:ok, fifo_path} <- mkfifo() do + args = List.flatten([fifo_path, args]) run_fifo(fifo_path, env, executable, args) else nil -> {:error, {:convert, :command_not_found}} @@ -58,12 +59,6 @@ defmodule Pleroma.Helpers.MediaHelper do end defp run_fifo(fifo_path, env, executable, args) do - args = - if _executable = System.find_executable("convert") do - List.flatten([fifo_path, args]) - else - args - end pid = Port.open({:spawn_executable, executable}, [:use_stdio, :stream, :exit_status, :binary, args: args]) fifo = Port.open(to_charlist(fifo_path), [:eof, :binary, :stream, :out]) true = Port.command(fifo, env.body)