Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
5 changes: 3 additions & 2 deletions src/providers/imagekit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,16 @@ Deno.test("imagekit generate", async (t) => {
const result = generate(img, {
w: 400,
h: 300,
c: "pad_resize",
cm: "pad_resize",
c: "at_max_enlarge",
fo: "bottom",
bg: "FFFFFF",
r: 90,
q: 85,
});
assertEqualIgnoringQueryOrder(
result,
`${img}?tr=w-400,h-300,c-pad_resize,fo-bottom,bg-FFFFFF,r-90,q-85`,
`${img}?tr=w-400,h-300,cm-pad_resize,c-at_max_enlarge,fo-bottom,bg-FFFFFF,r-90,q-85`,
);
},
);
Expand Down
14 changes: 11 additions & 3 deletions src/providers/imagekit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,24 @@ export interface ImageKitOperations extends Operations {

/**
* Crop strategy for the image.
* Options: 'maintain_ratio', 'extract', 'pad_resize', 'force', 'at_max', 'at_least'
* Options: 'maintain_ratio', 'force', 'at_max', 'at_max_enlarge', 'at_least'
*/
c?:
| "maintain_ratio"
| "extract"
| "pad_resize"
| "force"
| "at_max"
| "at_max_enlarge"
| "at_least";

/**
* Crop mode for the image.
* Options: 'extract', 'pad_resize', 'pad_extract'
*/
cm?:
| "extract"
| "pad_resize"
| "pad_extract";

/**
* Focal point for cropping. Can also pass object types for smart cropping.
* @see https://imagekit.io/docs/image-resize-and-crop#supported-object-list
Expand Down