Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: "14.x"
node-version: "22.x"
- run: npm ci
- run: npm test
env:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM node:14
FROM node:22

# Create app directory
WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install --prod
RUN npm ci --omit=dev

COPY . /usr/src/app

Expand Down
4 changes: 3 additions & 1 deletion lib/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ logger.debug(`DATABASE PATH: ${DATABASE_PATH}`);

let sequelize;
if(process.env.NODE_ENV === 'test'){
sequelize = new Sequelize('sqlite::memory:', {
sequelize = new Sequelize({
dialect: 'sqlite',
storage: ':memory:',
logging: false
});
}else{
Expand Down
10 changes: 5 additions & 5 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const crypto = require('crypto');
const path = require('path');
const mime = require('mime-types');
const axios = require('axios');
const jimp = require('jimp');
const { Jimp } = require('jimp');
const { format } = require('date-fns');
const {ALLOWED_EXT, SIMPLE_DATE_FORMAT} = require('./constants');

Expand Down Expand Up @@ -36,12 +36,12 @@ const normalizeImage = async(filepath) => {
let extension = path.extname(filepath);
let filenameNoExt = path.basename(filepath, extension);
let convertPath = path.join(__dirname, '..', 'data', 'img', `${filenameNoExt}_converted.png`);
const image = await jimp.read(filepath);
const image = await Jimp.read(filepath);
await image
.resize(1280, 720)
.resize({w: 1280, h: 720})
.greyscale()
.contrast(+1)
.writeAsync(convertPath);
.contrast(1)
.write(convertPath);
return convertPath;
}

Expand Down
Loading
Loading