Index: inline_upload.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/inline/inline_upload.module,v
retrieving revision 1.7
diff -u -p -r1.7 inline_upload.module
--- inline_upload.module	11 Aug 2009 19:06:42 -0000	1.7
+++ inline_upload.module	12 Aug 2009 02:59:32 -0000
@@ -305,10 +305,10 @@ function _inline_upload_decide_img_tag($
       list($maxwidth, $maxheight) = explode(',', variable_get('inline_upload_img_dim', '150,150'));
 
       if (!empty($file->in_preview)) {
-        list($width, $height) = getimagesize($file->real_path);
+        list($width, $height) = @getimagesize($file->real_path);
       }
       else {
-        list($width, $height) = getimagesize($file->filepath);
+        list($width, $height) = @getimagesize($file->filepath);
       }
       if (($width && $height) && ($width <= $maxwidth && $height <= $maxheight)) {
         return TRUE;
@@ -347,8 +347,10 @@ function theme_inline_upload_img($file, 
   // Prepare link text with inline title, file description or filename.
   $title = (!empty($file->title) ? $file->title : (!empty($file->description) ? $file->description : $file->filename));
   $inline_upload_preset = ($field == 'teaser' ? 'inline_upload_teaser_preset' : 'inline_upload_full_preset');
-  
+  $url = file_create_url($file->filepath);
+
   if (module_exists('imagecache') && variable_get($inline_upload_preset, '') != '') {
+    // ImageCache implements its own private files handling.
     $output = theme('imagecache',
       variable_get($inline_upload_preset, ''),
       $file->filepath,
@@ -358,12 +360,15 @@ function theme_inline_upload_img($file, 
     );
   }
   else {
+    // Private files support: theme_image() requires us to set $getsize to FALSE
+    // and prepare image attributes on our own.
+    $info = image_get_info($file->filepath);
     $output = theme('image',
-      $file->filepath,
+      $url,
       $title,
       $title,
-      array('class' => 'inline'),
-      !isset($file->in_preview)
+      array('class' => 'inline', 'width' => $info['width'], 'height' => $info['height']),
+      FALSE
     );
   }
   
@@ -372,7 +377,7 @@ function theme_inline_upload_img($file, 
       'class' => 'inline-image-link',
       'title' => t('View: @file', array('@file' => $title)),
     );
-    $output = l($output, $file->filepath, array('attributes' => $attributes, 'html' => TRUE));
+    $output = l($output, $url, array('attributes' => $attributes, 'html' => TRUE));
   }
   
   return $output;
