Use System.cmd and match on the exit code
This commit is contained in:
parent
3c71a5038a
commit
4b3f7a497f
@ -34,11 +34,9 @@ defmodule Pleroma.Upload.Filter.HeifToJpeg do
|
||||
|
||||
File.rename!(tempfile, with_extension)
|
||||
|
||||
convert_cmd =
|
||||
"heif-convert #{with_extension} #{jpeg}"
|
||||
|> String.to_charlist()
|
||||
args = [with_extension, jpeg]
|
||||
|
||||
:os.cmd(convert_cmd)
|
||||
{_, 0} = System.cmd("heif-convert", args)
|
||||
|
||||
File.rm!(with_extension)
|
||||
File.rename!(jpeg, tempfile)
|
||||
|
Loading…
Reference in New Issue
Block a user