mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed issue with frontpagelists image not being saved on 404
This commit is contained in:
@@ -46,9 +46,9 @@ router.route('/:channel_name').get(function(req, res, next){
|
||||
router.route('/api/imageblob').post(function(req, res) {
|
||||
var Jimp = require("jimp");
|
||||
Jimp.read('https://img.youtube.com/vi/' + req.body.id + '/mqdefault.jpg', function (err, image) {
|
||||
if (err) throw err;
|
||||
if (err) console.log(err);
|
||||
image.blur(50)
|
||||
.write(path.join(__dirname, '/public/assets/images/thumbnails/' + req.body.id + '.jpg'), function(e, r) {
|
||||
.write(path.join(pathThumbnails, '/public/assets/images/thumbnails/' + req.body.id + '.jpg'), function(e, r) {
|
||||
res.send(req.body.id + ".jpg");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@ var server;
|
||||
var add = "";
|
||||
const path = require('path');
|
||||
const publicPath = path.join(__dirname, 'public');
|
||||
pathThumbnails = __dirname;
|
||||
var express = require('express');
|
||||
var app = express();
|
||||
var exphbs = require('express-handlebars');
|
||||
|
||||
Reference in New Issue
Block a user