--- sites/all/modules/menu_icons/menu_icons_orig.module
+++ sites/all/modules/menu_icons/menu_icons.module
@@ -214,6 +214,15 @@
     ),
     '#required' => FALSE,
   );
+  if (module_exists('taxonomy_image')) {
+    $form['menu_icons_taxonomy_image_auto_create_icons'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Auto create icons from taxonomy images'),
+      '#default_value' => variable_get('menu_icons_taxonomy_image_auto_create_icons', false),
+      '#tree' => FALSE,
+      '#description' => t('Check this if you want to auto create icons for taxonomy terms which have taxonomy images attached (taxonomy_menu module can handle auto creation of menus).')
+    );
+  }
   return system_settings_form($form);
 }
 
@@ -223,6 +232,10 @@
  * @return A string with the CSS
  */
 function menu_icons_css_generate() {
+  $taxonomy_image_auto_create_icons = variable_get('menu_icons_taxonomy_image_auto_create_icons', false); 
+  if ($taxonomy_image_auto_create_icons)
+    $result = db_query("SELECT mlid, options, link_path FROM {menu_links}");
+  else
   $result = db_query("SELECT mlid, options FROM {menu_links}");
   $pos = variable_get('menu_icons_position', 'left');
 
@@ -230,6 +243,18 @@
 
     $options = unserialize($item['options']);
 
+    if ($taxonomy_image_auto_create_icons) {
+      $path = explode('/',$item['link_path']);
+      if($path[0] == 'taxonomy' && $path[1]== 'term' && isset($path[2]) && $path[2] != "%"){        
+        $image_object = taxonomy_image_get_object($path[2]);
+        if ($options['menu_icon']['enable'] != 1 && isset($image_object)) {
+          $options['menu_icon']['enable'] = 1;
+          $options['menu_icon']['path'] = file_directory_path()."/". variable_get('taxonomy_image_path', 'category_pictures') .'/'.$image_object->path ;   
+          $options['menu_icon']['imagecache_preset'] = variable_get('menu_icons_imagecache_default', 'menu_icon');
+        }
+      }
+    }
+    
     if ($options['menu_icon']['enable'] && !empty($options['menu_icon']['path']) && file_exists($options['menu_icon']['path'])) {
 
       if (module_exists('imagecache')) {
