Merge pull request #1305 from jloguercio/1.11.x

Fix issue preventing user image upload when initial image is empty - v2
pull/2487/head
José Loguercio 10 years ago committed by GitHub
commit 9f75b8fa84
  1. 1
      main/inc/lib/formvalidator/FormValidator.class.php
  2. 10
      main/inc/lib/usermanager.lib.php

@ -805,6 +805,7 @@ EOT;
* @param string $name
* @param string $label
* @param array $attributes
* @throws Exception if the file doesn't have an id
*/
public function addFile($name, $label, $attributes = array())
{

@ -1694,19 +1694,19 @@ class UserManager
$image->crop($cropParameters);
// Storing the new photos in 4 versions with various sizes.
$userPath = self::getUserPathById($user_id, 'system');
$small = new Image($source_file);
$small->resize(32);
$small->send_image($path.'small_'.$filename);
$small->send_image($userPath.'small_'.$filename);
$medium = new Image($source_file);
$medium->resize(85);
$medium->send_image($path.'medium_'.$filename);
$medium->send_image($userPath.'medium_'.$filename);
$normal = new Image($source_file);
$normal->resize(200);
$normal->send_image($path.$filename);
$normal->send_image($userPath.$filename);
$big = new Image($source_file); // This is the original picture.
$big->send_image($path.'big_'.$filename);
$big->send_image($userPath.'big_'.$filename);
$result = $small && $medium && $normal && $big;

Loading…
Cancel
Save