Merge pull request #936 from jloguercio/fixResize

Fix code in old resize functions usage in image.lib.php
1.10.x
Yannick Warnier 9 years ago
commit 5eaf7e14c0
  1. 7
      main/admin/settings.lib.php
  2. 7
      main/document/document.php
  3. 16
      main/newscorm/learnpath.class.php
  4. 6
      main/social/my_skills_report.php

@ -1033,12 +1033,7 @@ function add_edit_template() {
$max_width_for_picture = 100;
if ($picture_info['width'] > $max_width_for_picture) {
$thumbwidth = $max_width_for_picture;
if (empty($thumbwidth) || $thumbwidth == 0) {
$thumbwidth = $max_width_for_picture;
}
$new_height = round(($thumbwidth / $picture_info['width']) * $picture_info['height']);
$temp->resize($thumbwidth, $new_height, 0);
$temp->resize($max_width_for_picture);
}
$temp->send_image($upload_dir.$new_file_name);
}

@ -1417,12 +1417,7 @@ if ($is_allowed_to_edit ||
$max_width_for_picture = 100;
if ($picture_info['width'] > $max_width_for_picture) {
$thumbwidth = $max_width_for_picture;
if (empty($thumbwidth) || $thumbwidth == 0) {
$thumbwidth = $max_width_for_picture;
}
$new_height = round(($thumbwidth / $picture_info['width']) * $picture_info['height']);
$temp->resize($thumbwidth, $new_height, 0);
$temp->resize($max_width_for_picture);
}
$temp->send_image($upload_dir.$new_file_name);
}

@ -9747,19 +9747,7 @@ EOD;
// Resize the image.
$temp = new Image($image_array['tmp_name']);
$picture_infos = $temp->get_image_info();
if ($picture_infos['width'] > 104) {
$thumbwidth = 104;
} else {
$thumbwidth = $picture_infos['width'];
}
if ($picture_infos['height'] > 96) {
$new_height = 96;
} else {
$new_height = $picture_infos['height'];
}
$temp->resize($thumbwidth, $new_height, 0);
$temp->resize(104);
$result = $temp->send_image($new_path);
// Storing the image filename.
@ -9768,7 +9756,7 @@ EOD;
$this->set_preview_image($new_file_name);
//Resize to 64px to use on course homepage
$temp->resize(64, 64, 0);
$temp->resize(64);
$temp->send_image($updir.'/'.$filename.'.64.'.$file_extension);
return true;
}

@ -55,7 +55,7 @@ if ($isStudent) {
if (!file_exists($thumbSysPath)) {
$courseImageThumb = new Image($imageSysPath);
$courseImageThumb->resize(32, 32, 0);
$courseImageThumb->resize(32);
$courseImageThumb->send_image($thumbSysPath);
}
$tableRow['courseImage'] = $thumbWebPath;
@ -100,7 +100,7 @@ if ($isStudent) {
if (!file_exists($thumbSysPath)) {
$courseImageThumb = new Image($imageSysPath);
$courseImageThumb->resize(32, 32, 0);
$courseImageThumb->resize(32);
$courseImageThumb->send_image($thumbSysPath);
}
$tableRow['courseImage'] = $thumbWebPath;
@ -167,7 +167,7 @@ if ($isStudent) {
if (!file_exists($thumbSysPath)) {
$courseImageThumb = new Image($imageSysPath);
$courseImageThumb->resize(32, 32, 0);
$courseImageThumb->resize(32);
$courseImageThumb->send_image($thumbSysPath);
}

Loading…
Cancel
Save