X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2FPhoto.php;h=69b08f62919bc7fe81855238ff9fea847dff556c;hb=c22f65bafa08ea348d55fb1f3c05774b0f320c99;hp=ec967ac7498f3edc0d6bc5997f2e55850a1caf59;hpb=2940f25df94afb0c75a8181f15878417fa5cdc21;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,