]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
ImageFile $id argument is only for File objects
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 10 Mar 2015 23:20:48 +0000 (00:20 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 10 Mar 2015 23:20:48 +0000 (00:20 +0100)
Remember to eliminate the Avatar/group logo call to ImageFile->resize!

actions/avatarsettings.php
actions/grouplogo.php
classes/Oauth_application.php
classes/User_group.php
plugins/FacebookBridge/actions/facebookfinishlogin.php
plugins/OStatus/classes/Ostatus_profile.php
plugins/WikiHowProfile/WikiHowProfilePlugin.php

index 7373e770477b4a8def01b0ea7ac9db5cdeca3ea6..2b22966a4fef231336e6c281c86a11b630fb8187 100644 (file)
@@ -374,7 +374,7 @@ class AvatarsettingsAction extends SettingsAction
         $user = common_current_user();
         $profile = $user->getProfile();
 
-        $imagefile = new ImageFile($user->id, $filedata['filepath']);
+        $imagefile = new ImageFile(null, $filedata['filepath']);
         $filename = $imagefile->resize($size, $dest_x, $dest_y, $dest_w, $dest_h);
 
         if ($profile->setOriginal($filename)) {
index 10fd33088d6a60fa3445b1339febd442e595d4be..3dc9891e0b93a559f78b7ec36c05fa81b838b29c 100644 (file)
@@ -393,7 +393,7 @@ class GrouplogoAction extends GroupAction
         $size = min($dest_w, $dest_h);
         $size = ($size > MAX_ORIGINAL) ? MAX_ORIGINAL:$size;
 
-        $imagefile = new ImageFile($this->group->id, $filedata['filepath']);
+        $imagefile = new ImageFile(null, $filedata['filepath']);
         $filename = $imagefile->resize($size, $dest_x, $dest_y, $dest_w, $dest_h);
 
         if ($this->group->setOriginal($filename)) {
index 9cf3f5e108849b859018c6520b10c5fc0967b6e8..d5d38d0d662be231d5a5b9c2467039cd51b8a773 100644 (file)
@@ -80,7 +80,7 @@ class Oauth_application extends Managed_DataObject
 
     function setOriginal($filename)
     {
-        $imagefile = new ImageFile($this->id, Avatar::path($filename));
+        $imagefile = new ImageFile(null, Avatar::path($filename));
 
         // XXX: Do we want to have a bunch of different size icons? homepage, stream, mini?
         // or just one and control size via CSS? --Zach
index 3dc5fd4b2d8e0e1e799fad943b59301621a05ee3..009abe6a6de2c4e8d2c272ffc280943bd154ef5d 100644 (file)
@@ -312,7 +312,7 @@ class User_group extends Managed_DataObject
 
     function setOriginal($filename)
     {
-        $imagefile = new ImageFile($this->id, Avatar::path($filename));
+        $imagefile = new ImageFile(null, Avatar::path($filename));
 
         $orig = clone($this);
         $this->original_logo = Avatar::url($filename);
index 53815ad264b1cb5a8815c8193fbfc330c7852425..03bcf6cfcd3002acbfdce31426618dda43e91f8c 100644 (file)
@@ -436,7 +436,7 @@ class FacebookfinishloginAction extends Action
                 } else {
                     // save it as an avatar
 
-                    $file = new ImageFile($user->id, Avatar::path($tmpname));
+                    $file = new ImageFile(null, Avatar::path($tmpname));
                     $filename = $file->resize(180); // size of the biggest img we get from Facebook
 
                     $profile   = $user->getProfile();
index 2cf4f1bdd15a54b55a7354e0b27cabaca933153a..ddecc45013d33b7ce68cdae66b26bb1f9a26029d 100644 (file)
@@ -1268,8 +1268,7 @@ class Ostatus_profile extends Managed_DataObject
             } else {
                 $id = $this->profile_id;
             }
-            // @todo FIXME: Should we be using different ids?
-            $imagefile = new ImageFile($id, $temp_filename);
+            $imagefile = new ImageFile(null, $temp_filename);
             $filename = Avatar::filename($id,
                                          image_type_to_extension($imagefile->type),
                                          null,
index 6f45da6a707cbbbe8efbafad2736ed94f311c0ab..b058cc3b6530886f50a070c1ef07a36bbe66daaf 100644 (file)
@@ -188,9 +188,7 @@ class WikiHowProfilePlugin extends Plugin
 
             $profile = $user->getProfile();
             $id = $profile->id;
-            // @fixme should we be using different ids?
-
-            $imagefile = new ImageFile($id, $temp_filename);
+            $imagefile = new ImageFile(null, $temp_filename);
             $filename = Avatar::filename($id,
                                          image_type_to_extension($imagefile->type),
                                          null,