strangerstudios / basic-user-avatars

Add an avatar upload field on frontend pages and on the Edit Profile screen so users and admins can manage custom profile pictures without Gravatar.
https://wordpress.org/plugins/basic-user-avatars/
39 stars 34 forks source link

Need max image size, height, width parameters #1

Open Evzy opened 9 years ago

Evzy commented 9 years ago

Users are uploading a picture that is 2mb 7000x4000, The plugin won't resize the image, even so. if theres images over a certain size can they just be disallowed? takes up server space too.

jaredatch commented 9 years ago

Ideally there should be a filterable threshold, say maybe 1mb, that if an image is larger than that it doesn't upload and provides an error message to the user telling them it is too large.

Evzy commented 9 years ago

Yeah, main reason is because when this image uploads, it doesnt rescale and breaks my webpage theme.

Thanks anyway though, this plugin is otherwise perfect :)

Dev-1 commented 9 years ago

Pluign is great but it needs settings: max dimensions and file size limitation for upload

jaredatch commented 9 years ago

@Evzy which page is it breaking, specifically, so I can look into that?

Evzy commented 9 years ago

Any that contain the persons avatar pic on bbpress. So if theyre the latest article. The index will break because it shows latest poster. If theyre not, it will be broken on the topic they post in. Also breaks the users setting page so they cannot edit their picture or anything else. I can send you a link to the picture so you can look at it yourself.

jaredatch commented 9 years ago

Hmm, I'll look into this. So not only when editing/viewing the profile, but also on the topics? Interesting, can't say I've noticed that, but I can try to upload a 2000x2000 image and see what happens :)

jaredatch commented 9 years ago

Hmm, I can't replicate it.

I uploaded a 1200x1200 image, but on bbPress (and else where) it shows everything correctly from what I can tell.

http://cl.ly/image/2i2E1h1y2e1W http://cl.ly/image/1o41211w332F http://cl.ly/image/2V142v2K0G00 http://cl.ly/image/46150u1e2t2O http://cl.ly/image/3Y1r442K1I2s

Evzy commented 9 years ago

That looks correct. My image wouldn't be scaled and resized, there was only the original in my upload folder, so it used the 4000x7000 one.

Evzy commented 9 years ago

Rather than have 6 different sizes that should be there

jaredatch commented 9 years ago

Hmm, sounds like the image resizing isn't going through (https://github.com/jaredatch/Basic-User-Avatars/blob/master/init.php#L170)

The thing is even if the image isn't resizing correctly, it should still get the correct dimensions inline (see https://github.com/jaredatch/Basic-User-Avatars/blob/master/init.php#L186)

Evzy commented 9 years ago

There there a possible fix for that? As well as id prefer size width and height parameters too and it would be perrrfect

jaredatch commented 9 years ago

Trying disabling all other plugins (other than bbPress) and switch to a default WordPress theme.

I think something is interfering with things. If you view the source of the page, the image should be getting image and height attributes on it at a minimum.

Rakhmanov commented 9 years ago

Ok this thing is real, today happened. Also made mess displaying user. It has included image size of 5k pixels as avatar since it did not re size. Need this filter.