Skip to content

Switch gifsicle from archived giflossy fork to mainline - #473

Open
kristofferR wants to merge 5 commits into
ImageOptim:mainfrom
kristofferR:pr/gifsicle-mainline
Open

kristofferR wants to merge 5 commits into
ImageOptim:mainfrom
kristofferR:pr/gifsicle-mainline

Conversation

@kristofferR

Copy link
Copy Markdown

Moves ImageOptim from the archived pornel/giflossy fork to mainline Gifsicle 1.96. The lossy encoder has been upstream for years, so there is no longer a reason to stay on the fork.

The old ImageOptim patch did not apply cleanly to 1.96, so I regenerated it against the new source. It keeps the same behavior as before: --unoptimize and the adaptive palette path remain disabled, while --lossy still works.

Mainline Gifsicle also moved some color code into kcolor.c, which has been added to the Xcode target. Without it, the target compiles but fails at link time.

The patch target now depends on the patch file and Makefile, so changing either one rebuilds the patched tree instead of silently reusing stale output. The result label has also changed from “Giflossy” to “Gifsicle lossy.”

Tested as a universal arm64/x86_64 build with Xcode 27.

Depends on #472. Until that merges, GitHub will also show its commits in this diff.

Development and review history: kristofferR/ImageOptim#3. The change has been tested and verified to convergence there, with no open review findings.

Guetzli and SVGCleaner are archived upstream, and Zopfli's PNG role is
covered by OxiPNG. Removes their submodules, Xcode subprojects, worker
classes, preference keys, prefs/menu UI and credits entries.

pngcrush is deliberately kept, as it is still actively updated upstream.

Localized help text in 25 languages still mentions Zopfli; rewording it
needs a translator, so it is left for a follow-up.
pornel/giflossy has been archived since its --lossy support was merged
upstream. Mainline gifsicle carries it (src/gifsicle.c registers "lossy"
and handles LOSSY_OPT), so the fork is no longer needed.

Points the submodule at kohler/gifsicle and pins release v1.96 instead of
an untagged fork commit.

The ImageOptim patch is regenerated against v1.96: the old 1.89 patch no
longer applied, because mainline dropped the kc_set_gamma call from
do_colormap_change and added an argument to colormap_stream. The new
patch strips the same features and applies with no fuzz or offsets.

Renames the lossy pass from "Giflossy" to "Gifsicle lossy" in the UI,
since the fork is no longer what runs.
Mainline gifsicle split the k-d tree and colour-histogram code (kd3_*,
kchist_*) out of quantize.c into src/kcolor.c. quantize.c and xform.c
still call into it, so without kcolor.c the target compiles but fails
to link on ten undefined symbols.
The Xcode target compiles with HAVE_CONFIG_H and picks up the checked-in
gifsicle/config.h, which still described the archived fork: gifsicle
--version printed 1.88 for a 1.96 build, and the package metadata pointed
at pornel/giflossy. The version fields now match mainline's
AC_INIT([gifsicle],[1.96]), which sets no bug-report address or home page.

scripts/fetch-submodule also gains a submodule sync: git keeps a
submodule's original URL in .git/config once it is initialized, so an
existing checkout would keep fetching giflossy and then fail to apply the
1.96 patch against the stale 1.89 tree. The sync is best effort because
pngquant passes a nested path, which only the recursive update handles.
git submodule sync without --recursive only rewrites .git/config for the
superproject's own submodules, so a submodule of a submodule kept fetching
its old URL: the update below clones a nested submodule but never resyncs
one that already exists. pngquant/src/lib is exactly that case.

The path stays unquoted-safe now, and the failure remains suppressed on
purpose: a caller that passes a nested path (pngquant/Makefile asks for
src/lib) makes sync error out with "pathspec did not match", since that
path is no submodule of this repo. Only the recursive update can fetch it,
so aborting on a sync failure would break that caller.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant