booru / philomena

Next-generation imageboard software. This software development project is independent from any image hosting project.
GNU Affero General Public License v3.0
9 stars 10 forks source link

transparent gif thumbnail generation keeps all layers #29

Open basisbit opened 4 years ago

basisbit commented 4 years ago

Describe the bug thumbnail creation of partially transparent gif files is somewhat broken. Layers of previous frames do not get deleted before drawing the next frame. Sample of current result: Image of broken chicken gif

To Reproduce Steps to reproduce the behavior:

  1. Upload that gif from expected behaviour section into your booru.
  2. Wait until the preview generation finished and it shows up on the frontpage.
  3. Look at the preview image. should be affected by the problem.

Expected behavior How it should look: Image of correct chicken gif

Desktop (please complete the following information):

Additional context Other boorus seem to have worked around the problem by patching ffmpeg according to https://github.com/philomena-dev/FFmpeg/commits/ Maybe changing the docker container setup to use a patched ffmpeg works as a temporary bugfix for the problem, until https://trac.ffmpeg.org/ticket/7902 is fixed.

basisbit commented 4 years ago

workaround: add # for commenting out all lines inside the function

  defp scale_if_smaller(
         palette,
         file,
         {width, height},
         {thumb_name, {target_width, target_height}}
       ) do

in lib/philomena/processors/gif.ex except for the line

[{:symlink_original, "#{thumb_name}.gif"}]