When I try to upload images with the image module as a node, they do not show up. What I get in preview mode is the outline or image size but not I cannot see the actual image. When I submit I get a totally blank page.

Comments

tm’s picture

may want to check your file system settings... are the files uploaded at all? there should be a /files/images folder somewhere. also verify that the temp folder you set is accessible by drupal/webserver. you should be getting indications of what is happening in the watchdog logs and system status (administer >> logs).

oh, and verify that you are allowed to use img tags in your input filters.

HelpDrupalHelpMe’s picture

I am getting a "page not found" error when I look in the recent logs. I checked the appropriate folder and the images exist as copies from the original and thumbnail sizes, so they are there. But for some reason they will not display in preview or sumbited node.

I just don't get it. I know it's not my template because I used one of the defaults just to make sure and still the same problem. I just don't know hwy it wont see my images. I do not want them to be public so I set it to the private setting.

tm’s picture

please check your content, filtered by the image content type (administer >> content management >> content). if you have no listings, the node generation is not happening (which would explain the page not found). to verify that it is limited to the nodes not being created, see if you can bring the images up manually (point to it with img tags).

i am not conversant in the module, so you want to check your findings against any issues open against the module; add to any current issues, or submit a new one if you cannot find anything similar. there is a lot of 6.x stuff, indicating a lot of time being focused on getting the module ported to the next drupal release.

otherwise, don't know what to say.

HelpDrupalHelpMe’s picture

I thank you for your help. Maybe someone else can take a stab at it then?

Ok so it looks like the node generation is happening but here is the thing, the images show up! BUT only when I set my 'Download method:' to "Public - files are available using HTTP directly" under 'Site configuration' >> 'File system'.

Another thing...images do not display using the image field in CCK, which is what I really need to happen.

I think the problem lies somewhere in my user access, even though it's the original user account (admin) when I installed drupal.

tm’s picture

you should check the issue queue for imagefield cck if that is what you are needing; there may be something happening there.

HelpDrupalHelpMe’s picture

Just so this isn't left open ended. There is a bug in the imagefield.module and a lot of people are having the same problem.

Just as I suspected the code was duplicating a portion of the URL. It was duplicating 'sytsems/files' into the url so you would get something like 'system/files/system/files/mytype/mynode' which doesn't exist so you would get a no image or just the empty 'shell'.

I added the script below to the imagefield.module file in the imagefield folder by replacing the "_imagefield_image" function (begining part may different for some).

Crossing my fingers so far so good, I can't see the previews before hand but I'm just glad it's working [again crossing fingers]. Hopefully it doesn't go back to working when it wants to .

/* 
* This is a copy of the theme_imagefield_image in imagefield.module
* The only difference is that in the preview there, it does not seem to be working 
*   when you turn on private files
* It is double printing "system/files"
* This code strips out the double including of it
*/
function theme_imagefield_image($file, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE) {

  $file = (array)$file;
  if (!$getsize || (is_file($file['filepath']) && (list($width, $height, $type, $image_attributes) = @getimagesize($file['filepath'])))) {
    $attributes = drupal_attributes($attributes);
    
    if ($file['fid'] == 'upload') {
      $path = $file['preview'];
      // remove system/files/ from this path
      // need to keep it because it is used in the menu
      // but when resubmit to get the real url, do not want it
      $path = substr($path, 13);
    }
    else {
      $path = $file['filepath'];
    }
    
    $alt = empty($alt) ? $file['alt'] : $alt;
    $title = empty($title) ? $file['title'] : $title;
    $url = file_create_url($path);
    return '<img src="'. check_url($url) .'" alt="'.
        check_plain($alt) .'" title="'. check_plain($title) .'" '. $image_attributes . $attributes .' />';
  }
}