Skip to content

Commit 7390f2e

Browse files
manu4543Copilot
andcommitted
feat(transformation): add colorize transformation support in URL generation
Co-authored-by: Copilot <copilot@github.com>
1 parent f6a558e commit 7390f2e

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/lib/transformation-utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export const supportedTransforms: { [key: string]: string } = {
6161
unsharpMask: 'e-usm',
6262
gradient: 'e-gradient',
6363
colorReplace: 'cr',
64+
colorize: 'e-colorize',
6465
distort: 'e-distort',
6566

6667
// Other flags & finishing

tests/custom-tests/url-generation/basic.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,7 @@ describe('URL generation', function () {
13431343
unsharpMask: '2-2-0.8-0.024',
13441344
gradient: 'from-red_to-white',
13451345
// New transformation parameters
1346+
colorize: 'co-FF0000_in-15',
13461347
colorReplace: 'FF0000_50_00FF00',
13471348
distort: 'p-50_50_150_50_150_150_50_150',
13481349
original: true,
@@ -1353,7 +1354,7 @@ describe('URL generation', function () {
13531354
});
13541355

13551356
expect(url).toBe(
1356-
`https://ik.imagekit.io/test_url_endpoint/test_path.jpg?tr=h-300,w-400,ar-4-3,q-40,c-force,cm-extract,fo-left,f-jpeg,r-50,bg-A94D34,b-5-A94D34,rt-90,bl-10,n-some_name,pr-true,lo-true,t-5,md-true,cp-true,di-folder@@file.jpg,dpr-3,x-10,y-20,xc-30,yc-40,fl-h,o-0.8,z-2,vc-h264,ac-aac,so-5,eo-15,du-10,sr-1440_1080,e-grayscale,e-upscale,e-retouch,e-genvar,e-dropshadow,e-changebg-prompt-car,e-edit-prompt-make it vintage,e-bgremove,e-contrast,e-shadow-bl-15_st-40_x-10_y-N5,e-sharpen-10,e-usm-2-2-0.8-0.024,e-gradient-from-red_to-white,cr-FF0000_50_00FF00,e-distort-p-50_50_150_50_150_150_50_150,orig-true,pg-2_4,h-200,w-300,l-image,i-logo.png,l-end`,
1357+
`https://ik.imagekit.io/test_url_endpoint/test_path.jpg?tr=h-300,w-400,ar-4-3,q-40,c-force,cm-extract,fo-left,f-jpeg,r-50,bg-A94D34,b-5-A94D34,rt-90,bl-10,n-some_name,pr-true,lo-true,t-5,md-true,cp-true,di-folder@@file.jpg,dpr-3,x-10,y-20,xc-30,yc-40,fl-h,o-0.8,z-2,vc-h264,ac-aac,so-5,eo-15,du-10,sr-1440_1080,e-grayscale,e-upscale,e-retouch,e-genvar,e-dropshadow,e-changebg-prompt-car,e-edit-prompt-make it vintage,e-bgremove,e-contrast,e-shadow-bl-15_st-40_x-10_y-N5,e-sharpen-10,e-usm-2-2-0.8-0.024,e-gradient-from-red_to-white,e-colorize-co-FF0000_in-15,cr-FF0000_50_00FF00,e-distort-p-50_50_150_50_150_150_50_150,orig-true,pg-2_4,h-200,w-300,l-image,i-logo.png,l-end`,
13571358
);
13581359
});
13591360

0 commit comments

Comments
 (0)