Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291491

Set realistic image upload limits for user picture field

$
0
0

First of all, I am *so* happy to see the profile image as an actual field, so YAY to everyone who helped get that done :)
This issue is so we can actually use it :)

Problem/Motivation

Today, I decided to test the patch that updated user module to Twig. "First things first", I thought, "...let's make some users!" I navigated to the user list, and edited a user. "Okay, let's upload a picture." I browse to my avatars directory, choose the same avatar photo I add to every drupal site I've ever had an account on, and upload.
I get this message (in green):

The image was resized to fit within the maximum allowed dimensions of 85x85 pixels.

YAY! :)

Then, I get this error (in read, beneath the green message):

The specified file jenmainstage_sm.png could not be uploaded. The file is 112.08 KB exceeding the maximum file size of 30 KB.

BOO.
I read the error message. Think: "30 KB? really?". Think some more: "Surely, I changed these settings when I was testing something else, that can't be right." I return to the settings page seeking the "Reset to defaults" button, which of course, is not there. So I reinstall Drupal. Try again. Same problem. :/

On further examination, it turns out that the upload dimensions are set to 85x85px, but even the thumbnail image that is displayed after the image is uploaded (in the form, as well as on the user page) is 100x100. That means we're going to be scaling up profile images since we don't have an image style in core that's this tiny.

Proposed resolution

  • We should allow a large profile image to be uploaded. Since we're resizing the image on disk anyway, the file size will decrease as well. I'm not sure we need a restriction here at all, but we certainly don't need one that's so restrictive that even a fairly savvy web user like myself doesn't have a profile photo this tiny on hand.
  • We should increase the maximum image dimensions. If there's no way to display these images on the site without up-scaling them, then we are setting the size too small. Large images will still look alright when sized down, but images that are sized up will not always look nice.
  • If we really want the images to be 85x85, we should provide an image style that matches the intended size for profile photos. Sizing them up to 100x100 when the files are 85x85 was probably not intended.
  • If we really want the images to be 85x85, we should set this new image style as the default formatter for the profile image field. This will avoid up-scaling.
  • We should also stop calling dimensions "resolution".

Remaining tasks

User interface changes

none

API changes

none

#1215784: terminology update: don't say "Resolution" when we mean "Dimensions"


Viewing all articles
Browse latest Browse all 291491

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>