feat(imageresizer): add trim options (#2073)

* freat(imageresizer): add trim options

* fix(imageresizer): check for trimOptions config key

* feat: add trimOptions to original file upload, add test config

* chore: adjust sharp file ref

---------

Co-authored-by: Steven Thompson <steven@teamtailor.com>
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
This commit is contained in:
Steven Thompson
2023-04-24 18:09:04 +01:00
committed by GitHub
parent a0fd26602e
commit 0406548fe6
5 changed files with 59 additions and 2 deletions

View File

@@ -135,6 +135,39 @@ export default buildConfig({
},
fields: [],
},
{
slug: 'media-trim',
upload: {
staticURL: '/media-trim',
staticDir: './media-trim',
mimeTypes: ['image/png', 'image/jpg', 'image/jpeg'],
trimOptions: 0,
imageSizes: [
{
name: 'trimNumber',
width: 1024,
height: undefined,
trimOptions: 0,
},
{
name: 'trimString',
width: 1024,
height: undefined,
trimOptions: 0,
},
{
name: 'trimOptions',
width: 1024,
height: undefined,
trimOptions: {
background: '#000000',
threshold: 50,
},
},
],
},
fields: [],
},
{
slug: 'unstored-media',
upload: {