]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/grouplogo.php
Fix for ticket #3007: .bmp avatar uploads weren't being properly converted to PNG...
[quix0rs-gnu-social.git] / actions / grouplogo.php
index 7b7c01b23b9fc7425d63585971669e713e86207d..d2e8fd0e91bf290dda890e154ee238b1add0d759 100644 (file)
@@ -353,20 +353,21 @@ class GrouplogoAction extends GroupDesignAction
             return;
         }
 
+        $type = $imagefile->preferredType();
         $filename = Avatar::filename($this->group->id,
-                                     image_type_to_extension($imagefile->type),
+                                     image_type_to_extension($type),
                                      null,
                                      'group-temp-'.common_timestamp());
 
         $filepath = Avatar::path($filename);
 
-        move_uploaded_file($imagefile->filepath, $filepath);
+        $imagefile->copyTo($filepath);
 
         $filedata = array('filename' => $filename,
                           'filepath' => $filepath,
                           'width' => $imagefile->width,
                           'height' => $imagefile->height,
-                          'type' => $imagefile->type);
+                          'type' => $type);
 
         $_SESSION['FILEDATA'] = $filedata;