Removed console.log

This commit is contained in:
dbroqua 2019-03-12 23:11:28 +01:00
parent 8b8f20a6d1
commit 823e6f0de3
4 changed files with 13 additions and 41 deletions

View file

@ -44,25 +44,11 @@ class Aws {
const newFile = params.path + '.' + params.filename.split('.')[1] const newFile = params.path + '.' + params.filename.split('.')[1]
fs.copyFile(params.path, newFile, (err, res) => { fs.copyFile(params.path, newFile, (err, res) => {
console.log('_compress => copyFile')
if (err) { if (err) {
callback(err, null) callback(err, null)
return false return false
} }
try {
(async () => {
// const file = await imagemin([newFile], '/tmp', {
// plugins: [
// imageminJpegtran(),
// imageminPngquant({
// quality: '65-80'
// })
// ]
// })
// console.log('Après imagemin')
this._send({ this._send({
path: newFile, path: newFile,
// path: file[0].path, // path: file[0].path,
@ -71,11 +57,6 @@ class Aws {
callback(err, res) callback(err, res)
// fs.unlink(file[0].path, () => { }) // fs.unlink(file[0].path, () => { })
}) })
})()
} catch (e) {
console.log('Error:', e)
callback(e)
}
}) })
} }
@ -86,7 +67,6 @@ class Aws {
*/ */
upload(params, callback) { upload(params, callback) {
fs.readFile(params.path, (err, data) => { fs.readFile(params.path, (err, data) => {
console.log('après upload -> readfile')
if (err) { if (err) {
callback(err, null) callback(err, null)
return false return false

View file

@ -19,7 +19,6 @@ class Resize {
_resize (input, output, callback) { _resize (input, output, callback) {
fs.readFile(input, (err, data) => { fs.readFile(input, (err, data) => {
console.log('après readfile')
if (err) { if (err) {
callback(err, null) callback(err, null)
return false return false
@ -27,9 +26,7 @@ class Resize {
resizeImg(data, this.size) resizeImg(data, this.size)
.then(buf => { .then(buf => {
console.log('then rezise')
fs.writeFile(output, buf, (err) => { fs.writeFile(output, buf, (err) => {
console.log('write file')
if (err) { if (err) {
callback(err, null) callback(err, null)
return false return false

View file

@ -165,10 +165,7 @@ class Pictures {
fs.unlink(large.output, () => { }) fs.unlink(large.output, () => { })
console.log('avant thumb')
resize.createThumbnail(req.file.path, (err, file) => { resize.createThumbnail(req.file.path, (err, file) => {
console.log('après createThumb')
if (err) { if (err) {
callback(err, null) callback(err, null)
return false return false
@ -178,7 +175,6 @@ class Pictures {
path: file.output, path: file.output,
filename: `picture_${req.params.vegetablesId}_${key}_thumb.${req.file.originalname.split('.')[req.file.originalname.split('.').length - 1]}` filename: `picture_${req.params.vegetablesId}_${key}_thumb.${req.file.originalname.split('.')[req.file.originalname.split('.').length - 1]}`
}, (err, res) => { }, (err, res) => {
console.log('après upload')
if (err) { callback(err, null) } if (err) { callback(err, null) }
this._createOne(req, callback) this._createOne(req, callback)

View file

@ -85,7 +85,6 @@ class VegetableProperties {
callback(null, null) callback(null, null)
}) })
.catch(e => { .catch(e => {
console.log('this case?')
callback(e, null) callback(e, null)
}) })
}) })