Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By justinhabit on
Hello,
Maybe I'm just doing something wrong, but it seems like the drupal 7 image styles do not get applied to default profile pictures. I'm using the imageCache profile module to apply two different image styles - one for thumbnails and another for the profile page. The styles work great for images that users upload, but they don't work at all for the default image.
Has anyone else had a problem with this? If so, have any of you found a clean workaround?
thanks!
Comments
I had that problem too. To
I had that problem too. To resolve it, and get the styles applied, you have to use a drupal file pattern with your default profile picture. So something like public://pictures/default-pic.jpg. public:// is a placeholder for your site's public files location - most likely sites/default/files/.
Many thanx!
Saved my day ;)
Design By Committee Brings Death.
Wooo cheers for the post,
Wooo cheers for the post, this was quite hard to find due to my vague search terms. Seems daft that it cant convert images referenced in /sites/default/files/user-pictures/profile.jpg
omg!! thank you! I was
omg!! thank you! I was looking everywhere for this; not sure why it's not stated more clearly that "public://" needs to be used in place of the actual path.
Thanks +1
There's a lot of open issues on this problem - in the views module mostly. Glad I found your post!
Don't understand
Where do I have to introduce this path?
I say because I am just uploading the "default image" and Drupal automatically creates the styles directory and so on. I am not setting up anything manually.
Thanks and sorry for misunderstanding.
Thanks!
After a long search: Many many Thanks!! This should be given as an advice in the user settings form...
I had myself to the list of
I add myself to the list of people thanking you ;-)
Wondeful !
Thank you so much ! Saved me from hours of debugging.
@r_smylski
THX!!!!
Very usefull!!! :-D
thank you! thank you! thank you!
Always an adventure!
This saved me a lot of time! I want to clarify
omg @rsmylski, your post saved me a lot of time, it was a bit confusing till i did some trial and error, so let me clarify for others in my position. I had to manually upload my default image to sites/default/files/pictures directory, then i referenced public://pictures/(mydefaultimage) as the default image under my account settings. This wasn't the case for drupal 6 as one could just reference any directory, infact my default image in drupal 6 was images/(mydefaultimage).
Thanks once again @rsmylski
Does this work in Drupal 8?
I'm having the same issue in Drupal 8.
Do I need to set the file path for all public uploads in the settings.php?
My files are currently set to go into `sites/default/files` - so would i change to be `public://sites/default/files`?
Thanks!