use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Database\DBM;
-use Friendica\Object\Photo;
+use Friendica\Model\Photo;
+use Friendica\Object\Image;
define('PROXY_DEFAULT_TIME', 86400); // 1 Day
// reduce quality - if it isn't a GIF
if ($mime != 'image/gif') {
- $img = new Photo($img_str, $mime);
- if ($img->isValid()) {
- $img_str = $img->imageString();
+ $Image = new Image($img_str, $mime);
+ if ($Image->isValid()) {
+ $img_str = $Image->asString();
}
}
$mime = 'image/png';
$cachefile = ''; // Clear the cachefile so that the dummy isn't stored
$valid = false;
- $img = new Photo($img_str, 'image/png');
- if ($img->isValid()) {
- $img->scaleImage(10);
- $img_str = $img->imageString();
+ $Image = new Image($img_str, 'image/png');
+ if ($Image->isValid()) {
+ $Image->scaleDown(10);
+ $img_str = $Image->asString();
}
} elseif ($mime != 'image/jpeg' && !$direct_cache && $cachefile == '') {
$image = @imagecreatefromstring($img_str);
'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '', 'desc' => $mime);
dba::insert('photo', $fields);
} else {
- $img = new Photo($img_str, $mime);
- if ($img->isValid() && !$direct_cache && ($cachefile == '')) {
- $img->store(0, 0, $urlhash, $_REQUEST['url'], '', 100);
+ $Image = new Image($img_str, $mime);
+ if ($Image->isValid() && !$direct_cache && ($cachefile == '')) {
+ Photo::store($Image, 0, 0, $urlhash, $_REQUEST['url'], '', 100);
}
}
}
// reduce quality - if it isn't a GIF
if ($mime != 'image/gif') {
- $img = new Photo($img_str, $mime);
- if ($img->isValid()) {
- $img->scaleImage($size);
- $img_str = $img->imageString();
+ $Image = new Image($img_str, $mime);
+ if ($Image->isValid()) {
+ $Image->scaleDown($size);
+ $img_str = $Image->asString();
}
}