* @brief Maps Mime types to Imagick formats
* @return arr With with image formats (mime type as key)
*/
- public function getFormatsMap()
+ public static function getFormatsMap()
{
$m = array(
'image/jpeg' => 'JPG',
/*
* Setup the image to the format it will be saved to
*/
- $map = $this->getFormatsMap();
+ $map = self::getFormatsMap();
$format = $map[$type];
$this->image->setFormat($format);
*
* @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);
$type = null;
$image->setInterlaceScheme(Imagick::INTERLACE_PLANE);
} else {
$ext = pathinfo($filename, PATHINFO_EXTENSION);
- $types = $this->supportedTypes();
+ $types = self::supportedTypes();
$type = "image/jpeg";
foreach ($types as $m => $e) {
if ($ext == $e) {
* @param boolean $quit_on_error optional, default false
* @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(
'photo',
* @param string $url url
* @return object
*/
- public function getInfoFromURL($url)
+ public static function getInfoFromURL($url)
{
$data = array();
* @param integer $max max
* @return array
*/
- public function scaleImageTo($width, $height, $max)
+ public static function scaleImageTo($width, $height, $max)
{
$dest_width = $dest_height = 0;
* @param string $url optional, default empty
* @return array
*/
- private function storePhoto(App $a, $uid, $imagedata = "", $url = "")
+ public static function storePhoto(App $a, $uid, $imagedata = "", $url = "")
{
$r = q(
"SELECT `user`.`nickname`, `user`.`page-flags`, `contact`.`id` FROM `user` INNER JOIN `contact` on `user`.`uid` = `contact`.`uid`