1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 13:19:44 +02:00

feat: Preserve original format of images, change interpolation kernel

Closes #349
This commit is contained in:
Maksim Eltyshev 2022-12-24 00:47:59 +01:00
parent b82a601f46
commit 0a5210dd21
17 changed files with 212 additions and 103 deletions

View file

@ -54,11 +54,9 @@ module.exports = {
background: {
type: 'json',
},
backgroundImageDirname: {
type: 'string',
isNotEmptyString: true,
allowNull: true,
columnName: 'background_image_dirname',
backgroundImage: {
type: 'json',
columnName: 'background_image',
},
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
@ -82,10 +80,10 @@ module.exports = {
customToJSON() {
return {
..._.omit(this, ['backgroundImageDirname']),
backgroundImage: this.backgroundImageDirname && {
url: `${sails.config.custom.projectBackgroundImagesUrl}/${this.backgroundImageDirname}/original.jpg`,
coverUrl: `${sails.config.custom.projectBackgroundImagesUrl}/${this.backgroundImageDirname}/cover-336.jpg`,
..._.omit(this, ['backgroundImage']),
backgroundImage: this.backgroundImage && {
url: `${sails.config.custom.projectBackgroundImagesUrl}/${this.backgroundImage.dirname}/original.${this.backgroundImage.extension}`,
coverUrl: `${sails.config.custom.projectBackgroundImagesUrl}/${this.backgroundImage.dirname}/cover-336.${this.backgroundImage.extension}`,
},
};
},