Revert "Move Objects to Model"

This commit is contained in:
Michael Vogel 2017-12-08 05:21:51 +01:00 committed by GitHub
parent e437c74d0e
commit 5747cfc79c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
77 changed files with 593 additions and 636 deletions

View file

@ -11,9 +11,8 @@ use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Photo;
use Friendica\Object\Image;
use Friendica\Object\Contact;
use Friendica\Object\Photo;
use dba;
require_once 'boot.php';
@ -382,32 +381,32 @@ class User
$filename = basename($photo);
$img_str = fetch_url($photo, true);
// guess mimetype from headers or filename
$type = Image::guessType($photo, true);
$type = Photo::guessImageType($photo, true);
$Image = new Image($img_str, $type);
if ($Image->isValid()) {
$Image->scaleToSquare(175);
$img = new Photo($img_str, $type);
if ($img->isValid()) {
$img->scaleImageSquare(175);
$hash = photo_new_resource();
$r = Photo::store($Image, $newuid, 0, $hash, $filename, t('Profile Photos'), 4);
$r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 4);
if ($r === false) {
$photo_failure = true;
}
$Image->scaleDown(80);
$img->scaleImage(80);
$r = Photo::store($Image, $newuid, 0, $hash, $filename, t('Profile Photos'), 5);
$r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 5);
if ($r === false) {
$photo_failure = true;
}
$Image->scaleDown(48);
$img->scaleImage(48);
$r = Photo::store($Image, $newuid, 0, $hash, $filename, t('Profile Photos'), 6);
$r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 6);
if ($r === false) {
$photo_failure = true;