aboutsummaryrefslogtreecommitdiffstats
path: root/include/photo/photo_driver.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-10-03 17:03:24 -0700
committerzotlabs <mike@macgirvin.com>2017-10-03 17:03:24 -0700
commit7fb02752de4e3ee62d84eaf30bcb4c155ebabf30 (patch)
tree1518b70df17b60d9faf86b63089a220960a333e0 /include/photo/photo_driver.php
parentd88d4b3c3ac1cd741f03b667b3d35696ba77d2dd (diff)
downloadvolse-hubzilla-7fb02752de4e3ee62d84eaf30bcb4c155ebabf30.tar.gz
volse-hubzilla-7fb02752de4e3ee62d84eaf30bcb4c155ebabf30.tar.bz2
volse-hubzilla-7fb02752de4e3ee62d84eaf30bcb4c155ebabf30.zip
hubzilla issue #868
Diffstat (limited to 'include/photo/photo_driver.php')
-rw-r--r--include/photo/photo_driver.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php
index 17ca81419..3b6beabf5 100644
--- a/include/photo/photo_driver.php
+++ b/include/photo/photo_driver.php
@@ -518,6 +518,27 @@ function guess_image_type($filename, $headers = '') {
}
+
+function delete_thing_photo($url,$ob_hash) {
+
+ $hash = basename($url);
+ $hash = substr($hash,0,strpos($hash,'-'));
+
+ // hashes should be 32 bytes.
+
+ if(strlen($hash) < 16)
+ return;
+
+ $r = q("delete from photo where xchan = '%s' and photo_usage = %d and resource_id = '%s'",
+ dbesc($ob_hash),
+ intval(PHOTO_THING),
+ dbesc($hash)
+ );
+
+}
+
+
+
function import_xchan_photo($photo,$xchan,$thing = false) {
$flags = (($thing) ? PHOTO_THING : PHOTO_XCHAN);