/**
* @brief supported mimetypes and corresponding file extensions
*/
- static function supportedTypes() {
+ static public function supportedTypes() {
if (class_exists('Imagick')) {
// Imagick::queryFormats won't help us a lot there...
public function __construct($data, $type=null) {
$this->imagick = class_exists('Imagick');
- $this->types = $this->supportedTypes();
+ $this->types = static::supportedTypes();
if (!array_key_exists($type, $this->types)){
$type='image/jpeg';
}
if ($public and ($file != "")) {
// If the photo path isn't there, try to create it
$basepath = $a->get_basepath();
- if (!is_dir($basepath."/photo"))
- if (is_writable($basepath))
+ if (!is_dir($basepath."/photo")) {
+ if (is_writable($basepath)) {
mkdir($basepath."/photo");
+ }
+ }
- if (is_dir($basepath."/photo"))
+ if (is_dir($basepath."/photo")) {
file_put_contents($basepath."/photo/".$file, $data);
+ }
}
killme();