]> git.mxchange.org Git - quix0rs-gnu-social.git/commit
Avatar resizing improvements and better code reuse
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 30 Sep 2013 20:13:37 +0000 (22:13 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 30 Sep 2013 20:23:03 +0000 (22:23 +0200)
commita23c4aa23605003de929ee3fb4bcef6603f9e9ac
tree79a8a48658123376ab0b1bd6b156bb3834ca5c4e
parenta0e107f17f27bc1dfc49de2a4493a461213e782e
Avatar resizing improvements and better code reuse

* getOriginal added to Avatar class
    This is a static function that retrieves the original avatar in a leaner
    way than Profile->getOriginalAvatar() did (see below).
    This will throw an Exception if there was none to be found.

* getProfileAvatars added to Avatar class
    This gets all Avatars from a profile and returns them in an array.

* newSize added to Avatar class
    This will scale an original avatar or throw an Exception (originally from
    Avatar::getOriginal) if one wasn't found.

* deleteFromProfile added to Avatar class
    Deletes all avatars for a Profile. This makes the code much smarter when
    removing all avatars from a user.
    Previously only specific, hardcoded (through constants) sizes would be
    deleted. If you ever changed lib/framework.php then many oddsized avatars
    would remain with the old method.

* Migrated Profile class to new Avatar::getOriginal support
    Profile class now uses Avatar::getOriginal through its own
    $this->getOriginalAvatar and thus remains backwards compatible.

* Updating stock GNU Social to use Avatar::getOriginal
    All places where core StatusNet code used the
    $profile->getOriginalAvatar, it will now useAvatar::getOriginal with
    proper error handling.

* Updated Profile class to use Avatar::newSize
    When doing setOriginal, the scaling will be done with the new method
    introduced in this merge.
    This also edits the _fillAvatar function to avoid adding NULL values to
    the array (which causes errors when attempting to access array entries as
    objects). See issue #3478 at http://status.net/open-source/issues/3478
actions/avatarsettings.php
actions/foaf.php
classes/Avatar.php
classes/Profile.php
lib/activityobject.php
plugins/OMB/lib/omboauthdatastore.php