dont gm noprofile all images, causes hash issues and then instead use the builtin .mv to move the file

merge-requests/208/head
fatchan 5 years ago
parent acae39ad0e
commit e1ac3b6d0f
  1. 3
      gulp/res/css/style.css
  2. 7
      helpers/files/imageupload.js
  3. 1
      views/includes/navbar.pug
  4. 2
      views/includes/postform.pug
  5. 2
      views/mixins/post.pug

@ -440,6 +440,7 @@ td, th {
color: white;
padding: 0px 2px;
border: 1px solid rgba(0, 0, 0, 0.4);
border-radius: 1px;
}
.post-check {
@ -674,7 +675,7 @@ input[type="submit"] {
}
input[type="file"] {
width: 200px;
width: 220px;
background: var(--input-background);
}

@ -1,14 +1,11 @@
'use strict';
const uploadDirectory = require(__dirname+'/uploadDirectory.js')
, gm = require('gm');
const uploadDirectory = require(__dirname+'/uploadDirectory.js');
module.exports = (file, filename, folder) => {
return new Promise((resolve, reject) => {
gm(file.tempFilePath)
.noProfile()
.write(`${uploadDirectory}${folder}/${filename}`, function (err) {
file.mv(`${uploadDirectory}${folder}/${filename}`, function (err) {
if (err) {
return reject(err);
}

@ -4,4 +4,3 @@ nav.navbar#top
a.nav-item(href='/boards.html') Boards
a.nav-item(href=`/${board ? board._id+'/manage/reports' : 'globalmanage/reports'}.html`) Manage
a.nav-item(href='/create.html') Create
a.nav-item.right(href='/logout') Logout

@ -56,4 +56,4 @@ section.form-wrapper.flex-center
.col
include ./captcha.pug
input#submitpost(type='submit', value=`New ${isThread ? 'Reply' : 'Thread'}`)
a.toggle-summary(href='#postform') Open Postform
a.toggle-summary(href='#postform') [New Post]

@ -42,7 +42,7 @@ mixin post(post, truncate, manage=false, globalmanage=false, ban=false)
a.no-decoration(href=`${postURL}#postform`) #{post.postId}
if !post.thread
|
span: a(href=`/${post.board}/thread/${post.thread || post.postId}.html#postform`) [Reply]
span: a(href=`${postURL}#postform`) [Reply]
.post-data
if post.files.length > 0
.post-files

Loading…
Cancel
Save