mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Better handling for images
This commit is contained in:
@@ -10,9 +10,9 @@ $image->blurImage(30,50);
|
|||||||
|
|
||||||
$output = $image->getimageblob();
|
$output = $image->getimageblob();
|
||||||
|
|
||||||
//$image->setImageFormat("jpeg");
|
$image->setImageFormat("jpeg");
|
||||||
|
|
||||||
//$image->imageWriteFile (fopen ("/static/images/thumbnails/".$_POST['id'].".jpg", "wb"));
|
file_put_contents ("../static/images/thumbnails/".$_POST['id'].".jpg", $image);
|
||||||
|
|
||||||
echo base64_encode($output);
|
echo base64_encode($output);
|
||||||
?>
|
?>
|
||||||
2
static/dist/frontpage.min.js
vendored
2
static/dist/frontpage.min.js
vendored
File diff suppressed because one or more lines are too long
4
static/dist/main.min.js
vendored
4
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -121,15 +121,6 @@ var Nochan = {
|
|||||||
|
|
||||||
if(Nochan.blob_list[i] !== undefined){
|
if(Nochan.blob_list[i] !== undefined){
|
||||||
//$(".room-namer").css("opacity", 0);
|
//$(".room-namer").css("opacity", 0);
|
||||||
var img = new Image();
|
|
||||||
img.src = "/images/thumbnails/"+id+".jpg";
|
|
||||||
|
|
||||||
img.onerror = function(){ // Failed to load
|
|
||||||
console.log("didn't find");
|
|
||||||
};
|
|
||||||
img.onload = function(){ // Loaded successfully
|
|
||||||
console.log("found");
|
|
||||||
};
|
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
$("#mega-background").css("background", "url(data:image/png;base64,"+Nochan.blob_list[i]+")");
|
$("#mega-background").css("background", "url(data:image/png;base64,"+Nochan.blob_list[i]+")");
|
||||||
$("#mega-background").css("background-size" , "200%");
|
$("#mega-background").css("background-size" , "200%");
|
||||||
@@ -138,21 +129,16 @@ var Nochan = {
|
|||||||
//$(".room-namer").css("opacity", 1);
|
//$(".room-namer").css("opacity", 1);
|
||||||
},500);
|
},500);
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
var img = new Image();
|
var img = new Image();
|
||||||
img.src = "/images/thumbnails/"+id+".jpg";
|
img.src = "/static/images/thumbnails/"+id+".jpg";
|
||||||
|
|
||||||
img.onerror = function(){ // Failed to load
|
img.onerror = function(){ // Failed to load
|
||||||
console.log("didn't find");
|
|
||||||
};
|
|
||||||
img.onload = function(){ // Loaded successfully
|
|
||||||
console.log("found");
|
|
||||||
};
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
data: {id:id},
|
data: {id:id},
|
||||||
url: "/php/imageblob.php",
|
url: "/php/imageblob.php",
|
||||||
success: function(data){
|
success: function(data){
|
||||||
console.log(data);
|
|
||||||
Nochan.blob_list.push(data);
|
Nochan.blob_list.push(data);
|
||||||
//data will contain the vote count echoed by the controller i.e.
|
//data will contain the vote count echoed by the controller i.e.
|
||||||
//$(".room-namer").css("opacity", 0);
|
//$(".room-namer").css("opacity", 0);
|
||||||
@@ -168,6 +154,14 @@ var Nochan = {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
img.onload = function(){ // Loaded successfully
|
||||||
|
$("#mega-background").css("background", "url("+img.src+")");
|
||||||
|
$("#mega-background").css("background-size" , "200%");
|
||||||
|
$("#mega-background").css("opacity", 1);
|
||||||
|
$("#search").attr("placeholder", list[i][3]);
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
Nochan.add_backdrop(list, i+1);
|
Nochan.add_backdrop(list, i+1);
|
||||||
|
|||||||
Reference in New Issue
Block a user