lib/ex_captcha.ex

defmodule ExCaptcha do
  @moduledoc """
  """
  def get do
    case System.cmd(Application.app_dir(:ex_captcha, "priv/captcha"), []) do
      {data, 0} ->
        <<text::bytes-size(5), img::binary>> = data
        {:ok, text, img}

      _other ->
        :error
    end
  end
end