-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
107 lines (92 loc) · 3.93 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
if((isset($_POST['i']) && $_POST['i'] != '') || (isset($_POST['id']) && $_POST['id'] != '')){
$img = $_POST['i']; // Image URL
$id = $_POST['id']; // Image data
$top = $_POST['top']; // Crop start from top
$left = $_POST['left']; // Crop start from left
$size = $_POST['size']; // Width & height from Crop top-left point
$frameSize = 600; // Frame size (Final image is 2x2 frames)
if($id != ''){
$img = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $id));
$type = 'data';
} else {
$type = 'url';
}
function processFrame($type, $image, $startX, $startY, $width, $height, $frameSize, $drawTriangle) {
if($type=='url'){
$imagick = new \Imagick($image);
} else {
$imagick = new \Imagick();
$imagick->readImageBlob($image);
}
$imagick->cropImage($width, $height, $startX, $startY);
$imagick->resizeImage($frameSize, $frameSize, imagick::FILTER_LANCZOS, true, true);
if($drawTriangle == true){
$draw = new \ImagickDraw();
$draw->setFillColor('red');
$draw->setStrokeColor('red');
$draw->setStrokeWidth(4);
$sy = rand(0, $frameSize/2);
$sx = rand(0, $frameSize);
$ey = rand($frameSize/2, $frameSize);
$ex = rand($frameSize, $frameSize/2);
$draw->line($sy, $sx, $ey, $ex);
$ney = rand($frameSize/2, $frameSize);
$nex = rand($framesize, $frameSize/2);
$draw->line($ey, $ex, $ney, $nex);
$draw->line($ney, $nex, $sy, $sx);
$imagick->drawImage($draw);
}
return $imagick->getImageBlob();
}
function combine($firstFrame, $secondFrame, $rows) {
$im = new \Imagick();
$im->readImageBlob($firstFrame);
$im->readImageBlob($secondFrame);
$im->resetIterator();
$combined = $im->appendImages($rows);
$combined->setImageFormat("jpeg");
return $combined;
}
$firstFrame = processFrame($type, $img, $left, $top, $size, $size, $frameSize, false);
$secondFrame = processFrame($type, $img, $left+($size/4), $top+($size/4), $size/2, $size/2, $frameSize, false);
$thirdFrame = processFrame($type, $img, $left+($size/2), $top+($size/2), $size/4, $size/4, $frameSize, true);
$illuDough = processFrame('url', 'illudough.jpg', 0, 0, 800, 800, $frameSize, false);
$firstRow = combine($firstFrame, $secondFrame, false);
$secondRow = combine($thirdFrame, $illuDough, false);
$finale = combine($firstRow, $secondRow, true);
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Content-Type: image/jpeg');
echo base64_encode($finale);
} else {
?>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="Find 100% solid proof of Illuminati.">
<meta name="author" content="O. Inha">
<title>Illuminati Finder</title>
<link href="//fonts.googleapis.com/css2?family=Gayathri:wght@100;400&display=swap" rel="stylesheet" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="cropper.min.js"></script>
<link href="cropper.min.css" rel="stylesheet" />
<script src="jquery.cropper.min.js"></script>
</head>
<body>
<div class="cropper">
<div class="start">
<img src="pilluminati.png" class="logo" />
<input type="text" id="imgUrl" placeholder="Paste image or image URL here." />
</div>
</div>
<div class="actions"><button id="submit">Find Illuminati</button></div>
<link rel="stylesheet/less" type="text/css" href="pilluminati.less" />
<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/3.0.2/less.min.js"></script>
<script src="pilluminati.js"></script>
</body>
</html>
<?php
}
?>