When validating a user's picture, we currently send the file to image_scale() to automatically resize the image. This works great, but also assumes that an image toolkit is loaded to perform this action. If no toolkit is loaded, the user will always receive an error message even if the image is within specs, causing the upload to fail.

This patch make image_get_toolkit() return the current toolkit only if it's enabled, that way we can use the elegant image_scale approach if a toolkit is present, or resort to the old way of checking width and height for a user's picture if need be.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

walkah’s picture

+1 on this patch. Please commit to HEAD

Steven’s picture

I committed this patch to head.

Anonymous’s picture

ebarrab’s picture

Title: Can't upload picture/avatar without PHP GD extension enabled » AN AVATAR WITH GUION IN THE FILENAME DOES NOT APPEAR IN THE USER PROFILE EDITION
Project: Drupal core » Avatar Selection
Version: » 5.x-2.1
Component: user.module » User interface
Status: Closed (fixed) » Needs work

WHEN I UPLOAD/USE IMAGES WITH GUIONS (-) IN THE FILENAME, THEY ARE NOT SHOWN WHEN I EDIT MY ACCOUN ("Or simply select an icon:").

I CHANGE THE FILENAME (ELIMINATING THE GUIONS AND IT WORKS).
I NOTICE IT BECAUSE THE ONLY AVATAR I SEE THERE IS THE GUIONLESS ONE.

Eduardo.

styro’s picture

Title: AN AVATAR WITH GUION IN THE FILENAME DOES NOT APPEAR IN THE USER PROFILE EDITION » Can't upload picture/avatar without PHP GD extension enabled
Project: Avatar Selection » Drupal core
Version: 5.x-2.1 » 4.6.x-dev
Component: User interface » user.module
Status: Needs work » Closed (fixed)

Resetting previous issue status (I'm only guessing what the prev version was).

Please don't hijack old unrelated issues - open a new issue for this. And please don't use ALL CAPS.