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.

80 lines
2.0 KiB

  1. diff -ruN cthumb-4.2/cthumb.in cthumb-4.2-new/cthumb.in
  2. --- cthumb-4.2/cthumb.in 2002-08-13 19:24:05.000000000 +0200
  3. +++ cthumb-4.2-new/cthumb.in 2004-04-04 12:59:31.842021168 +0200
  4. @@ -707,7 +707,7 @@
  5. my $pic = shift;
  6. # $pic =~ /^(.*?)(\.gif|\.jpg)?$/;
  7. - $pic =~ m#^(.*/)?([^/]+)\.(gif|tif+|jpe?g)$#i;
  8. + $pic =~ m#^(.*/)?([^/]+)\.(gif|tif+|jpe?g|png)$#i;
  9. # use thumb/ subdirectory if it already exists
  10. my $base = (defined($1))? $1 : '';
  11. if (-w ($base . "thumb")) {
  12. @@ -742,6 +742,8 @@
  13. }
  14. for my $cmd ("djpeg", "pngtopnm", "giftopnm", "tifftopnm") {
  15. my $pnm = `$cmd "$name" `;
  16. + if ($pnm eq "") { print "not with $cmd ... "; }
  17. + else { print "with $cmd ..."; } ;
  18. return $pnm unless $?;
  19. }
  20. return;
  21. @@ -1069,14 +1071,14 @@
  22. $pictureGeometry,
  23. $pictureSize,
  24. $pictureTitle,
  25. - $pictureStory,
  26. - $pictureTimestamp,
  27. - $albumURL,
  28. - $albumTitle,
  29. - $geometryLink,
  30. - $themePrefix);
  31. - }
  32. - }
  33. + $pictureStory,
  34. + $pictureTimestamp,
  35. + $albumURL,
  36. + $albumTitle,
  37. + $geometryLink,
  38. + $themePrefix);
  39. +}
  40. +}
  41. }
  42. # This function is responsible for generating html for a single image that
  43. @@ -1715,7 +1717,7 @@
  44. my $pnm = "";
  45. if (!($pnm = &get_pnm($src))) {
  46. - die "Cannot scale image `$dest`.";
  47. + warn "Cannot scale image `$dest`, cthumb will fail!";
  48. }
  49. # make pnmscale shut up (version in redhat 7.2
  50. # spits out stuff to stderr, even without -verbose, arggh)
  51. @@ -1730,7 +1732,7 @@
  52. close PNMTOTHUMB;
  53. print "done.\n";
  54. } else {
  55. - die "Cannot scale image `$dest`.";
  56. + warn "Cannot scale image `$dest`.";
  57. }
  58. }
  59. @@ -1766,6 +1768,17 @@
  60. }
  61. }
  62. + if ($picname =~ /\.png$/i) {
  63. + open FILE, "pngtopnm \"$picname\" | pnmfile |" or
  64. + return "";
  65. + $_ = <FILE>;
  66. + if (/^stdin:\s+PPM raw, (\d+) by (\d+)/) {
  67. + $width = $1; $height = $2;
  68. + close FILE;
  69. + return "$width" . "x" . "$height";
  70. + }
  71. + }
  72. +
  73. return "";
  74. }