Skip to content

Process Fails to Convert an Animated GIF With an Odd Width or Height #281

Closed

Description

@ptr727

Problem

process fails on an animated GIF whose width or height is odd, and the run exits 2 on every pass.

The GIF is converted to MP4 with libx264, which requires even dimensions. ffmpeg stops with:

[libx264] width not divisible by 2 (25x70)
Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
Conversion failed!

The file stays on disk unconverted, is counted as failed, and fails again on the next run, so a collection holding one such file never has a clean process exit.

How to reproduce

Run process on a folder holding any animated GIF with an odd width or an odd height, for example 25 by 70 pixels.

Expected

The conversion handles odd dimensions, for example by padding or scaling to the next even size, or the file is kept as a GIF and the run does not count it as a failure.

Activity

  1. added
    bug
    on Nov 18, 2026
  2. ptr727 commented on Nov 18, 2026

    @ptr727
    OwnerAuthor

    Maintainer's answer (2026-11-18, backlog burndown): pad to even dimensions. Add pad=ceil(iw/2)*2:ceil(ih/2)*2 to the GIF re-encode so every source pixel is kept unscaled and at most one edge row or column is added. Scaling and keeping the file as a GIF were declined.

  3. ptr727 commented on Nov 18, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-18): #286 merged to develop at d3906ab, and its branch and worktree are cleaned up. The issue closes when the promotion to main lands.

    Backlog burndown claim (2026-11-18, round 1): group #280 + #281 on branch fix/process-collision-and-odd-gif.

    Predicted files:

    • PhotoCleaner/ProcessTask.cs
    • PhotoCleanerTests/ProcessTaskTests.cs
    • GUIDE.md
    • ARCHITECTURE.md
    • README.md (granted 2026-11-18: the Undo Flow known limitation and the --skipbackup note describe the behaviour this change alters)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions