Index: filefield_paths.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filefield_paths/filefield_paths.module,v
retrieving revision 1.19.2.32
diff -w -u -p -r1.19.2.32 filefield_paths.module
--- filefield_paths.module	2 Aug 2009 23:22:33 -0000	1.19.2.32
+++ filefield_paths.module	3 Sep 2009 15:35:52 -0000
@@ -132,6 +132,9 @@ function filefield_paths_form_alter(&$fo
           }
         }
 
+        // Ensure that field will accommodate longer token combinations.
+        $field_data['form_path'][$name]['#maxlength'] = 256;
+
         $field_data['form_path'][$name .'_cleanup'] = array(
           '#type' => 'fieldset',
           '#title' => t('!title cleanup settings', array('!title' => $field['title'])),
@@ -485,6 +488,10 @@ function filefield_paths_filefield_paths
     $file['filepath']['new'] = filefield_paths_process_string(file_directory_path() .'/'. $settings['filepath']['value'] .'/'. $file['filename']['new'], 'node', $node, $settings['filepath']);
     $file['filepath']['new'] = filefield_paths_process_string($file['filepath']['new'], 'field', array(0 => $file['field']), $settings['filepath']);
 
+    // Ensure that there are no double-slash sequences due to empty token values.
+    $file['filepath']['new'] = preg_replace('|/+|', '/', $file['filepath']['new']);
+    $file['filename']['new'] = preg_replace('|/+|', '/', $file['filename']['new']);
+
     // Finalize files if necessary
     if (dirname($file['filepath']['new']) != dirname($file['field']['filepath']) || $file['filename']['new'] != $file['field']['filename']) {
       if (filefield_paths_file_move($file)) {
Index: modules/image.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filefield_paths/modules/Attic/image.inc,v
retrieving revision 1.1.2.5
diff -w -u -p -r1.1.2.5 image.inc
--- modules/image.inc	2 Aug 2009 23:22:33 -0000	1.1.2.5
+++ modules/image.inc	31 Aug 2009 18:48:20 -0000
@@ -68,7 +68,7 @@ function image_filefield_paths_get_field
           ),
           'module' => 'image',
           'name' => 'image',
-          'new' => $node->new_file
+          'new' => $node->new_file || $node->rebuild_images,
         );
 
         $ffp['#types']['image'] = TRUE;
