Index: design/admin/templates/rss/edit_export.tpl
===================================================================
--- design/admin/templates/rss/edit_export.tpl	(revision 24325)
+++ design/admin/templates/rss/edit_export.tpl	(working copy)
@@ -189,6 +189,19 @@
          </select>
        </div>
 
+       <div class="block">
+         <label>{'Enclosure (media)'|i18n( 'design/admin/rss/edit_export' )} ({'optional'|i18n( 'design/admin/rss/edit_export' )}):</label>
+         <select name="Item_Class_Attribute_Enclosure_{$Source:index}" title="{'Use this drop-down to select the attribute that should be exported as the enclosure of the RSS export entry, enclosures are direct link to a media file, so use a media/image/file datatype .'|i18n('design/admin/rss/edit_export')}" onchange="document.getElementById('Ignore_Values_On_Browse_{$Source:index}').value=0;">
+         <option value="">[{'Skip'|i18n('design/admin/rss/edit_export')}]</option>
+         {foreach $rss_export.item_list[$Source:index].class_attributes as $class_attribute}
+         <option value="{$class_attribute.identifier|wash}"
+             {if eq( $Source:item.enclosure, $class_attribute.identifier )}
+                 selected="selected"
+             {/if}>{$class_attribute.name|wash}</option>
+         {/foreach}
+         </select>
+       </div>
+
        {/section}
 
        <input class="button" type="submit" name="{concat( 'RemoveSource_', $Source:index )}" value="{'Remove this source'|i18n( 'design/admin/rss/edit_export' )}" title="{'Click to remove this source from the RSS export.'|i18n('design/admin/rss/edit_export')}" />
Index: design/standard/templates/rss/edit_export.tpl
===================================================================
--- design/standard/templates/rss/edit_export.tpl	(revision 24325)
+++ design/standard/templates/rss/edit_export.tpl	(working copy)
@@ -176,6 +176,19 @@
 
 	     <br/>
 
+         <label>{"Enclosure (media)"|i18n("design/standard/rss/edit")} ({"optional"|i18n("design/standard/rss/edit")}):</label><div class="labelbreak"></div>
+         <select name="Item_Class_Attribute_Enclosure_{$Source:index}">
+         <option value="">[{"Skip"|i18n("design/standard/rss/edit")}]</option>
+         {foreach $rss_export.item_list[$Source:index].class_attributes as $class_attribute}
+         <option value="{$class_attribute.identifier|wash}"
+             {if eq( $Source:item.enclosure, $class_attribute.identifier )}
+                 selected="selected"
+             {/if}>{$class_attribute.name|wash}</option>
+         {/foreach}
+         </select>
+
+         <br/>
+
        {/section}
 
        {include uri="design:gui/button.tpl"
Index: kernel/classes/ezrssexport.php
===================================================================
--- kernel/classes/ezrssexport.php	(revision 24325)
+++ kernel/classes/ezrssexport.php	(working copy)
@@ -945,6 +945,9 @@
                         // category is optional
                         $catAttributeIdentifier = $attributeMapping[0]->attribute( 'category' );
                         $category = $catAttributeIdentifier ? $dataMap[$catAttributeIdentifier] : false;
+                        // category is optional
+                        $enclosureAttributeIdentifier = $attributeMapping[0]->attribute( 'enclosure' );
+                        $enclosure = $enclosureAttributeIdentifier ? $dataMap[$enclosureAttributeIdentifier] : false;
                         break;
                     }
                 }
@@ -988,15 +991,28 @@
                 // description RSS element with respective class attribute content
                 if ( $description )
                 {
-                    $descriptionContent = $description->attribute( 'content' );
-                    if ( $descriptionContent instanceof eZXMLText )
+                    $descContent = $description->attribute( 'content' );
+                    if ( $descContent instanceof eZXMLText )
                     {
-                        $outputHandler =  $descriptionContent->attribute( 'output' );
+                        $outputHandler =  $descContent->attribute( 'output' );
                         $itemDescriptionText = $outputHandler->attribute( 'output_text' );
                     }
+                    else if ( $descContent instanceof eZImageAliasHandler )
+                    {
+                        $itemImage   = $descContent->hasAttribute( 'rssitem' ) ? $descContent->attribute( 'rssitem' ) : $descContent->attribute( 'rss' );
+                        $origImage   = $descContent->attribute( 'original' );
+                        eZURI::transformURI( $itemImage['full_path'], true, 'full' );
+                        eZURI::transformURI( $origImage['full_path'], true, 'full' );
+                        $itemDescriptionText = '&lt;a href="' . htmlspecialchars( $origImage['full_path'] )
+                                             . '"&gt;&lt;img alt="' . htmlspecialchars( $descContent->attribute( 'alternative_text' ) )
+                                             . '" src="' . htmlspecialchars( $itemImage['full_path'] )
+                                             . '" width="' . $itemImage['width']
+                                             . '" height="' . $itemImage['height']
+                                             . '" /&gt;&lt;/a&gt;';
+                    }
                     else
                     {
-                        $itemDescriptionText = $descriptionContent;
+                        $itemDescriptionText = $descContent;
                     }
                     $item->description = $itemDescriptionText;
                 }
