mirror of
https://github.com/friendica/friendica
synced 2024-12-23 09:20:17 +00:00
Static
update functions and check calls.
This commit is contained in:
parent
cddadb4b17
commit
d04d2cb838
1 changed files with 8 additions and 8 deletions
|
@ -112,7 +112,7 @@ class Photo
|
||||||
* @brief Maps Mime types to Imagick formats
|
* @brief Maps Mime types to Imagick formats
|
||||||
* @return arr With with image formats (mime type as key)
|
* @return arr With with image formats (mime type as key)
|
||||||
*/
|
*/
|
||||||
public function getFormatsMap()
|
public static function getFormatsMap()
|
||||||
{
|
{
|
||||||
$m = array(
|
$m = array(
|
||||||
'image/jpeg' => 'JPG',
|
'image/jpeg' => 'JPG',
|
||||||
|
@ -140,7 +140,7 @@ class Photo
|
||||||
/*
|
/*
|
||||||
* Setup the image to the format it will be saved to
|
* Setup the image to the format it will be saved to
|
||||||
*/
|
*/
|
||||||
$map = $this->getFormatsMap();
|
$map = self::getFormatsMap();
|
||||||
$format = $map[$type];
|
$format = $map[$type];
|
||||||
$this->image->setFormat($format);
|
$this->image->setFormat($format);
|
||||||
|
|
||||||
|
@ -767,7 +767,7 @@ class Photo
|
||||||
*
|
*
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
public function guessImageType($filename, $fromcurl = false)
|
public static function guessImageType($filename, $fromcurl = false)
|
||||||
{
|
{
|
||||||
logger('Photo: guessImageType: '.$filename . ($fromcurl?' from curl headers':''), LOGGER_DEBUG);
|
logger('Photo: guessImageType: '.$filename . ($fromcurl?' from curl headers':''), LOGGER_DEBUG);
|
||||||
$type = null;
|
$type = null;
|
||||||
|
@ -795,7 +795,7 @@ class Photo
|
||||||
$image->setInterlaceScheme(Imagick::INTERLACE_PLANE);
|
$image->setInterlaceScheme(Imagick::INTERLACE_PLANE);
|
||||||
} else {
|
} else {
|
||||||
$ext = pathinfo($filename, PATHINFO_EXTENSION);
|
$ext = pathinfo($filename, PATHINFO_EXTENSION);
|
||||||
$types = $this->supportedTypes();
|
$types = self::supportedTypes();
|
||||||
$type = "image/jpeg";
|
$type = "image/jpeg";
|
||||||
foreach ($types as $m => $e) {
|
foreach ($types as $m => $e) {
|
||||||
if ($ext == $e) {
|
if ($ext == $e) {
|
||||||
|
@ -815,7 +815,7 @@ class Photo
|
||||||
* @param boolean $quit_on_error optional, default false
|
* @param boolean $quit_on_error optional, default false
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function importProfilePhoto($photo, $uid, $cid, $quit_on_error = false)
|
public static function importProfilePhoto($photo, $uid, $cid, $quit_on_error = false)
|
||||||
{
|
{
|
||||||
$r = dba::select(
|
$r = dba::select(
|
||||||
'photo',
|
'photo',
|
||||||
|
@ -911,7 +911,7 @@ class Photo
|
||||||
* @param string $url url
|
* @param string $url url
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
public function getInfoFromURL($url)
|
public static function getInfoFromURL($url)
|
||||||
{
|
{
|
||||||
$data = array();
|
$data = array();
|
||||||
|
|
||||||
|
@ -951,7 +951,7 @@ class Photo
|
||||||
* @param integer $max max
|
* @param integer $max max
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function scaleImageTo($width, $height, $max)
|
public static function scaleImageTo($width, $height, $max)
|
||||||
{
|
{
|
||||||
$dest_width = $dest_height = 0;
|
$dest_width = $dest_height = 0;
|
||||||
|
|
||||||
|
@ -1007,7 +1007,7 @@ class Photo
|
||||||
* @param string $url optional, default empty
|
* @param string $url optional, default empty
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function storePhoto(App $a, $uid, $imagedata = "", $url = "")
|
public static function storePhoto(App $a, $uid, $imagedata = "", $url = "")
|
||||||
{
|
{
|
||||||
$r = q(
|
$r = q(
|
||||||
"SELECT `user`.`nickname`, `user`.`page-flags`, `contact`.`id` FROM `user` INNER JOIN `contact` on `user`.`uid` = `contact`.`uid`
|
"SELECT `user`.`nickname`, `user`.`page-flags`, `contact`.`id` FROM `user` INNER JOIN `contact` on `user`.`uid` = `contact`.`uid`
|
||||||
|
|
Loading…
Reference in a new issue