public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Paul Howarth <paul@city-fan.org>
To: git-commits@fedoraproject.org
Subject: [rpms/perl-GD] epel9: Fix copy and paste error in updated image format support (#2048953)
Date: Tue, 09 Jun 2026 20:12:02 GMT	[thread overview]
Message-ID: <178103592291.1.9798632636189555369.rpms-perl-GD-62b30a688d0b@fedoraproject.org> (raw)

            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)

                 reply	other threads:[~2026-06-09 20:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178103592291.1.9798632636189555369.rpms-perl-GD-62b30a688d0b@fedoraproject.org \
    --to=paul@city-fan.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox