here is the link
http://www2.indiacompetitions.com:82/?q=user/1

the pictures/avatar wont display, whats the problem?

Comments

sangamreddi’s picture

Possible reasons cmod file permissions or drupal permissions if you enable upload module.

Are you uisng private or public method in general settings?

Sunny                      
www.gleez.com | www.sandeepone.com

frankzzsword’s picture

Public - files are available using http directly.

I checked the chmod permissions they are 775, so I guess it wont be a problem.
--------
Always remeber, whatever do, the best be

Kato’s picture

I couldn't see the pictures either, but then I changed it to private after reading a different thread here on the Drupal forums. Worked perfectly since then.

--
http://nglofsalina.com

girishmuraly’s picture

Check this link to check your setup.
If your setup is right, then;

1. check if the folder specified by you (in the administer » users » configure tab ) to put your images exist and has the permissions to be readable.

2. If thats fine, check if the picture you uploaded by editing your profile exists in the images/pictures folder.

sjfarrar’s picture

I am having the same problem, I have followed the guidelines on the site you linked (excellent site btw, very useful), the uploaded images exist, but I still just get the text link to the user profile in the place the picture should be.

I don't think permissions should need to be explicitly set, (i'm running on a windows/php/apache virtual machine while I get the site set up) users obviously have access to the parents folder... normal uploaded images created by the image.module and put in the image galleries work, so I don't understand why these pictures won't show up. The only thing I can think of is some weird theme issue, but I'm using the default bluemarine theme (with user pictures enabled, as per that guide)

Any other ideas?

sangamreddi’s picture

On certain hosts you need chmod permissions they are 777.

another reason may be when any upload modules enabled you need to give view files permissions to view avatars/pictures.

Sunny                      
www.gleez.com | www.sandeepone.com

frankzzsword’s picture

Okay here,

http://www2.indiacompetitions.com:82/?q=user/1

the link to profile image is
http://www2.indiacompetitions.com:82/tmp/pictures/picture-1.gif

but in profile page it shows
http://www2.indiacompetitions.com:82/82/tmp/pictures/picture-1.gif

i checked up everything in drupal admin upload/general settings/ image/ user and cant find this 82/ anywhere.

if anybody knows bout this lemme know

----
Always remeber, whatever do, the best be

girishmuraly’s picture

I think you accidentally specified the creation of the '82' folder. Please check the following:

1. Go to Administer->users->configure. Scroll down and check the value for 'Picture image path' . If possible, please put it in your reply

2. Go to Administer->Settings and scroll down to find your 'File system settings'. What are your settings?

* Have you copied the picture of the avatar you uploaded to the Picture image path in point 1?

* Do you see the directory you have under 'Picture image path' created under the directory mentioned under the 'File system path' in point 2?

frankzzsword’s picture

Hi Giri,
1. Picutre Image Path consist of "pictures" which is a foldr INSIDE tmp/

2. Under File System Settings, theres
file system path "tmp"
and
Temporary directory: "tmp/uploads"

Yes I copied the picutre of avatar in picutre image point.
Yes I see the directory I have mentioned in Picture image path, thats tmp/picutres created under tmp mentioned in file system path.

-----
Always remeber, whatever do, the best be

girishmuraly’s picture

Hope your Temporary dir (tmp/uploads) is not conflicting with your file system path (tmp), unless you by mistake mentioned 'tmp/uploads' instead of '/tmp/uploads'.

Actually, I did face some issues with pictures initially too. This was when I was changing my default theme and my custom logo. I had set the path to default logo as /tmp/pic.jpg. Later when I changed over to another theme, and gave another path to a logo (both at general settings and in the specific theme settings), Drupal was still reading the path I gave previously. Since the site was still new, I took the liberty of resetting all settings and then giving the path to my logo again. It worked this time.

francoud’s picture

Same problem with me. It works fine if I run the server on port 80. If I run apache on port 81, the profile page tries to load src="81/xxx/pictures.." etc.

tunesmith’s picture

vanilla install... I'm on port 81... the user's picture href ends up as "81/files/pictures/picture-7.jpg" when it exists on disk as "/files/pictures/picture-7.jpg". There's some weird port number bug.

inkubitti’s picture

I have the same problem on my sites after upgrading from 4.6 to 4.7. I configured the pictures just as I did with other 4.7 fresh install, but the result is confusing.

(1) In Firefox after mouse right click and 'view image' on link "inkubitti's picture" I get this page: http://inkubio.tky.fi/beta/?q=system/files/pictures/picture-1.jpg

(2) But writing path directly to address bar gives this:
http://inkubio.tky.fi/beta/files/pictures/picture-1.jpg

Same issue is little different with an other user and gif image:

(1) http://inkubio.tky.fi/beta/?q=system/files/pictures/picture-12.gif gives:
"The image 'http://inkubio.tky.fi/beta/?q=system/files/pictures/picture-12.gif' cannot be displayed, because it contains errors."

(2) http://inkubio.tky.fi/beta/files/pictures/picture-12.gif

In both cases the result is that I can't see users’ pictures but only the link 'user's picture'. Images are uploaded after the upgrading process and the max image size is set to 150x150px 50kb.

girishmuraly’s picture

