]> git.donarmstrong.com Git - bin.git/blobdiff - renamepic
* add total element to the invoice template
[bin.git] / renamepic
index e89dc073b9d3c49a07802d685627d50f1a716df7..9d6545e2bcfce31cc53587d05d75b9a22d28bf20 100755 (executable)
--- a/renamepic
+++ b/renamepic
@@ -99,7 +99,6 @@ while (defined($_ = $current_directory->read)) {
 # Rename
 
 foreach my $picture (@pictures) {
-     my $line = sprintf('%03s',$file_counter).$$picture{default_name};
      # view the image
      `feh -FZ $$picture{old_name} > /dev/null` unless $$config{renumber_only};
 
@@ -108,8 +107,10 @@ foreach my $picture (@pictures) {
 
 #     sprintf('%03s',$file_counter);
 
-     $line = $readline->readline('new name:',$line)
+     $$picture{clean_old_name} = $readline->readline('new name:',$$picture{clean_old_name})
          unless $$config{renumber_only};
+     my $line = sprintf('%03s',$file_counter).qq(_$$picture{clean_old_name}_$$picture{picture_time}.$$picture{extension});
+
      # Remove leading and trailing spaces, replace all remaining
      # spaces with _, and remove ugly characters. lowercase everything
      # while we're at it.