From 4e7928ab328ea1fa0a0421bfc78397a0278d762c Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Wed, 7 Apr 2021 15:16:43 -0400 Subject: [PATCH] skip optipng for animations --- lib/philomena/processors/png.ex | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/philomena/processors/png.ex b/lib/philomena/processors/png.ex index efcd2c82..90e739ae 100644 --- a/lib/philomena/processors/png.ex +++ b/lib/philomena/processors/png.ex @@ -15,8 +15,13 @@ defmodule Philomena.Processors.Png do } end - def post_process(_analysis, file) do - %{replace_original: optimize(file)} + def post_process(analysis, file) do + if analysis.animated? do + # libpng has trouble with animations, so skip optimization + %{} + else + %{replace_original: optimize(file)} + end end def intensities(_analysis, file) do