1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../cthumb/png.patch
5 # Copyright (C) 2004 - 2005 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
16 diff -ruN cthumb-4.2/cthumb.in cthumb-4.2-new/cthumb.in
17 --- cthumb-4.2/cthumb.in 2002-08-13 19:24:05.000000000 +0200
18 +++ cthumb-4.2-new/cthumb.in 2004-04-04 12:59:31.842021168 +0200
22 # $pic =~ /^(.*?)(\.gif|\.jpg)?$/;
23 - $pic =~ m#^(.*/)?([^/]+)\.(gif|tif+|jpe?g)$#i;
24 + $pic =~ m#^(.*/)?([^/]+)\.(gif|tif+|jpe?g|png)$#i;
25 # use thumb/ subdirectory if it already exists
26 my $base = (defined($1))? $1 : '';
27 if (-w ($base . "thumb")) {
30 for my $cmd ("djpeg", "pngtopnm", "giftopnm", "tifftopnm") {
31 my $pnm = `$cmd "$name" `;
32 + if ($pnm eq "") { print "not with $cmd ... "; }
33 + else { print "with $cmd ..."; } ;
34 return $pnm unless $?;
37 @@ -1069,14 +1071,14 @@
59 # This function is responsible for generating html for a single image that
63 if (!($pnm = &get_pnm($src))) {
64 - die "Cannot scale image `$dest`.";
65 + warn "Cannot scale image `$dest`, cthumb will fail!";
67 # make pnmscale shut up (version in redhat 7.2
68 # spits out stuff to stderr, even without -verbose, arggh)
73 - die "Cannot scale image `$dest`.";
74 + warn "Cannot scale image `$dest`.";
78 @@ -1766,6 +1768,17 @@
82 + if ($picname =~ /\.png$/i) {
83 + open FILE, "pngtopnm \"$picname\" | pnmfile |" or
86 + if (/^stdin:\s+PPM raw, (\d+) by (\d+)/) {
87 + $width = $1; $height = $2;
89 + return "$width" . "x" . "$height";