[Bins] remove trailing whitespace

Martin Michlmayr tbm at cyrius.com
Fri Dec 30 17:17:08 GMT 2005


Here's a patch to remoe some trailing whitespace from the output of
bins:

--- bins~	2005-12-30 18:02:27.000000000 +0100
+++ bins	2005-12-30 18:16:07.000000000 +0100
@@ -1733,8 +1733,7 @@
     my @subalbumHashList;       # goes into albumHash
     #print "generateAlbumPages($album)\n";
     if ($verbose >=1) {
-        print xml2local($_)." > " foreach (@parentDirNames);
-        print "\n";
+        print join(" > ", map { xml2local($_) } @parentDirNames), "\n";
     }
 
     # first, make sure web directory exists
@@ -3411,7 +3410,7 @@
     my ($origName, $newName, $newWidth, $newHeight,
         $imageRef, $configHash) = @_;
     beVerbose("    Generating scaled version of $picdir$origName\n".
-              "      to be written to $newName... ", 2);
+              "      to be written to $newName...", 2);
     if (-e "$albumdir$newName"){
         if (((lstat("$albumdir$newName"))[9]) >= ((stat("$picdir$origName"))[9])){
             beVerboseN("\n    image already exists and is newer, skipping.", 2);
@@ -3432,14 +3431,14 @@
                 (! ($configHash->{rotateImages} eq 'destination') ||
                  (! defined $imageRef->{'Orientation'} ||
                   $imageRef->{'Orientation'} eq "top_left"))) {
-                beVerbose("\n    Image has the right size, just linking... ", 2);
+                beVerbose("\n    Image has the right size, just linking...", 2);
                 my $newpath;
                 if( $configHash->{linkRelative} ) {
                     $newpath = relpath("$albumdir$newName", "$picdir$origName");
                 } else {
                     $newpath = "$picdir$origName";
                 }
-                beVerboseN("Linking from $albumdir$newName to $newpath... ", 2);
+                beVerboseN("Linking from $albumdir$newName to $newpath...", 2);
                 system("ln", "-sf", $newpath, "$albumdir$newName") == 0
                     or die("\nCannot link $albumdir$newName to $newpath: $?");
                 # the original file may be r/o but we don't have to modify it
@@ -3453,7 +3452,7 @@
                 return 0; # Image is processed, no need to try to process it
                 # again.
             } else {
-                beVerbose("\n    Image has the right size, just copying... ", 2);
+                beVerbose("\n    Image has the right size, just copying...", 2);
                 system("cp", "-p", "$picdir$origName", "$albumdir$newName") == 0
                     or die("\nCannot copy $picdir$origName to $albumdir$newName: $?");
                 # make it writable in case $origName was r/o
@@ -3485,7 +3484,7 @@
                               height=>$borderOnThumbnails);
         warn "$x" if "$x";
     }
-    beVerbose("\n    Writing scaled image $albumdir$newName... ", 3);
+    beVerbose("\n    Writing scaled image $albumdir$newName...", 3);
     $x = $preview->Write("$albumdir$newName");
     warn "$x" if "$x";
     beVerboseN("done.", 2);
@@ -4411,7 +4410,7 @@
 
     # create Grove document if file didn't exist
     if (!$document) {
-        beVerbose("   Creating new XML description file $file... ", 3);
+        beVerbose("   Creating new XML description file $file...", 3);
         $description =
             XML::Grove::Element->new ( Name => 'description',
                                        Contents => [charac_indent(1)]);
@@ -4476,7 +4475,7 @@
     }
     push @{$exif->{Contents}}, charac_indent(1);
     # Write the Grove to the desc file
-    beVerbose("  Saving XML description file $file... ", 3);
+    beVerbose("  Saving XML description file $file...", 3);
     my $fileHandler = new IO::File;
     open($fileHandler, '>', $file)
         or die("Cannot open file $file to write Exif tag ($!)");
@@ -4745,7 +4744,7 @@
         my $verbose = shift;
 
         if ($rotateGeneric eq "none") {
-            beVerbose("  Looking for a generic rotation utility (mogrify)... ", 3);
+            beVerbose("  Looking for a generic rotation utility (mogrify)...", 3);
             if (commandAvailable("mogrify")) {
                 $rotateGeneric = 'mogrify -rotate %s "%s"';
                 beVerboseN(" found mogrify.", 3);
@@ -4774,7 +4773,7 @@
         my $verbose = shift;
 
         if ($rotateJPEG eq "none") {
-            beVerbose("\n  Looking for a JPEG rotation utility (jpegtran)... ", 3);
+            beVerbose("\n  Looking for a JPEG rotation utility (jpegtran)...", 3);
             if (commandAvailable("jpegtran")) {
                 $rotateJPEG = 'jpegtran -copy all -rotate %s -outfile "%s.tmp" "%s" && mv "%s.tmp" "%s"';
                 beVerboseN(" found jpegtran.", 3);
@@ -4846,7 +4845,7 @@
         return 0;
     }
 
-    beVerbose(" Performing $degrees degrees rotation clockwise on $imageName... ",
+    beVerbose(" Performing $degrees degrees rotation clockwise on $imageName...",
               2);
     my $type = "";
     if ($ext) {
@@ -4856,7 +4855,7 @@
     }
     my $command = rotateCommand($type, $imageName, $degrees, $configHash);
     if ($command){
-        beVerbose("\n   Running '$command'... ", 3);
+        beVerbose("\n   Running '$command'...", 3);
         if(!system($command)){
             #$imageInfo->{'BinsRotated'}="yes";
             beVerboseN("OK", 2);
@@ -4881,7 +4880,7 @@
         my $verbose = shift;
 
         if ($progressifyJPEG eq "none") {
-            beVerbose("\n  Looking for a progressive JPEG utility (jpegtran)... ", 3);
+            beVerbose("\n  Looking for a progressive JPEG utility (jpegtran)...", 3);
             if (commandAvailable("jpegtran")) {
                 $progressifyJPEG = 'jpegtran -copy all -progressive -outfile "%s" "%s"';
                 beVerboseN(" found jpegtran.", 3);
@@ -4921,12 +4920,12 @@
     my $configHash = shift;
     my $tempFile = "$imageName.tmp";
 
-    beVerbose("     Making $imageName progressive JPEG... ", 2);
+    beVerbose("     Making $imageName progressive JPEG...", 2);
 
     my $command = progressifyJPEGCommand($imageName, $tempFile, $verbose);
 
     if ($command) {
-        beVerbose("\n      Running '$command'... ", 3);
+        beVerbose("\n      Running '$command'...", 3);
         if(!system($command)){
             if (($configHash->{jpegProgressify} eq "always")) {
                 rename($tempFile, $imageName)

-- 
Martin Michlmayr
http://www.cyrius.com/


More information about the Bins mailing list