public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/perl-GD] epel9: Fix copy and paste error in updated image format support (#2048953)
@ 2026-06-09 20:12 Paul Howarth
  0 siblings, 0 replies; only message in thread
From: Paul Howarth @ 2026-06-09 20:12 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/perl-GD
            Branch : epel9
            Commit : 62b30a688d0b81e5ddf6c5f3be6de5f5b12a9d32
            Author : Paul Howarth <paul@city-fan.org>
            Date   : 2022-02-01T12:58:14+00:00
            Stats  : +79/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/perl-GD/c/62b30a688d0b81e5ddf6c5f3be6de5f5b12a9d32?branch=epel9

            Log:
            Fix copy and paste error in updated image format support (#2048953)

This fixes a problem that manifests in GDGraph with GD 2.75:
https://rt.cpan.org/Public/Bug/Display.html?id=140910
https://github.com/lstein/Perl-GD/pull/43

  : Not a TIFF or MDI file, bad magic number 25635 (0x6423).
  GD Warning: Cannot open TIFF imagegdImageCreateFromTiff error at
    /usr/local/lib/perl5/site_perl/5.34.0/x86_64-linux-gnu/GD/Image.pm line 256.
  t/bugfixes.t ...................
  Dubious, test returned 25 (wstat 6400, 0x1900)
  Failed 14/33 subtests

---
diff --git a/GD-2.75-copy-paste.patch b/GD-2.75-copy-paste.patch
new file mode 100644
index 0000000..f12457a
--- /dev/null
+++ b/GD-2.75-copy-paste.patch
@@ -0,0 +1,69 @@
+From 96c5f7b43c68a26de448150d186ac2fe20f8c7c8 Mon Sep 17 00:00:00 2001
+From: Paul Howarth <paul@city-fan.org>
+Date: Tue, 1 Feb 2022 12:46:05 +0000
+Subject: [PATCH] Fix copy and paste error in updated image format support
+
+This fixes a problem that manifests in GDGraph with GD 2.75:
+https://rt.cpan.org/Public/Bug/Display.html?id=140910
+
+: Not a TIFF or MDI file, bad magic number 25635 (0x6423).
+GD Warning: Cannot open TIFF imagegdImageCreateFromTiff error at /usr/local/lib/perl5/site_perl/5.34.0/x86_64-linux-gnu/GD/Image.pm line 256.
+t/bugfixes.t ...................
+Dubious, test returned 25 (wstat 6400, 0x1900)
+Failed 14/33 subtests
+---
+ lib/GD/Image.pm    |  6 +++---
+ lib/GD/Image_pm.PL | 13 -------------
+ 2 files changed, 3 insertions(+), 16 deletions(-)
+
+diff --git a/lib/GD/Image.pm b/lib/GD/Image.pm
+index 9cd3abd..48ed81c 100644
+--- a/lib/GD/Image.pm
++++ b/lib/GD/Image.pm
+@@ -229,11 +229,11 @@ sub newFromTiff {
+ }
+ 
+ sub newFromXbm {
+-    croak("Usage: newFromTiff(class,filehandle)") unless @_==2;
++    croak("Usage: newFromXbm(class,filehandle)") unless @_==2;
+     my($class,$f) = @_;
+     my $fh = $class->_make_filehandle($f);
+     binmode($fh);
+-    $class->_newFromTiff($fh);
++    $class->_newFromXbm($fh);
+ }
+ 
+ sub newFromWebp {
+@@ -252,7 +252,7 @@ sub newFromHeif {
+     $class->_newFromHeif($fh);
+ }
+ 
+-sub newFromHeif {
++sub newFromAvif {
+     croak("Usage: newFromAvif(class,filehandle)") unless @_==2;
+     my($class,$f) = @_;
+     my $fh = $class->_make_filehandle($f);
+diff --git a/lib/GD/Image_pm.PL b/lib/GD/Image_pm.PL
+index e73e8ae..a4693ef 100644
+--- a/lib/GD/Image_pm.PL
++++ b/lib/GD/Image_pm.PL
+@@ -317,19 +317,6 @@ sub newFromXbm {
+ !NO!SUBS!
+ }
+ 
+-if ($DEFINES =~ /HAVE_TIFF/) {
+-  print OUT <<'!NO!SUBS!'
+-sub newFromXbm {
+-    croak("Usage: newFromTiff(class,filehandle)") unless @_==2;
+-    my($class,$f) = @_;
+-    my $fh = $class->_make_filehandle($f);
+-    binmode($fh);
+-    $class->_newFromTiff($fh);
+-}
+-
+-!NO!SUBS!
+-}
+-
+ if ($DEFINES =~ /HAVE_WEBP/) {
+   print OUT <<'!NO!SUBS!'
+ sub newFromWebp {

diff --git a/perl-GD.spec b/perl-GD.spec
index ea7e050..4c9a474 100644
--- a/perl-GD.spec
+++ b/perl-GD.spec
@@ -1,12 +1,13 @@
 Name:           perl-GD
 Version:        2.75
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Perl interface to the GD graphics library
 License:        GPL+ or Artistic 2.0
 URL:            https://metacpan.org/release/GD
 Source0:        https://cpan.metacpan.org/modules/by-module/GD/GD-%{version}.tar.gz
 Patch0:         GD-2.74-utf8.patch
 Patch1:         GD-2.70-cflags.patch
+Patch2:         GD-2.75-copy-paste.patch
 # Module Build
 BuildRequires:  coreutils
 BuildRequires:  findutils
@@ -61,6 +62,10 @@ create PNG images on the fly or modify existing files.
 # Upstream wants -Wformat=1 but we don't
 %patch1
 
+# Fix copy and paste errors introduced in GD 2.75 (#2048953, CPAN RT#140910)
+# https://github.com/lstein/Perl-GD/pull/43
+%patch2 -p1
+
 # Fix shellbangs in sample scripts
 perl -pi -e 's|/usr/local/bin/perl\b|%{__perl}|' \
       demos/{*.{pl,cgi},truetype_test}
@@ -94,6 +99,10 @@ make test TEST_VERBOSE=1
 %{_mandir}/man3/GD::Simple.3*
 
 %changelog
+* Tue Feb  1 2022 Paul Howarth <paul@city-fan.org> - 2.75-2
+- Fix copy and paste errors introduced in GD 2.75
+  (#2048953, CPAN RT#140910, GH#43)
+
 * Wed Jan 26 2022 Paul Howarth <paul@city-fan.org> - 2.75-1
 - Update to 2.75
   - Add experimental support for TIFF and RAQM (with freetype)

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

only message in thread, other threads:[~2026-06-09 20:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-09 20:12 [rpms/perl-GD] epel9: Fix copy and paste error in updated image format support (#2048953) Paul Howarth

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