Page MenuHomePhabricator

Install gerrit image-diff plugin
Open, Needs TriagePublic

Assigned To
None
Authored By
hashar
Jul 6 2023, 8:45 PM
Referenced Files
F37132318: graymode.png
Jul 7 2023, 4:01 PM
F37132315: transparent.png
Jul 7 2023, 4:01 PM
F37132313: diff.png
Jul 7 2023, 4:01 PM
F37132305: after.png
Jul 7 2023, 4:01 PM
F37132303: before.png
Jul 7 2023, 4:01 PM

Description

Mentioned by Tyler during a meeting: add the ability to diff images in Gerrit. There is a JavaScript plugin for it:

https://gerrit.googlesource.com/plugins/image-diff
https://github.com/GerritCodeReview/plugins_image-diff#image-diff

That requires an inline build with bazel build plugins/image-diff to install the dependencies.

The plugin can be tested against
https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/902211/1/static/images/project-logos/dkwikimedia.png which slightly change the Danmark Wikimedia logo:

BeforeAfter
before.png (155×135 px, 8 KB)
after.png (139×135 px, 3 KB)

Which then let you see the differences (using cyan but that can be changed via a color picker):

diff.png (245×679 px, 22 KB)

Make the images transparent to better see the diff:

transparent.png (245×679 px, 21 KB)

Or go in gray mode:

graymode.png (245×679 px, 24 KB)

There are some CSS glitches though but that do not seem too worrysome.

Event Timeline

+ @Paladox since I am pretty sure you talked about image-diff in the future and you have the relevant expertise for PolyGerrit plugins :)

If course I had to send a few patches due to the plugin depending on Resemble.JS 3.2.4 which hard depend on canvascairosome missing system libs. I have send some fixes to upstream: