added duplicate detection system

This commit is contained in:
Chris
2018-12-22 17:04:32 +01:00
parent 56654e1ff4
commit 00580d8bcc
5 changed files with 73 additions and 7 deletions

View File

@@ -28,6 +28,8 @@ class ImageController
$res = imagecreatefromjpeg($tmpfile);
imagejpeg($res, $tmpfile, (defined('JPEG_COMPRESSION')?JPEG_COMPRESSION:90));
$ext = 'jpg';
$newsha1 = sha1_file($tmpfile);
break;
default:
@@ -39,6 +41,9 @@ class ImageController
$hash = getNewHash($ext,6);
}
if($newsha1)
addSha1($hash,$newsha1);
mkdir(ROOT.DS.'data'.DS.$hash);
$file = ROOT.DS.'data'.DS.$hash.DS.$hash;