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) {
|
router.route('/api/imageblob').post(function(req, res) {
|
||||||
var Jimp = require("jimp");
|
var Jimp = require("jimp");
|
||||||
Jimp.read('https://img.youtube.com/vi/' + req.body.id + '/mqdefault.jpg', function (err, image) {
|
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)
|
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");
|
res.send(req.body.id + ".jpg");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ var server;
|
|||||||
var add = "";
|
var add = "";
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const publicPath = path.join(__dirname, 'public');
|
const publicPath = path.join(__dirname, 'public');
|
||||||
|
pathThumbnails = __dirname;
|
||||||
var express = require('express');
|
var express = require('express');
|
||||||
var app = express();
|
var app = express();
|
||||||
var exphbs = require('express-handlebars');
|
var exphbs = require('express-handlebars');
|
||||||
|
|||||||
Reference in New Issue
Block a user