use Friendica\Core\Storage\Exception\ReferenceStorageException;
use Friendica\Core\Storage\Exception\StorageException;
use Friendica\Core\Storage\Type\SystemResource;
use Friendica\Core\Storage\Exception\ReferenceStorageException;
use Friendica\Core\Storage\Exception\StorageException;
use Friendica\Core\Storage\Type\SystemResource;
use Friendica\Object\Image;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Images;
use Friendica\Object\Image;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Images;
- return DBA::selectFirst("photo", $fields, $conditions, $params);
+ return DBA::selectFirst('photo', $fields, $conditions, $params);
- public static function getPhotosForUser($uid, $resourceid, array $conditions = [], array $params = [])
+ public static function getPhotosForUser(int $uid, string $resourceid, array $conditions = [], array $params = [])
- public static function getPhotoForUser($uid, $resourceid, $scale = 0, array $conditions = [], array $params = [])
+ public static function getPhotoForUser(int $uid, $resourceid, $scale = 0, array $conditions = [], array $params = [])
- $conditions["resource-id"] = $resourceid;
- $conditions["uid"] = $uid;
- $conditions["scale"] = $scale;
+ $conditions['resource-id'] = $resourceid;
+ $conditions['uid'] = $uid;
+ $conditions['scale'] = $scale;
$accessible = $uid ? (bool)DI::pConfig()->get($uid, 'system', 'accessible-photos', false) : false;
$sql_acl = Security::getPermissionsSQLByUserId($uid, $accessible);
$conditions = ["`resource-id` = ? AND `scale` <= ? " . $sql_acl, $resourceid, $scale];
$accessible = $uid ? (bool)DI::pConfig()->get($uid, 'system', 'accessible-photos', false) : false;
$sql_acl = Security::getPermissionsSQLByUserId($uid, $accessible);
$conditions = ["`resource-id` = ? AND `scale` <= ? " . $sql_acl, $resourceid, $scale];
*
* @param array $photo Photo data. Needs at least 'id', 'type', 'backend-class', 'backend-ref'
*
*
* @param array $photo Photo data. Needs at least 'id', 'type', 'backend-class', 'backend-ref'
*
- $allfields = DBStructure::definition(DI::app()->getBasePath(), false);
- $fields = array_keys($allfields["photo"]["fields"]);
- array_splice($fields, array_search("data", $fields), 1);
+ $allfields = DI::dbaDefinition()->getAll();
+ $fields = array_keys($allfields['photo']['fields']);
+ array_splice($fields, array_search('data', $fields), 1);
$photo = array_combine($fields, $values);
$photo['backend-class'] = SystemResource::NAME;
$photo = array_combine($fields, $values);
$photo['backend-class'] = SystemResource::NAME;
$photo = array_combine($fields, $values);
$photo['backend-class'] = ExternalResource::NAME;
$photo = array_combine($fields, $values);
$photo['backend-class'] = ExternalResource::NAME;
* @param string $filename Filename
* @param string $album Album name
* @param integer $scale Scale
* @param string $filename Filename
* @param string $album Album name
* @param integer $scale Scale
* @param string $allow_cid Permissions, allowed contacts. optional, default = ""
* @param string $allow_gid Permissions, allowed groups. optional, default = ""
* @param string $deny_cid Permissions, denied contacts.optional, default = ""
* @param string $allow_cid Permissions, allowed contacts. optional, default = ""
* @param string $allow_gid Permissions, allowed groups. optional, default = ""
* @param string $deny_cid Permissions, denied contacts.optional, default = ""
* @return boolean True on success
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
* @return boolean True on success
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function store(Image $Image, $uid, $cid, $rid, $filename, $album, $scale, $type = self::DEFAULT, $allow_cid = "", $allow_gid = "", $deny_cid = "", $deny_gid = "", $desc = "")
+ public static function store(Image $image, int $uid, int $cid, string $rid, string $filename, string $album, int $scale, int $type = self::DEFAULT, string $allow_cid = '', string $allow_gid = '', string $deny_cid = '', string $deny_gid = '', string $desc = ''): bool
- $photo = self::selectFirst(["guid"], ["`resource-id` = ? AND `guid` != ?", $rid, ""]);
+ $photo = self::selectFirst(['guid'], ["`resource-id` = ? AND `guid` != ?", $rid, '']);
- $existing_photo = self::selectFirst(["id", "created", "backend-class", "backend-ref"], ["resource-id" => $rid, "uid" => $uid, "contact-id" => $cid, "scale" => $scale]);
+ $existing_photo = self::selectFirst(['id', 'created', 'backend-class', 'backend-ref'], ['resource-id' => $rid, 'uid' => $uid, 'contact-id' => $cid, 'scale' => $scale]);
}
// Get defined storage backend.
// if no storage backend, we use old "data" column in photo table.
// if is an existing photo, reuse same backend
}
// Get defined storage backend.
// if no storage backend, we use old "data" column in photo table.
// if is an existing photo, reuse same backend
- $backend_ref = (string)$existing_photo["backend-ref"];
- $storage = DI::storageManager()->getWritableStorageByName($existing_photo["backend-class"] ?? '');
+ $backend_ref = (string)$existing_photo['backend-ref'];
+ $storage = DI::storageManager()->getWritableStorageByName($existing_photo['backend-class'] ?? '');
- "uid" => $uid,
- "contact-id" => $cid,
- "guid" => $guid,
- "resource-id" => $rid,
- "hash" => md5($Image->asString()),
- "created" => $created,
- "edited" => DateTimeFormat::utcNow(),
- "filename" => basename($filename),
- "type" => $Image->getType(),
- "album" => $album,
- "height" => $Image->getHeight(),
- "width" => $Image->getWidth(),
- "datasize" => strlen($Image->asString()),
- "data" => $data,
- "scale" => $scale,
- "photo-type" => $type,
- "profile" => false,
- "allow_cid" => $allow_cid,
- "allow_gid" => $allow_gid,
- "deny_cid" => $deny_cid,
- "deny_gid" => $deny_gid,
- "desc" => $desc,
- "backend-class" => (string)$storage,
- "backend-ref" => $backend_ref
+ 'uid' => $uid,
+ 'contact-id' => $cid,
+ 'guid' => $guid,
+ 'resource-id' => $rid,
+ 'hash' => md5($image->asString()),
+ 'created' => $created,
+ 'edited' => DateTimeFormat::utcNow(),
+ 'filename' => basename($filename),
+ 'type' => $image->getType(),
+ 'album' => $album,
+ 'height' => $image->getHeight(),
+ 'width' => $image->getWidth(),
+ 'datasize' => strlen($image->asString()),
+ 'data' => $data,
+ 'scale' => $scale,
+ 'photo-type' => $type,
+ 'profile' => false,
+ 'allow_cid' => $allow_cid,
+ 'allow_gid' => $allow_gid,
+ 'deny_cid' => $deny_cid,
+ 'deny_gid' => $deny_gid,
+ 'desc' => $desc,
+ 'backend-class' => (string)$storage,
+ 'backend-ref' => $backend_ref
{
// get photo to delete data info
$photos = DBA::select('photo', ['id', 'backend-class', 'backend-ref'], $conditions);
{
// get photo to delete data info
$photos = DBA::select('photo', ['id', 'backend-class', 'backend-ref'], $conditions);
$backend_class = DI::storageManager()->getWritableStorageByName($photo['backend-class'] ?? '');
$backend_class->delete($photo['backend-ref'] ?? '');
// Delete the photos after they had been deleted successfully
$backend_class = DI::storageManager()->getWritableStorageByName($photo['backend-class'] ?? '');
$backend_class->delete($photo['backend-ref'] ?? '');
// Delete the photos after they had been deleted successfully
} catch (InvalidClassStorageException $storageException) {
DI::logger()->debug('Storage class not found.', ['conditions' => $conditions, 'exception' => $storageException]);
} catch (ReferenceStorageException $referenceStorageException) {
} catch (InvalidClassStorageException $storageException) {
DI::logger()->debug('Storage class not found.', ['conditions' => $conditions, 'exception' => $storageException]);
} catch (ReferenceStorageException $referenceStorageException) {
- * @param array $fields Contains the fields that are updated
- * @param array $conditions Condition array with the key values
- * @param Image $img Image to update. Optional, default null.
- * @param array|boolean $old_fields Array with the old field values that are about to be replaced (true = update on duplicate)
+ * @param array $fields Contains the fields that are updated
+ * @param array $conditions Condition array with the key values
+ * @param Image $image Image to update. Optional, default null.
+ * @param array $old_fields Array with the old field values that are about to be replaced (true = update on duplicate)
*
* @return boolean Was the update successfull?
*
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @see \Friendica\Database\DBA::update
*/
*
* @return boolean Was the update successfull?
*
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @see \Friendica\Database\DBA::update
*/
- public static function update($fields, $conditions, Image $img = null, array $old_fields = [])
+ public static function update(array $fields, array $conditions, Image $image = null, array $old_fields = []): bool
// get photo to update
$photos = self::selectToArray(['backend-class', 'backend-ref'], $conditions);
foreach($photos as $photo) {
try {
$backend_class = DI::storageManager()->getWritableStorageByName($photo['backend-class'] ?? '');
// get photo to update
$photos = self::selectToArray(['backend-class', 'backend-ref'], $conditions);
foreach($photos as $photo) {
try {
$backend_class = DI::storageManager()->getWritableStorageByName($photo['backend-class'] ?? '');
- return DBA::update("photo", $fields, $conditions, $old_fields);
+ return DBA::update('photo', $fields, $conditions, $old_fields);
* @param integer $uid user id
* @param integer $cid contact id
* @param boolean $quit_on_error optional, default false
* @param integer $uid user id
* @param integer $cid contact id
* @param boolean $quit_on_error optional, default false
- public static function importProfilePhoto($image_url, $uid, $cid, $quit_on_error = false)
+ public static function importProfilePhoto(string $image_url, int $uid, int $cid, bool $quit_on_error = false)
- "photo", ["resource-id"], ["uid" => $uid, "contact-id" => $cid, "scale" => 4, "photo-type" => self::CONTACT_AVATAR]
+ 'photo', ['resource-id'], ['uid' => $uid, 'contact-id' => $cid, 'scale' => 4, 'photo-type' => self::CONTACT_AVATAR]
Logger::debug('Got picture', ['Content-Type' => $ret->getHeader('Content-Type'), 'url' => $image_url]);
$img_str = $ret->getBody();
$type = $ret->getContentType();
Logger::debug('Got picture', ['Content-Type' => $ret->getHeader('Content-Type'), 'url' => $image_url]);
$img_str = $ret->getBody();
$type = $ret->getContentType();
- $Image = new Image($img_str, $type);
- if ($Image->isValid()) {
- $Image->scaleToSquare(300);
+ $image = new Image($img_str, $type);
+ if ($image->isValid()) {
+ $image->scaleToSquare(300);
$maximagesize = DI::config()->get('system', 'maximagesize');
if (!empty($maximagesize) && ($filesize > $maximagesize)) {
$maximagesize = DI::config()->get('system', 'maximagesize');
if (!empty($maximagesize) && ($filesize > $maximagesize)) {
- Logger::info('Avatar exceeds image limit', ['uid' => $uid, 'cid' => $cid, 'maximagesize' => $maximagesize, 'size' => $filesize, 'type' => $Image->getType()]);
- if ($Image->getType() == 'image/gif') {
- $Image->toStatic();
- $Image = new Image($Image->asString(), 'image/png');
+ Logger::info('Avatar exceeds image limit', ['uid' => $uid, 'cid' => $cid, 'maximagesize' => $maximagesize, 'size' => $filesize, 'type' => $image->getType()]);
+ if ($image->getType() == 'image/gif') {
+ $image->toStatic();
+ $image = new Image($image->asString(), 'image/png');
- $filesize = strlen($Image->asString());
- Logger::info('Converted gif to a static png', ['uid' => $uid, 'cid' => $cid, 'size' => $filesize, 'type' => $Image->getType()]);
+ $filesize = strlen($image->asString());
+ Logger::info('Converted gif to a static png', ['uid' => $uid, 'cid' => $cid, 'size' => $filesize, 'type' => $image->getType()]);
}
if ($filesize > $maximagesize) {
foreach ([160, 80] as $pixels) {
if ($filesize > $maximagesize) {
}
if ($filesize > $maximagesize) {
foreach ([160, 80] as $pixels) {
if ($filesize > $maximagesize) {
- Logger::info('Resize', ['uid' => $uid, 'cid' => $cid, 'size' => $filesize, 'max' => $maximagesize, 'pixels' => $pixels, 'type' => $Image->getType()]);
- $Image->scaleDown($pixels);
- $filesize = strlen($Image->asString());
+ Logger::info('Resize', ['uid' => $uid, 'cid' => $cid, 'size' => $filesize, 'max' => $maximagesize, 'pixels' => $pixels, 'type' => $image->getType()]);
+ $image->scaleDown($pixels);
+ $filesize = strlen($image->asString());
- Logger::info('Avatar is resized', ['uid' => $uid, 'cid' => $cid, 'size' => $filesize, 'type' => $Image->getType()]);
+ Logger::info('Avatar is resized', ['uid' => $uid, 'cid' => $cid, 'size' => $filesize, 'type' => $image->getType()]);
- $r = self::store($Image, $uid, $cid, $resource_id, $filename, self::CONTACT_PHOTOS, 4, self::CONTACT_AVATAR);
+ $r = self::store($image, $uid, $cid, $resource_id, $filename, self::CONTACT_PHOTOS, 4, self::CONTACT_AVATAR);
- $r = self::store($Image, $uid, $cid, $resource_id, $filename, self::CONTACT_PHOTOS, 5, self::CONTACT_AVATAR);
+ $r = self::store($image, $uid, $cid, $resource_id, $filename, self::CONTACT_PHOTOS, 5, self::CONTACT_AVATAR);
- $r = self::store($Image, $uid, $cid, $resource_id, $filename, self::CONTACT_PHOTOS, 6, self::CONTACT_AVATAR);
+ $r = self::store($image, $uid, $cid, $resource_id, $filename, self::CONTACT_PHOTOS, 6, self::CONTACT_AVATAR);
- $image_url = DI::baseUrl() . "/photo/" . $resource_id . "-4." . $Image->getExt() . $suffix;
- $thumb = DI::baseUrl() . "/photo/" . $resource_id . "-5." . $Image->getExt() . $suffix;
- $micro = DI::baseUrl() . "/photo/" . $resource_id . "-6." . $Image->getExt() . $suffix;
+ $image_url = DI::baseUrl() . '/photo/' . $resource_id . '-4.' . $image->getExt() . $suffix;
+ $thumb = DI::baseUrl() . '/photo/' . $resource_id . '-5.' . $image->getExt() . $suffix;
+ $micro = DI::baseUrl() . '/photo/' . $resource_id . '-6.' . $image->getExt() . $suffix;
{
$degrees = count($exifCoord) > 0 ? self::gps2Num($exifCoord[0]) : 0;
$minutes = count($exifCoord) > 1 ? self::gps2Num($exifCoord[1]) : 0;
$seconds = count($exifCoord) > 2 ? self::gps2Num($exifCoord[2]) : 0;
{
$degrees = count($exifCoord) > 0 ? self::gps2Num($exifCoord[0]) : 0;
$minutes = count($exifCoord) > 1 ? self::gps2Num($exifCoord[1]) : 0;
$seconds = count($exifCoord) > 2 ? self::gps2Num($exifCoord[2]) : 0;
* @return array Returns array of the photo albums
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
* @return array Returns array of the photo albums
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
{
$sql_extra = Security::getPermissionsSQLByUserId($uid);
$avatar_type = (local_user() && (local_user() == $uid)) ? self::USER_AVATAR : self::DEFAULT;
$banner_type = (local_user() && (local_user() == $uid)) ? self::USER_BANNER : self::DEFAULT;
{
$sql_extra = Security::getPermissionsSQLByUserId($uid);
$avatar_type = (local_user() && (local_user() == $uid)) ? self::USER_AVATAR : self::DEFAULT;
$banner_type = (local_user() && (local_user() == $uid)) ? self::USER_BANNER : self::DEFAULT;
/// @todo This query needs to be renewed. It is really slow
// At this time we just store the data in the cache
$albums = DBA::toArray(DBA::p("SELECT COUNT(DISTINCT `resource-id`) AS `total`, `album`, ANY_VALUE(`created`) AS `created`
/// @todo This query needs to be renewed. It is really slow
// At this time we just store the data in the cache
$albums = DBA::toArray(DBA::p("SELECT COUNT(DISTINCT `resource-id`) AS `total`, `album`, ANY_VALUE(`created`) AS `created`
DI::cache()->set($key, null, Duration::DAY);
}
/**
* Generate a unique photo ID.
*
DI::cache()->set($key, null, Duration::DAY);
}
/**
* Generate a unique photo ID.
*
* @param string $image_uri The URI of the photo
* @return string The rid of the photo, or an empty string if the URI is not local
*/
* @param string $image_uri The URI of the photo
* @return string The rid of the photo, or an empty string if the URI is not local
*/
{
if (!stristr($image_uri, DI::baseUrl() . '/photo/')) {
return '';
}
$image_uri = substr($image_uri, strrpos($image_uri, '/') + 1);
$image_uri = substr($image_uri, 0, strpos($image_uri, '-'));
{
if (!stristr($image_uri, DI::baseUrl() . '/photo/')) {
return '';
}
$image_uri = substr($image_uri, strrpos($image_uri, '/') + 1);
$image_uri = substr($image_uri, 0, strpos($image_uri, '-'));
- if (!strlen($image_uri)) {
- return '';
- }
- return $image_uri;
+ return trim($image_uri);
+ }
+
+ /**
+ * Checks if the given URL is a local photo.
+ * Since it is meant for time critical occasions, the check is done without any database requests.
+ *
+ * @param string $url
+ * @return boolean
+ */
+ public static function isPhotoURI(string $url): bool
+ {
+ return !empty(self::ridFromURI($url));
- private static function fitImageSize($Image)
+ /**
+ * Tries to resize image to wanted maximum size
+ *
+ * @param Image $image Image instance
+ * @return Image|null Image instance on success, null on error
+ */
+ private static function fitImageSize(Image $image)
- $filesize = strlen($Image->asString());
- $width = $Image->getWidth();
- $height = $Image->getHeight();
+ $filesize = strlen($image->asString());
+ $width = $image->getWidth();
+ $height = $image->getHeight();
foreach ([5120, 2560, 1280, 640] as $pixels) {
if (($filesize > $maximagesize) && (max($width, $height) > $pixels)) {
Logger::info('Resize', ['size' => $filesize, 'width' => $width, 'height' => $height, 'max' => $maximagesize, 'pixels' => $pixels]);
foreach ([5120, 2560, 1280, 640] as $pixels) {
if (($filesize > $maximagesize) && (max($width, $height) > $pixels)) {
Logger::info('Resize', ['size' => $filesize, 'width' => $width, 'height' => $height, 'max' => $maximagesize, 'pixels' => $pixels]);
- $Image->scaleDown($pixels);
- $filesize = strlen($Image->asString());
- $width = $Image->getWidth();
- $height = $Image->getHeight();
+ $image->scaleDown($pixels);
+ $filesize = strlen($image->asString());
+ $width = $image->getWidth();
+ $height = $image->getHeight();
- private static function loadImageFromURL(string $image_url)
+ /**
+ * Fetches image from URL and returns an array with instance and local file name
+ *
+ * @param string $image_url URL to image
+ * @return array With: 'image' and 'filename' fields or empty array on error
+ */
+ private static function loadImageFromURL(string $image_url): array
Logger::debug('Got picture', ['Content-Type' => $ret->getHeader('Content-Type'), 'url' => $image_url]);
$img_str = $ret->getBody();
$type = $ret->getContentType();
Logger::debug('Got picture', ['Content-Type' => $ret->getHeader('Content-Type'), 'url' => $image_url]);
$img_str = $ret->getBody();
$type = $ret->getContentType();
- private static function uploadImage(array $files)
+ /**
+ * Inserts uploaded image into database and removes local temporary file
+ *
+ * @param array $files File array
+ * @return array With 'image' for Image instance and 'filename' for local file name or empty array on error
+ */
+ private static function uploadImage(array $files): array
Logger::info('File upload', ['src' => $src, 'filename' => $filename, 'size' => $filesize, 'type' => $filetype]);
$imagedata = @file_get_contents($src);
Logger::info('File upload', ['src' => $src, 'filename' => $filename, 'size' => $filesize, 'type' => $filetype]);
$imagedata = @file_get_contents($src);
- $Image = new Image($imagedata, $filetype);
- if (!$Image->isValid()) {
+ $image = new Image($imagedata, $filetype);
+ if (!$image->isValid()) {
* @param string|null $allow_cid
* @param string|null $allow_gid
* @param string $deny_cid
* @param string $deny_gid
* @param string|null $allow_cid
* @param string|null $allow_gid
* @param string $deny_cid
* @param string $deny_gid
- * @param string $desc
- * @param string $resource_id
- * @return array photo record
+ * @param string $desc Description (optional)
+ * @param string $resource_id GUID (optional)
+ * @return array photo record or empty array on error
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function upload(int $uid, array $files, string $album = '', string $allow_cid = null, string $allow_gid = null, string $deny_cid = '', string $deny_gid = '', string $desc = '', string $resource_id = ''): array
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function upload(int $uid, array $files, string $album = '', string $allow_cid = null, string $allow_gid = null, string $deny_cid = '', string $deny_gid = '', string $desc = '', string $resource_id = ''): array
- $r = self::store($Image, $user['uid'], 0, $resource_id, $filename, $album, 0, self::DEFAULT, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $desc);
+ $r = self::store($image, $user['uid'], 0, $resource_id, $filename, $album, 0, self::DEFAULT, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $desc);
- $Image->scaleDown(640);
- $r = self::store($Image, $user['uid'], 0, $resource_id, $filename, $album, 1, self::DEFAULT, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $desc);
+ $image->scaleDown(640);
+ $r = self::store($image, $user['uid'], 0, $resource_id, $filename, $album, 1, self::DEFAULT, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $desc);
- $Image->scaleDown(320);
- $r = self::store($Image, $user['uid'], 0, $resource_id, $filename, $album, 2, self::DEFAULT, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $desc);
+ $image->scaleDown(320);
+ $r = self::store($image, $user['uid'], 0, $resource_id, $filename, $album, 2, self::DEFAULT, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $desc);
$picture['height'] = $photo['height'];
$picture['type'] = $photo['type'];
$picture['albumpage'] = DI::baseUrl() . '/photos/' . $user['nickname'] . '/image/' . $resource_id;
$picture['height'] = $photo['height'];
$picture['type'] = $photo['type'];
$picture['albumpage'] = DI::baseUrl() . '/photos/' . $user['nickname'] . '/image/' . $resource_id;
- $picture['picture'] = DI::baseUrl() . '/photo/{$resource_id}-0.' . $Image->getExt();
- $picture['preview'] = DI::baseUrl() . '/photo/{$resource_id}-{$smallest}.' . $Image->getExt();
+ $picture['picture'] = DI::baseUrl() . '/photo/{$resource_id}-0.' . $image->getExt();
+ $picture['preview'] = DI::baseUrl() . '/photo/{$resource_id}-{$smallest}.' . $image->getExt();
- $r = self::store($Image, $uid, 0, $resource_id, $filename, $album, 4, self::USER_AVATAR);
+ $r = self::store($image, $uid, 0, $resource_id, $filename, $album, 4, self::USER_AVATAR);
- $r = self::store($Image, $uid, 0, $resource_id, $filename, $album, 5, self::USER_AVATAR);
+ $r = self::store($image, $uid, 0, $resource_id, $filename, $album, 5, self::USER_AVATAR);
- $r = self::store($Image, $uid, 0, $resource_id, $filename, $album, 6, self::USER_AVATAR);
+ $r = self::store($image, $uid, 0, $resource_id, $filename, $album, 6, self::USER_AVATAR);
- $r = self::store($Image, $uid, 0, $resource_id, $filename, $album, 3, self::USER_BANNER);
+ $r = self::store($image, $uid, 0, $resource_id, $filename, $album, 3, self::USER_BANNER);