X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2FPhoto.php;h=69b08f62919bc7fe81855238ff9fea847dff556c;hb=1b74e3ff100426b86f0f7cdd2f967b7781d6f8fa;hp=ec967ac7498f3edc0d6bc5997f2e55850a1caf59;hpb=1c66fed5c43d0dd2c5f6a8a85989577f0fe219f8;p=friendica.git diff --git a/include/Photo.php b/include/Photo.php index ec967ac749..69b08f6291 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -584,6 +584,7 @@ class Photo { `album` = '%s', `height` = %d, `width` = %d, + `datasize` = %d, `data` = '%s', `scale` = %d, `profile` = %d, @@ -604,6 +605,7 @@ class Photo { dbesc($album), intval($this->getHeight()), intval($this->getWidth()), + dbesc(strlen($this->imageString())), dbesc($this->imageString()), intval($scale), intval($profile), @@ -616,8 +618,8 @@ class Photo { } else { $r = q("INSERT INTO `photo` - ( `uid`, `contact-id`, `guid`, `resource-id`, `created`, `edited`, `filename`, type, `album`, `height`, `width`, `data`, `scale`, `profile`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid` ) - VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, '%s', '%s', '%s', '%s' )", + ( `uid`, `contact-id`, `guid`, `resource-id`, `created`, `edited`, `filename`, type, `album`, `height`, `width`, `datasize`, `data`, `scale`, `profile`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid` ) + VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, '%s', %d, %d, '%s', '%s', '%s', '%s' )", intval($uid), intval($cid), dbesc($guid), @@ -629,6 +631,7 @@ class Photo { dbesc($album), intval($this->getHeight()), intval($this->getWidth()), + dbesc(strlen($this->imageString())), dbesc($this->imageString()), intval($scale), intval($profile), @@ -665,7 +668,7 @@ function guess_image_type($filename, $fromcurl=false) { } if (is_null($type)){ // Guessing from extension? Isn't that... dangerous? - if(class_exists('Imagick')) { + if(class_exists('Imagick') && file_exists($filename) && is_readable($filename)) { /** * Well, this not much better, * but at least it comes from the data inside the image,