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.
This change removes the maximum dimensions and file size text appears in the description for uploading user profile images (avatars). Drupal appears to handle the resizing of images automatically now so text is not needed.
Comment | File | Size | Author |
---|---|---|---|
#42 | drupal.user_picture_text_27234_42.patch | 2.06 KB | rfay |
#37 | drupal.user_picture_text_27234_37.patch | 2.12 KB | rfay |
#34 | drupal.user_picture_text_27234_33.patch | 1.51 KB | rfay |
#31 | 27234_help_text_picture_size.patch | 1.57 KB | maartenvg |
#23 | user_27234.patch | 1.73 KB | drewish |
Comments
Comment #1
Steve Dondley CreditAttribution: Steve Dondley commentedBug in above patch (missing paren) fixed.
Comment #2
matt westgate CreditAttribution: matt westgate commentedThe maximum width and height dimensions still apply when there is no image library installed (see user_validate_picture()). Maybe we could detect if an image library is present and inform the user their picture will automatically be resized to dimension x and y, otherwise the text is displayed as it presently is.
Comment #3
Dries CreditAttribution: Dries commentedI didn't even know we could run without an image library installed. Is that a valid scenario, or more of a left-over from the Drupal 4.5 era? If possible, I'd prefer having one way of doing things, rather than having a new and old way of doing things.
Comment #4
Bèr Kessels CreditAttribution: Bèr Kessels commentedI am all for a image-toolkit-only system. But I am a bit concerned that that will rule out a lot of people who have no access to the server/php set up.
So, would it be worth it, for sake of usability and ease-of use to demand a toolkit for thumbs, and leave those who have no server softwar efor hendling images without avatars?
Comment #5
Steven CreditAttribution: Steven commented-1 on this.
For one thing, it still makes sense to inform people what the maximum avatar size is. Don't underestimate how many avatars are custom made for a particular site.
Secondly, it is important to know the maximum size for animated avatars... if they go over the maximum size, they are resized and come out as static images. Without this info you would need trial and error to figure it out.
Comment #6
Steve Dondley CreditAttribution: Steve Dondley commentedThe big problem with displaying the dimensions and maximum size is that if people have an image that exceeds those limits, they will not bother to upload the image because they think they will have to open their image editing software to do that. Those instructions serve as an image upload deterrent, not a help at all.
Comment #7
Steve Dondley CreditAttribution: Steve Dondley commentedHere's a compromise patch to address Steven's objection. I don't know the best way to detect if an image library is installed. Someone else will have to write that or at least save me time and give me a hint on how to do it.
Comment #8
matt westgate CreditAttribution: matt westgate commentedYou can use
image_get_toolkit()
to check if an image library is installed. Here's some sample code taken from user.module.Once the profile help text is based on the existence of an image library, this patch would be good to go.
Comment #9
matt westgate CreditAttribution: matt westgate commentedYou can use
image_get_toolkit()
to check if an image library is installed. Here's some sample code taken from user.module.Once the profile help text is based on the existence of an image library, this patch would be good to go.
Comment #10
Steve Dondley CreditAttribution: Steve Dondley commentedThanks for the hand, Mathias. Here's a new patch.
Comment #11
matt westgate CreditAttribution: matt westgate commented+1 for this patch and the additional help text it provides.
Comment #12
Bèr Kessels CreditAttribution: Bèr Kessels commentedThe patch applies and works.
But I find the text: Your image will be automatically resized to fit the maximum dimension of 100x100 and maximum file size of 200 k
strange. how can something be resized under the maximum file size of 200 k ?
Comment #13
Bèr Kessels CreditAttribution: Bèr Kessels commentedOn second thought: I (personally) dislike giving this kind of information. These are exactly the texts that scare people away, or at least make them not even read a text.
But I will not object against this patch on that basis, since I can change it, using locales. I will change it to "If your image is too big, it will be resized". For me, that is more then enought information. And for Joe Average it s too.
Comment #14
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedI agree with Ber, there is no need to scare or bore end users with this kind of info.
Comment #15
Dries CreditAttribution: Dries commentedHere is what I want you to do: go for a image toolkit only approach -- that is what we introduced toolkits for. If I'm not mistaken, there are several toolkits available in contrib so people should be able to find a working toolkit.
This means, you'll have to simplify/test user_validate_picture() and the surrounding code. While testing, I'd modify image_get_toolkit() to return NULL to 'simulate' the absense of a toolkit.
Can you investigate that?
Comment #16
Steve Dondley CreditAttribution: Steve Dondley commentedDries, who are you addressing here?
Comment #17
Dries CreditAttribution: Dries commentednysus: mainly you but also the other developers who want to see this fixed.
Comment #18
Steve Dondley CreditAttribution: Steve Dondley commentedYeah, I'll take a look into it when I get a chance.
Comment #19
Dries CreditAttribution: Dries commentedComment #20
Steve Dondley CreditAttribution: Steve Dondley commentedPatch per Dries request.
Comment #21
drummpatching file user.module
Hunk #1 FAILED at 241.
Hunk #2 FAILED at 1161.
2 out of 2 hunks FAILED -- saving rejects to file user.module.rej
Comment #22
lilou CreditAttribution: lilou commentedThis feature request is it still valid ?
Comment #23
drewish CreditAttribution: drewish commentedhere's a current version of this.
Comment #24
maartenvg CreditAttribution: maartenvg commentedWorks like a charm, but has a different approach then #20. Was that intentionally (there have of course been some changes since 2005)?
Comment #25
Dave ReidI think the easier solution would be to not allow the site admin to enable user pictures if there is no image toolkit. I'd like to incorporate this issue into #305802: Improve default user picture interface since this issue seems like it's lost it's steam.
Comment #26
drewish CreditAttribution: drewish commentedDave Reid, no need to take such a simple help fix off topic. don't let the perfect be the enemy of the good. if i've got a single user site and i want my account to have a picture but don't have gd, it's much simpler for me to just scale one image by hand than to recompile php.
Comment #27
Dave ReidWhoops. Sorry drewish! I'll continue in my issue and not bother you again here. :)
Comment #28
Anonymous (not verified) CreditAttribution: Anonymous commentedThe last submitted patch failed testing.
Comment #29
maartenvg CreditAttribution: maartenvg commentedNo longer fails locally, so resetting.
Comment #30
catchWhile we're here, can we split that really long array into multiple lines?
Comment #31
maartenvg CreditAttribution: maartenvg commentedReroll per #30.
And I unassigned Steve, because he hasn't been in this thread since 2005.
Comment #32
Dave ReidComment #34
rfayJust stumbled on this. Here's my own wording change.
Do we even need the "max size" limitation in the admin interface any more?
Comment #35
joachim CreditAttribution: joachim commentedLarger than what?
Better wording something like:
'Your virtual face or picture. Pictures larger than %dimensions pixels will be scaled to fit.'
Powered by Dreditor.
Comment #36
andypostMarked as dup #464688: Clearer labelling of 'Picture maximum dimensions' in profile
Comment #37
rfayHere's another round with improved text - thanks, @joachim.
I did some study and debugging, and here's the scoop:
1. If the image library works at all (or even seems to work) then an upload image is downsized (if necesssary) to the provided image dimensions *before* the file size is checked.
2. The file size limit is therefore basically irrelevant or at least misleading, as long as it's properly proportional to the image dimensions. It's misleading for us to even call it the "file upload size" limit, when it's actually the "after resizing image size".
This text attempts to deal with those facts as well as it can. It would not be unreasonable to completely remove the image file size settings in the admin interface, since we do assume that a system with a broken image library is a broken system.
Comment #38
joachim CreditAttribution: joachim commentedThis is kinda scary. How do I know if my system is 'normal working'??
And it's also a lot of verbiage to say the obvious -- of COURSE the dimensions restriction acts too.
Compare with the description text on image field size setting:
That's pretty ugly with the dimensions string twice.
Comment #40
joachim CreditAttribution: joachim commentedWould this do?
'Your virtual face or picture. Pictures larger than @dimensions pixels will be scaled down to fit.'
Comment #41
rfayWe probably need to get this going. It's a tiny patch, shouldn't take that much work to get it RTBC. Doesn't deserve *so* much conversation. @joachim, do you want to roll a version with the text the way you'd like it?
Comment #42
rfayOK, I think this takes people's comments into account.
Let's get this silly thing done. If you want something different, post a patch. Otherwise, let's get it done.
Comment #43
joachim CreditAttribution: joachim commentedLooks good.
Comment #44
andypostA much clear. Let's RTBC this.
Comment #45
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.