use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Database\DBA;
-use Friendica\Model\Contact;
use Friendica\Model\Photo;
use Friendica\Util\Network;
use Exception;
*/
class Image
{
+ /** @var Imagick|resource */
private $image;
/*
/**
* @brief Constructor
- * @param object $data data
+ * @param string $data
* @param boolean $type optional, default null
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
}
/**
- * @param object $data data
+ * @param string $data data
* @return boolean
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
$width = $this->getWidth();
$height = $this->getHeight();
- $dest_width = $dest_height = 0;
-
if ((! $width)|| (! $height)) {
return false;
}
$width = $this->getWidth();
$height = $this->getHeight();
- $dest_width = $dest_height = 0;
-
if ((!$width)|| (!$height)) {
return false;
}
return $string;
}
- $quality = false;
-
ob_start();
// Enable interlacing
Logger::log('Image: guessType: '.$filename . ($fromcurl?' from curl headers':''), Logger::DEBUG);
$type = null;
if ($fromcurl) {
- $a = \get_app();
$headers=[];
$h = explode("\n", $header);
foreach ($h as $l) {
*/
public static function getScalingDimensions($width, $height, $max)
{
- $dest_width = $dest_height = 0;
-
if ((!$width) || (!$height)) {
return false;
}
/// @TODO
/// $default_cid = $r[0]['id'];
- /// $community_page = (($r[0]['page-flags'] == Contact::PAGE_COMMUNITY) ? true : false);
+ /// $community_page = (($r[0]['page-flags'] == User::PAGE_FLAGS_COMMUNITY) ? true : false);
if ((strlen($imagedata) == 0) && ($url == "")) {
Logger::log("No image data and no url provided", Logger::DEBUG);
$hash = Photo::newResource();
- $smallest = 0;
-
// Pictures are always public by now
//$defperm = '<'.$default_cid.'>';
$defperm = "";