Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
751bf46
add type defination for overlay
manu4543 Mar 21, 2025
09b31c4
Improved JSDocs
manu4543 Mar 21, 2025
9769f40
fix: update test script to include all test files in subdirectories a…
manu4543 Mar 21, 2025
2298a72
add transformation types for different type of overlays
manu4543 Mar 21, 2025
82b5f63
test cases and logic for overlay handling
manu4543 Mar 22, 2025
6f93838
fix test case
manu4543 Mar 22, 2025
2d95621
fix build
manu4543 Mar 22, 2025
397ab31
fix: handle missing values in overlay processing to prevent invalid URLs
manu4543 Mar 22, 2025
bc03620
Add proper overlay examples
manu4543 Mar 22, 2025
57e0066
feat: add encoding options for overlay input paths and texts
manu4543 Mar 30, 2025
9275a50
explict encoding test cases
manu4543 Mar 30, 2025
f910510
fix: correct formatting in documentation comments for overlay encodin…
manu4543 Mar 30, 2025
2485020
docs: update README to include overlay options and configuration details
manu4543 Mar 30, 2025
c09f3d2
docs: improve formatting and clarity in overlay options section of RE…
manu4543 Mar 30, 2025
42fbc20
docs: correct table header and update encoding example in overlay opt…
manu4543 Mar 30, 2025
45d8a87
docs: enhance encoding descriptions and clarify overlay input formats…
manu4543 Mar 31, 2025
fbd63f0
docs: update README to clarify overlay options and improve encoding d…
manu4543 Mar 31, 2025
b4ce1dc
change default transformation position to query to better handle wild…
manu4543 Mar 31, 2025
34a2b81
refactor: remove sdkVersion from ImageKitOptions and update construct…
manu4543 Mar 31, 2025
02033ee
refactor: remove deprecated transformation effects and update related…
manu4543 Mar 31, 2025
fc2440b
docs: remove Options Reference section from README
manu4543 Mar 31, 2025
696105a
chore: update CHANGELOG for version 4.0.0 with breaking changes and n…
manu4543 Mar 31, 2025
64c5374
fix: update regex for overlay path and text to allow additional safe …
manu4543 Mar 31, 2025
c48d189
fix: update SIMPLE_OVERLAY_TEXT_REGEX to allow only safe characters i…
manu4543 Mar 31, 2025
ffe7b1a
Revert "fix: update SIMPLE_OVERLAY_TEXT_REGEX to allow only safe char…
manu4543 Mar 31, 2025
b47246e
update readme
manu4543 Mar 31, 2025
58c087f
docs: improve README formatting and clarify encoding options
manu4543 Mar 31, 2025
7e5a1d7
fix: update package.json to remove duplicate entries and add new keyw…
manu4543 Mar 31, 2025
909cb8d
docs: enhance README description for clarity and browser usage
manu4543 Apr 1, 2025
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
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## Version 4.0.0

### Breaking Changes

1. The default value for `transformationPosition` is now `query` instead of `path`. This change enables wildcard cache purging to remove CDN cache for all generated transformations.

**Action Required:**
If you're using the `transformationPosition` parameter in the `url` method and want to apply transformations in the path, you must now explicitly set the value to `path`. The default is `query`.

2. Removed the following deprecated parameters:
`effectSharpen`, `effectUSM`, `effectContrast`, `effectGray`, `effectShadow`, `effectGradient`, and `rotate`.

### Other Changes

1. Native support for overlays has been added. See the README for usage examples.
2. New AI-powered transformations are now supported:
`aiRemoveBackground`, `aiUpscale`, `aiVariation`, `aiDropShadow`, `aiChangeBackground`, and more.
*(Introduced in version 3.1.0)*

---

## SDK Version 3.0.0

### Breaking Changes
Expand Down
426 changes: 310 additions & 116 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "imagekit-javascript",
"version": "3.1.0",
"version": "4.0.0",
"description": "Javascript SDK for using ImageKit.io in the browser",
"main": "dist/imagekit.cjs.js",
"module": "dist/imagekit.esm.js",
Expand Down Expand Up @@ -43,7 +43,7 @@
"dev": "rollup -c -w",
"export-types": "tsc",
"build": "rm -rf dist*;rollup -c && yarn export-types",
"test": "NODE_ENV=test nyc ./node_modules/mocha/bin/mocha test/*.js",
"test": "NODE_ENV=test nyc ./node_modules/mocha/bin/mocha \"test/**/*.js\"",
"startSampleApp": "yarn build && cd samples/sample-app/ && yarn install && node index.js",
"report-coverage": "codecov"
},
Expand All @@ -56,13 +56,13 @@
"javascript",
"sdk",
"js",
"sdk",
"image",
"optimization",
"image",
"transformation",
"image",
"resize"
"resize",
"upload",
"video",
"overlay"
],
"author": "ImageKit Developer",
"license": "MIT",
Expand Down
23 changes: 14 additions & 9 deletions src/constants/supportedTransforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ export const supportedTransforms: { [key: string]: string } = {
duration: "du",
streamingResolutions: "sr",

// Old deprecated mappings
effectSharpen: "e-sharpen",
effectUSM: "e-usm",
effectContrast: "e-contrast",
effectGray: "e-grayscale",
effectShadow: "e-shadow",
effectGradient: "e-gradient",
rotate: "rt",

// AI & advanced effects
grayscale: "e-grayscale",
aiUpscale: "e-upscale",
Expand All @@ -66,6 +57,20 @@ export const supportedTransforms: { [key: string]: string } = {
zoom: "z",
page: "pg",

// Text overlay transformations which are not defined yet
fontSize: "fs",
fontFamily: "ff",
fontColor: "co",
innerAlignment: "ia",
padding: "pa",
alpha: "al",
typography: "tg",
lineHeight: "lh",

// Subtitles transformations which are not defined
fontOutline: "fol",
fontShadow: "fsh",

// Raw pass-through
raw: "raw",
};
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ const promisify = function <T = void>(thisContext: ImageKit, fn: Function) {

class ImageKit {
options: ImageKitOptions = {
sdkVersion: `javascript-${version}`,
publicKey: "",
urlEndpoint: "",
transformationPosition: transformationUtils.getDefault(),
};

constructor(opts: Omit<ImageKitOptions, "sdkVersion">) {
constructor(opts: ImageKitOptions) {
this.options = { ...this.options, ...(opts || {}) };
if (!mandatoryParametersAvailable(this.options)) {
throw errorMessages.MANDATORY_INITIALIZATION_MISSING;
Expand Down
1 change: 0 additions & 1 deletion src/interfaces/ImageKitOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { TransformationPosition } from ".";

export interface ImageKitOptions {
urlEndpoint: string;
sdkVersion?: string;
publicKey?: string;
transformationPosition?: TransformationPosition;
}
Loading