@@ -1025,6 +1041,48 @@
                         $cat->term = $itemCategoryText;
                     }
                 }
+                
+                // enclosure RSS element with respective class attribute content
+                if ( $enclosure )
+                {
+                    $encItemURL       = false;
+                    $enclosureContent = $enclosure->attribute( 'content' );
+                    if ( $enclosureContent instanceof eZMedia )
+                    {
+                        $enc         = $item->add( 'enclosure' );
+                        $enc->length = $enclosureContent->attribute('filesize');
+                        $enc->type   = $enclosureContent->attribute('mime_type');
+                        $encItemURL = 'content/download/' . $enclosure->attribute('contentobject_id')
+                                    . '/' . $enclosureContent->attribute( 'contentobject_attribute_id' )
+                                    . '/' . urlencode( $enclosureContent->attribute( 'original_filename' ) );
+                        eZURI::transformURI( $encItemURL, false, 'full' );
+                    }
+                    else if ( $enclosureContent instanceof eZBinaryFile )
+                    {
+                        $enc         = $item->add( 'enclosure' );
+                        $enc->length = $enclosureContent->attribute('filesize');
+                        $enc->type   = $enclosureContent->attribute('mime_type');
+                        $encItemURL = 'content/download/' . $enclosure->attribute('contentobject_id')
+                                    . '/' . $enclosureContent->attribute( 'contentobject_attribute_id' )
+                                    . '/version/' . $enclosureContent->attribute( 'version' )
+                                    . '/file/' . urlencode( $enclosureContent->attribute( 'original_filename' ) );
+                        eZURI::transformURI( $encItemURL, false, 'full' );
+                    }
+                    else if ( $enclosureContent instanceof eZImageAliasHandler )
+                    {
+                        $enc         = $item->add( 'enclosure' );
+                        $origImage   = $enclosureContent->attribute( 'original' );
+                        $enc->length = $origImage['filesize'];
+                        $enc->type   = $origImage['mime_type'];
+                        $encItemURL  = $origImage['full_path'];
+                        eZURI::transformURI( $encItemURL, true, 'full' );
+                    }
+
+                    if ( $encItemURL )
+                    {
+                        $enc->url = $encItemURL;
+                    }
+                }
 
                 $item->published = $object->attribute( 'published' );
                 $item->updated = $object->attribute( 'published' );
