public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gif2png] rawhide: fix tests F45FTBFS rhbz#2503919
@ 2026-07-22  1:34 Filipe Rosset
  0 siblings, 0 replies; only message in thread
From: Filipe Rosset @ 2026-07-22  1:34 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/gif2png
Branch : rawhide
Commit : c1f389bc8dd99c1add61914816799528378ac68e
Author : Filipe Rosset <rosset.filipe@gmail.com>
Date   : 2026-07-21T22:34:48-03:00
Stats  : +82/-2 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/gif2png/c/c1f389bc8dd99c1add61914816799528378ac68e?branch=rawhide

Log:
fix tests F45FTBFS rhbz#2503919

---
diff --git a/gif2png-3.0.4-test-compare.patch b/gif2png-3.0.4-test-compare.patch
new file mode 100644
index 0000000..cd49ff0
--- /dev/null
+++ b/gif2png-3.0.4-test-compare.patch
@@ -0,0 +1,79 @@
+diff -urN gif2png-3.0.4-orig/tests/compare_png.go gif2png-3.0.4/tests/compare_png.go
+--- gif2png-3.0.4-orig/tests/compare_png.go	1969-12-31 21:00:00.000000000 -0300
++++ gif2png-3.0.4/tests/compare_png.go	2026-07-21 21:27:54.071750193 -0300
+@@ -0,0 +1,52 @@
++package main
++
++import (
++	"fmt"
++	"image"
++	_ "image/gif"
++	_ "image/png"
++	"os"
++)
++
++func main() {
++	if len(os.Args) < 3 {
++		fmt.Println("Usage: compare <file1> <file2>")
++		os.Exit(1)
++	}
++	f1, err := os.Open(os.Args[1])
++	if err != nil {
++		fmt.Printf("Error opening %s: %v\n", os.Args[1], err)
++		os.Exit(1)
++	}
++	defer f1.Close()
++	f2, err := os.Open(os.Args[2])
++	if err != nil {
++		fmt.Printf("Error opening %s: %v\n", os.Args[2], err)
++		os.Exit(1)
++	}
++	defer f2.Close()
++	img1, _, err := image.Decode(f1)
++	if err != nil {
++		fmt.Printf("Error decoding %s: %v\n", os.Args[1], err)
++		os.Exit(1)
++	}
++	img2, _, err := image.Decode(f2)
++	if err != nil {
++		fmt.Printf("Error decoding %s: %v\n", os.Args[2], err)
++		os.Exit(1)
++	}
++	b1 := img1.Bounds()
++	b2 := img2.Bounds()
++	if b1 != b2 {
++		fmt.Printf("Bounds differ: %v vs %v\n", b1, b2)
++		os.Exit(1)
++	}
++	for y := b1.Min.Y; y < b1.Max.Y; y++ {
++		for x := b1.Min.X; x < b1.Max.X; x++ {
++			if img1.At(x, y) != img2.At(x, y) {
++				fmt.Printf("Pixels differ at (%d, %d)\n", x, y)
++				os.Exit(1)
++			}
++		}
++	}
++}
+diff -urN gif2png-3.0.4-orig/tests/Makefile gif2png-3.0.4/tests/Makefile
+--- gif2png-3.0.4-orig/tests/Makefile	2026-07-21 21:27:52.299976167 -0300
++++ gif2png-3.0.4/tests/Makefile	2026-07-21 21:27:56.455722911 -0300
+@@ -7,8 +7,11 @@
+ test: gif2png-test web2png-test
+ 
+ # Run this to regression-test the converter
+-gif2png-test:
+-	for x in $(IMAGESTEMS); do echo "$${x}:"; ../gif2png -v $${x}.gif; cmp $${x}.png $${x}.png-check; done
++gif2png-test: compare_png
++	for x in $(IMAGESTEMS); do echo "$${x}:"; ../gif2png -v $${x}.gif; ./compare_png $${x}.png $${x}.png-check; done
++
++compare_png: compare_png.go
++	go build -mod=vendor -o compare_png compare_png.go
+ 
+ # Run this as a visual check. The thing to do is 'Next' a couple times 
+ # on each pair to verify that the image and its conversion are visually 
+@@ -30,4 +33,4 @@
+ 	-diff -u style.css-gif style.css
+ 
+ clean: 
+-	rm -f *.png *.bak
++	rm -f *.png *.bak compare_png

diff --git a/gif2png.spec b/gif2png.spec
index a498490..7a51e71 100644
--- a/gif2png.spec
+++ b/gif2png.spec
@@ -16,11 +16,12 @@ URL:            http://www.catb.org/~esr/gif2png/
 Source0:        %{url}%{name}-%{version}.tar.gz
 Source1:        vendor.tar.bz2
 Source2:        go-vendor-tools.toml
+Patch:          gif2png-3.0.4-test-compare.patch
 
-BuildRequires:  go-vendor-tools
 BuildRequires:  compiler(go-compiler)
-BuildRequires:  make
 BuildRequires:  diffutils
+BuildRequires:  go-vendor-tools
+BuildRequires:  make
 
 %description
 The gif2png program converts files from the Graphic Interchange Format (GIF) to

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-22  1:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-22  1:34 [rpms/gif2png] rawhide: fix tests F45FTBFS rhbz#2503919 Filipe Rosset

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox