diff --git a/lib/frenzy/pipeline/scrape_stage.ex b/lib/frenzy/pipeline/scrape_stage.ex index 828ffdc..199680d 100644 --- a/lib/frenzy/pipeline/scrape_stage.ex +++ b/lib/frenzy/pipeline/scrape_stage.ex @@ -159,7 +159,7 @@ defmodule Frenzy.Pipeline.ScrapeStage do {"src", new_src} _ -> - {"src", image_to_data_uri(convert_to_data_uris, src)} + {"src", image_to_data_uri(src, convert_to_data_uris)} end attr -> @@ -176,7 +176,7 @@ defmodule Frenzy.Pipeline.ScrapeStage do @content_type_allowlist ["image/jpeg", "image/png", "image/heic", "image/heif", "image/tiff"] # convert images to data URIs so that they're stored by clients as part of the body - defp image_to_data_uri(true, src) do + defp image_to_data_uri(src, true) do case HTTPoison.get(src) do {:ok, %HTTPoison.Response{status_code: 200, body: body, headers: headers}} -> {"Content-Type", content_type} = @@ -193,5 +193,5 @@ defmodule Frenzy.Pipeline.ScrapeStage do end end - defp image_to_data_uri(false, src), do: src + defp image_to_data_uri(src, false), do: src end