Index: kernel/classes/ezrssexportitem.php
===================================================================
--- kernel/classes/ezrssexportitem.php	(revision 24325)
+++ kernel/classes/ezrssexportitem.php	(working copy)
@@ -51,7 +51,7 @@
 
     static function definition()
     {
-        return array( "fields" => array( "id" => array( 'name' => 'ID',
+        return array( 'fields' => array( 'id' => array( 'name' => 'ID',
                                                         'datatype' => 'integer',
                                                         'default' => 0,
                                                         'required' => true ),
@@ -88,6 +88,10 @@
                                                            'datatype' => 'string',
                                                            'default' => '',
                                                            'required' => true ),
+                                         'enclosure' => array( 'name' => 'Enclosure',
+                                                           'datatype' => 'string',
+                                                           'default' => '',
+                                                           'required' => false ),
                                          'status' => array( 'name' => 'Status',
                                                             'datatype' => 'integer',
                                                             'default' => 0,
@@ -96,13 +100,13 @@
                                                               'datatype' => 'integer',
                                                               'default' => 0,
                                                               'required' => true ) ),
-                      "keys" => array( "id", 'status' ),
+                      'keys' => array( 'id', 'status' ),
                       'function_attributes' => array( 'class_attributes' => 'classAttributes',
                                                       'source_node' => 'sourceNode',
                                                       'source_path' => 'sourcePath' ),
-                      "increment_key" => "id",
-                      "class_name" => "eZRSSExportItem",
-                      "name" => "ezrss_export_item" );
+                      'increment_key' => 'id',
+                      'class_name' => 'eZRSSExportItem',
+                      'name' => 'ezrss_export_item' );
     }
 
     /*!
@@ -121,6 +125,7 @@
                       'url_id' => '',
                       'description' => '',
                       'title' => '',
+                      'enclosure' => '',
                       'status' => 0,
                       'subnodes' => 0);
         return new eZRSSExportItem( $row );
Index: kernel/classes/ezsiteinstaller.php
===================================================================
--- kernel/classes/ezsiteinstaller.php	(revision 24325)
+++ kernel/classes/ezsiteinstaller.php	(working copy)
@@ -1374,6 +1374,10 @@
             $rssExportItem->setAttribute( 'source_node_id', $item['source_node_id'] );
             $rssExportItem->setAttribute( 'status', $item['status'] );
             $rssExportItem->setAttribute( 'title', $item['title'] );
+            if ( isset( $item['enclosure'] ) )
+            {
+                $rssExportItem->setAttribute( 'enclosure', $item['enclosure'] );
+            }
             $rssExportItem->store();
         }
     }
Index: kernel/content/ezcontentoperationcollection.php
===================================================================
--- kernel/content/ezcontentoperationcollection.php	(revision 24325)
+++ kernel/content/ezcontentoperationcollection.php	(working copy)
@@ -1352,6 +1352,9 @@
                 if ( isset( $feedObjectAttributeMap['category'] ) )
                     $rssExportItem->setAttribute( 'category', $feedObjectAttributeMap['category'] );
 
+                if ( isset( $feedObjectAttributeMap['enclosure'] ) )
+                    $rssExportItem->setAttribute( 'enclosure', $feedObjectAttributeMap['enclosure'] );
+
                 $rssExportItem->setAttribute( 'source_node_id', $nodeID );
                 $rssExportItem->setAttribute( 'status', eZRSSExport::STATUS_VALID );
                 $rssExportItem->setAttribute( 'subnodes', isset( $subNodesMap[$currentClassIdentifier] ) && $subNodesMap[$currentClassIdentifier] === 'true' );
Index: kernel/rss/edit_functions.php
===================================================================
--- kernel/rss/edit_functions.php	(revision 24325)
+++ kernel/rss/edit_functions.php	(working copy)
@@ -61,7 +61,7 @@
         /* Create the new RSS feed */
         for ( $itemCount = 0; $itemCount < $http->postVariable( 'Item_Count' ); $itemCount++ )
         {
-            if ( $skipValuesID == $http->postVariable( 'Item_ID_'.$itemCount ) )
+            if ( $skipValuesID == $http->postVariable( 'Item_ID_' . $itemCount ) )
             {
                 continue;
             }
@@ -121,9 +121,13 @@
                 }
             }
 
-            $rssExportItem->setAttribute( 'title', $http->postVariable( 'Item_Class_Attribute_Title_'.$itemCount ) );
-            $rssExportItem->setAttribute( 'description', $http->postVariable( 'Item_Class_Attribute_Description_'.$itemCount ) );
-            $rssExportItem->setAttribute( 'category', $http->postVariable( 'Item_Class_Attribute_Category_'.$itemCount ) );
+            $rssExportItem->setAttribute( 'title', $http->postVariable( 'Item_Class_Attribute_Title_' . $itemCount ) );
+            $rssExportItem->setAttribute( 'description', $http->postVariable( 'Item_Class_Attribute_Description_' . $itemCount ) );
+            $rssExportItem->setAttribute( 'category', $http->postVariable( 'Item_Class_Attribute_Category_' . $itemCount ) );
+
+            if ( $http->hasPostVariable( 'Item_Class_Attribute_Enclosure_' . $itemCount ) )
+                $rssExportItem->setAttribute( 'enclosure', $http->postVariable( 'Item_Class_Attribute_Enclosure_' . $itemCount ) );
+
             if( $publish && $valid )
             {
                 $rssExportItem->setAttribute( 'status', 1 );
@@ -217,6 +221,9 @@
         if ( isset( $feedObjectAttributeMap['category'] ) )
             $rssExportItem->setAttribute( 'category', $feedObjectAttributeMap['category'] );
 
+        if ( isset( $feedObjectAttributeMap['enclosure'] ) )
+            $rssExportItem->setAttribute( 'enclosure', $feedObjectAttributeMap['enclosure'] );
+
         $rssExportItem->setAttribute( 'subnodes', isset( $subNodesMap[$nodeClassIdentifier] ) && $subNodesMap[$nodeClassIdentifier] === 'true' );
         $rssExportItem->store();
     }
