Bladeren bron

Fix resize question image - refs BT#12892

See e5f386c719e4bcbebf8b76f567ab2c24cb38bd46
Angel Fernando Quiroz Campos 7 jaren geleden
bovenliggende
commit
dde61135e0
1 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 3 3
      main/exercise/question.class.php

+ 3 - 3
main/exercise/question.class.php

@@ -712,12 +712,12 @@ abstract class Question
      */
     private function resizePicture($Dimension, $Max)
     {
-        $picturePath = $this->getHotSpotFolderInCourse();
+        $picturePath = $this->getHotSpotFolderInCourse().'/'.$this->getPictureFilename();
 
         // if the question has an ID
         if ($this->id) {
             // Get dimensions from current image.
-            $my_image = new Image($picturePath.'/'.$this->picture);
+            $my_image = new Image($picturePath);
 
             $current_image_size = $my_image->get_image_size();
             $current_width = $current_image_size['width'];
@@ -758,7 +758,7 @@ abstract class Question
             }
 
             $my_image->resize($new_width, $new_height);
-            $result = $my_image->send_image($picturePath.'/'.$this->picture);
+            $result = $my_image->send_image($picturePath);
 
             if ($result) {
                 return true;