OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.7 KiB

  1. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # T2 SDE: package/.../cthumb/png.patch
  5. # Copyright (C) 2004 - 2006 The T2 SDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  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
  14. # version.
  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
  19. @@ -707,7 +707,7 @@
  20. my $pic = shift;
  21. # $pic =~ /^(.*?)(\.gif|\.jpg)?$/;
  22. - $pic =~ m#^(.*/)?([^/]+)\.(gif|tif+|jpe?g)$#i;
  23. + $pic =~ m#^(.*/)?([^/]+)\.(gif|tif+|jpe?g|png)$#i;
  24. # use thumb/ subdirectory if it already exists
  25. my $base = (defined($1))? $1 : '';
  26. if (-w ($base . "thumb")) {
  27. @@ -742,6 +742,8 @@
  28. }
  29. for my $cmd ("djpeg", "pngtopnm", "giftopnm", "tifftopnm") {
  30. my $pnm = `$cmd "$name" `;
  31. + if ($pnm eq "") { print "not with $cmd ... "; }
  32. + else { print "with $cmd ..."; } ;
  33. return $pnm unless $?;
  34. }
  35. return;
  36. @@ -1069,14 +1071,14 @@
  37. $pictureGeometry,
  38. $pictureSize,
  39. $pictureTitle,
  40. - $pictureStory,
  41. - $pictureTimestamp,
  42. - $albumURL,
  43. - $albumTitle,
  44. - $geometryLink,
  45. - $themePrefix);
  46. - }
  47. - }
  48. + $pictureStory,
  49. + $pictureTimestamp,
  50. + $albumURL,
  51. + $albumTitle,
  52. + $geometryLink,
  53. + $themePrefix);
  54. +}
  55. +}
  56. }
  57. # This function is responsible for generating html for a single image that
  58. @@ -1715,7 +1717,7 @@
  59. my $pnm = "";
  60. if (!($pnm = &get_pnm($src))) {
  61. - die "Cannot scale image `$dest`.";
  62. + warn "Cannot scale image `$dest`, cthumb will fail!";
  63. }
  64. # make pnmscale shut up (version in redhat 7.2
  65. # spits out stuff to stderr, even without -verbose, arggh)
  66. @@ -1730,7 +1732,7 @@
  67. close PNMTOTHUMB;
  68. print "done.\n";
  69. } else {
  70. - die "Cannot scale image `$dest`.";
  71. + warn "Cannot scale image `$dest`.";
  72. }
  73. }
  74. @@ -1766,6 +1768,17 @@
  75. }
  76. }
  77. + if ($picname =~ /\.png$/i) {
  78. + open FILE, "pngtopnm \"$picname\" | pnmfile |" or
  79. + return "";
  80. + $_ = <FILE>;
  81. + if (/^stdin:\s+PPM raw, (\d+) by (\d+)/) {
  82. + $width = $1; $height = $2;
  83. + close FILE;
  84. + return "$width" . "x" . "$height";
  85. + }
  86. + }
  87. +
  88. return "";
  89. }