Index: kernel/sql/mysql/kernel_schema.sql
===================================================================
--- kernel/sql/mysql/kernel_schema.sql	(revision 24325)
+++ kernel/sql/mysql/kernel_schema.sql	(working copy)
@@ -1221,6 +1221,7 @@
   status int(11) NOT NULL default '0',
   subnodes int(11) NOT NULL default '0',
   title varchar(255) default NULL,
+  enclosure varchar(255) default NULL,
   PRIMARY KEY  (id,status),
   KEY ezrss_export_rsseid (rssexport_id)
 ) ENGINE=InnoDB;
Index: kernel/sql/postgresql/kernel_schema.sql
===================================================================
--- kernel/sql/postgresql/kernel_schema.sql	(revision 24325)
+++ kernel/sql/postgresql/kernel_schema.sql	(working copy)
@@ -2309,7 +2309,8 @@
     source_node_id integer,
     status integer DEFAULT 0 NOT NULL,
     subnodes integer DEFAULT 0 NOT NULL,
-    title character varying(255)
+    title character varying(255),
+    enclosure character varying(255)
 );
 
 
Index: settings/image.ini
===================================================================
--- settings/image.ini	(revision 24325)
+++ settings/image.ini	(working copy)
@@ -60,6 +60,7 @@
 AliasList[]=medium
 AliasList[]=large
 AliasList[]=rss
+# AliasList[]=rssitem
 # AliasList[]=gray
 # AliasList[]=zoom
 
@@ -124,6 +125,13 @@
 # maximum value for height is 400, default value is 31.
 
 
+# Optional image alias used in rss feed items if you specify image
+# attribute as source for description tag, 'rss' is used instead if disabled
+# 
+# [rssitem]
+# Reference=reference
+# Filters[]=geometry/scaledownonly=128;128
+
 # An example alias which converts the image to grayscale
 #
 # [gray]
Index: share/db_schema.dba
===================================================================
--- share/db_schema.dba	(revision 24325)
+++ share/db_schema.dba	(working copy)
@@ -5532,6 +5532,12 @@
         'type' => 'varchar',
         'default' => NULL,
       ),
+      'enclosure' => 
+      array (
+        'length' => 255,
+        'type' => 'varchar',
+        'default' => NULL,
+      ),
     ),
     'indexes' => 
     array (
Index: update/database/mysql/4.3/unstable/dbupdate-4.2.0-to-4.3.0alpha1.sql
===================================================================
--- update/database/mysql/4.3/unstable/dbupdate-4.2.0-to-4.3.0alpha1.sql	(revision 24325)
+++ update/database/mysql/4.3/unstable/dbupdate-4.2.0-to-4.3.0alpha1.sql	(working copy)
@@ -6,3 +6,6 @@
 UPDATE ezdbfile set scope='classattridentifiers' WHERE scope='classattributeidenti';
 UPDATE ezdbfile set scope='classattridentifiers' WHERE scope='classattributeidenfiers';
 -- END: from 4.2.0 using cluster setup
+
+
+ALTER TABLE ezrss_export_item ADD COLUMN enclosure VARCHAR( 255 ) NULL;
Index: update/database/postgresql/4.3/unstable/dbupdate-4.2.0-to-4.3.0alpha1.sql
===================================================================
--- update/database/postgresql/4.3/unstable/dbupdate-4.2.0-to-4.3.0alpha1.sql	(revision 24325)
+++ update/database/postgresql/4.3/unstable/dbupdate-4.2.0-to-4.3.0alpha1.sql	(working copy)
@@ -5,3 +5,6 @@
 UPDATE ezdbfile set scope='classattridentifiers' WHERE scope='classattributeidenti';
 UPDATE ezdbfile set scope='classattridentifiers' WHERE scope='classattributeidenfiers';
 -- END: from 4.2.0 using cluster setup
+
+
+ALTER TABLE ezrss_export_item ADD COLUMN enclosure VARCHAR( 255 ) NULL;
