Use svgstat instead of magick for svg file analysis

This commit is contained in:
byte[] 2021-10-23 21:55:32 -04:00
parent fbae2a9185
commit c9a47b2e82
2 changed files with 3 additions and 2 deletions

View file

@ -12,6 +12,7 @@ RUN git clone https://github.com/philomena-dev/cli_intensities /tmp/cli_intensit
ADD https://api.github.com/repos/philomena-dev/mediatools/git/refs/heads/master /tmp/mediatools_version.json ADD https://api.github.com/repos/philomena-dev/mediatools/git/refs/heads/master /tmp/mediatools_version.json
RUN git clone https://github.com/philomena-dev/mediatools /tmp/mediatools \ RUN git clone https://github.com/philomena-dev/mediatools /tmp/mediatools \
&& ln -s /usr/lib/librsvg-2.so.2 /usr/lib/librsvg-2.so \
&& cd /tmp/mediatools \ && cd /tmp/mediatools \
&& make -j$(nproc) install && make -j$(nproc) install

View file

@ -12,9 +12,9 @@ defmodule Philomena.Analyzers.Svg do
end end
defp stats(file) do defp stats(file) do
case System.cmd("identify", ["-format", "%W %H\n", file]) do case System.cmd("svgstat", [file]) do
{output, 0} -> {output, 0} ->
[width, height] = [_size, _frames, width, height, _num, _den] =
output output
|> String.trim() |> String.trim()
|> String.split(" ") |> String.split(" ")