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

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

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

@ -56,4 +56,4 @@ section.form-wrapper.flex-center
.col .col
include ./captcha.pug include ./captcha.pug
input#submitpost(type='submit', value=`New ${isThread ? 'Reply' : 'Thread'}`) 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} a.no-decoration(href=`${postURL}#postform`) #{post.postId}
if !post.thread if !post.thread
| |
span: a(href=`/${post.board}/thread/${post.thread || post.postId}.html#postform`) [Reply] span: a(href=`${postURL}#postform`) [Reply]
.post-data .post-data
if post.files.length > 0 if post.files.length > 0
.post-files .post-files

Loading…
Cancel
Save