mirror of the now-defunct rocklinux.org
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.

99 lines
2.9 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/avm/cthumb/png.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. diff -ruN cthumb-4.2/cthumb.in cthumb-4.2-new/cthumb.in
  20. --- cthumb-4.2/cthumb.in 2002-08-13 19:24:05.000000000 +0200
  21. +++ cthumb-4.2-new/cthumb.in 2004-04-04 12:59:31.842021168 +0200
  22. @@ -707,7 +707,7 @@
  23. my $pic = shift;
  24. # $pic =~ /^(.*?)(\.gif|\.jpg)?$/;
  25. - $pic =~ m#^(.*/)?([^/]+)\.(gif|tif+|jpe?g)$#i;
  26. + $pic =~ m#^(.*/)?([^/]+)\.(gif|tif+|jpe?g|png)$#i;
  27. # use thumb/ subdirectory if it already exists
  28. my $base = (defined($1))? $1 : '';
  29. if (-w ($base . "thumb")) {
  30. @@ -742,6 +742,8 @@
  31. }
  32. for my $cmd ("djpeg", "pngtopnm", "giftopnm", "tifftopnm") {
  33. my $pnm = `$cmd "$name" `;
  34. + if ($pnm eq "") { print "not with $cmd ... "; }
  35. + else { print "with $cmd ..."; } ;
  36. return $pnm unless $?;
  37. }
  38. return;
  39. @@ -1069,14 +1071,14 @@
  40. $pictureGeometry,
  41. $pictureSize,
  42. $pictureTitle,
  43. - $pictureStory,
  44. - $pictureTimestamp,
  45. - $albumURL,
  46. - $albumTitle,
  47. - $geometryLink,
  48. - $themePrefix);
  49. - }
  50. - }
  51. + $pictureStory,
  52. + $pictureTimestamp,
  53. + $albumURL,
  54. + $albumTitle,
  55. + $geometryLink,
  56. + $themePrefix);
  57. +}
  58. +}
  59. }
  60. # This function is responsible for generating html for a single image that
  61. @@ -1715,7 +1717,7 @@
  62. my $pnm = "";
  63. if (!($pnm = &get_pnm($src))) {
  64. - die "Cannot scale image `$dest`.";
  65. + warn "Cannot scale image `$dest`, cthumb will fail!";
  66. }
  67. # make pnmscale shut up (version in redhat 7.2
  68. # spits out stuff to stderr, even without -verbose, arggh)
  69. @@ -1730,7 +1732,7 @@
  70. close PNMTOTHUMB;
  71. print "done.\n";
  72. } else {
  73. - die "Cannot scale image `$dest`.";
  74. + warn "Cannot scale image `$dest`.";
  75. }
  76. }
  77. @@ -1766,6 +1768,17 @@
  78. }
  79. }
  80. + if ($picname =~ /\.png$/i) {
  81. + open FILE, "pngtopnm \"$picname\" | pnmfile |" or
  82. + return "";
  83. + $_ = <FILE>;
  84. + if (/^stdin:\s+PPM raw, (\d+) by (\d+)/) {
  85. + $width = $1; $height = $2;
  86. + close FILE;
  87. + return "$width" . "x" . "$height";
  88. + }
  89. + }
  90. +
  91. return "";
  92. }