Wierd things happening with picture posting lol!

inkubitti, all I can think about your problem is that, either you have Enabled clean urls or you have a Rewrite rule getting accessed all the time, that strips the ?q=<> part.

I havent tried an upgrade to 4.7, so dont know if thats causing this too.

inkubitti’s picture

There was some conflict with flexinode module and headers, but my friend got it work. Now my links above don't describe the real problem anymore. I still have a problem which I thinks is related to earlier issue. My avatars looks great but all other uploaded files are now corrupted =)

geocalleo’s picture

Okay so I see what the problem is. In theme.inc, on line 521, drupal is adding the base path twice. To temporarily solve the issue, I went ahead and commented out line 521, then copied and pasted it and took out base_path() in the check_url function. I have pasted the modified function for anyone to copy and paste it into their own file.

Hope this helps. I'm not a Drupal expert so hopefully someone can get this issue patched up.

function theme_image($path, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE) {
  if (!$getsize || (is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) {
    $attributes = drupal_attributes($attributes);
   // return '<img src="'. check_url(base_path() . $path) .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $image_attributes . $attributes .' />';
    return '<img src="'. check_url($path) .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $image_attributes . $attributes .' />';
  }
}
francoud’s picture

I tried to apply your patch but I received just this error:

warning: Cannot modify header information - headers already sent by (output started at D:\Apache2\htdocs\drupal\includes\theme.inc:1) in D:\Apache2\htdocs\drupal\includes\common.inc on line 139

What did I wrong?

BTW I've the same problem - user's picture cant be loaded. As I can see, the problem is only when I run the server on port other than 80 (I run on 81): the <IMG src=""> tag is:
<img src="81/mysite/q=system/files/pictures/picture-2.jpg">
the "81" shouldn't be there. If I run the server on port 80, the IMG tag is correct:
<img src="/mysite/q=system/files/pictures/picture-2.jpg">

:(

geocalleo’s picture

Hi francoud,

Did you get the issue fixed. Let me know when you have a chance. I'd be more then glad to help out.

francoud’s picture

Yes friends, the last suggestion solved my problem.

Just I modified the filter.module, and made this change:

from: $colonpos = strpos($string, ':');
to: $colonpos = strpos($string, ':/');

this worked for me!

really thanks to all - let's go on with Drupal!!!! ;-)

tunesmith’s picture

the problem is in filter.module, line 1364 or so

  do {                                                                          
    $before = $string;                                                          
    $colonpos = strpos($string, ':');                                           
    if ($colonpos > 0) {                                                        
      $protocol = substr($string, 0, $colonpos);                                
      if (!isset($allowed_protocols[$protocol])) {                              
        $string = substr($string, $colonpos + 1);                               
      }                                                                         
    }                         

It's getting hung up on the colon of the port number. Normally what's before the colon is the protocol (http) and the filter attempts to parse it out. But here the entire url path is before the colon (because of the port number) and so the whole thing gets parsed out.

In my code, I changed

    $colonpos = strpos($string, ':');                                           

to

    $colonpos = strpos($string, ':/');                                           

and it's working again, although I haven't thought through this enough to know if that's a good way to solve it - maybe I just opened myself up to a big xss thing.

dingbats’s picture

You're right the path is wrong. This only seems to be an issue when specifiying a port in the URL (i.e. localhost:xxxx). If we can confirm that this is actually a bug then it should be reported.

For now modify the theme_user_picture in user.module:

$picture = file_create_url($account->picture);

becomes...

$picture = file_create_url($account->picture);
// Turn into relative path
$picture = substr($picture, strlen($GLOBALS['base_url']));

The reasoning behind this was that every other module seemed to be sending relative paths to theme_image except user.module. Be sure to keep file_create_url because it will keep the private or public path file options right.

Eric_Chant’s picture

I also had this issue using port 8081. Putting neumanvong's fix in by editing the user.module worked perfectly and fixed it right up.

Thanks!

BQL’s picture

Picture support:enabled
Picture image path:pictures
Default picture: bql.gif
File system path:files

i can see the picture of bql.gif in files\pictures
but i can't view the picture in user profile-show red x in there

the url
http://localhost/drupal/?q=user/1
but the picture's url
http://localhost/drupal/bql.gif

catch’s picture

I'm also unable to view pictures in user profile pages - get a text link in firefox and broken image in IE.

When I "view image" with firefox, I get error 500, which seems very odd tbh. Permissions on the entire files folder are set recursively to 777, I can upload images and they appear in /files/pictures - the path in user settings is set to pictures and the url I get with "view image" is correct. Just nothing actually displays...

machinewashed’s picture

I've got the same problem. I get the 500 Internal Server Error when I go to view an image. I also get the 500 error when I try to upload an image into the gallery. So no image that gets uploaded will display. Any ideas?

mbria’s picture

Hi,

If you have IMCE installed and enabled, try disabling this module and lets see what happens.
There was a bug with IMCE that collides with profile images.

At least this is what happened to me.

The bug is been fixed right now.

Cheers,

m.

mbria’s picture

If your issue is related with IMCE, there is a patch for the last IMCE release at:

http://drupal.org/node/103579

We need to thank ufku for the fast and effective fixing of it.

Cheers,

m.