Skip to content

Commit 0499334

Browse files
ANKUR DWIVEDIANKUR DWIVEDI
ANKUR DWIVEDI
authored and
ANKUR DWIVEDI
committed
added transformation example
1 parent 2a0373f commit 0499334

File tree

12 files changed

+8114
-3930
lines changed

12 files changed

+8114
-3930
lines changed

angular/.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
node_modules
2+
dist

angular/package-lock.json

+192-184
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

angular/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@angular/platform-browser": "~9.1.13",
2020
"@angular/platform-browser-dynamic": "~9.1.13",
2121
"@angular/router": "~9.1.13",
22-
"imagekitio-angular": "^3.0.0",
22+
"imagekitio-angular": "^4.0.0",
2323
"rxjs": "~6.5.4",
2424
"tslib": "^1.10.0",
2525
"zone.js": "~0.10.2"

angular/src/app/app.component.html

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ <h1>Hi! This is an ImageKit Angular SDK Demo!</h1>
100100
[onUploadStart]="onUploadStartFunction"
101101
[onUploadProgress]="onUploadProgressFunction"
102102
[authenticator]="authenticator"
103+
[transformation]='{ pre: "l-text,i-Imagekit,fs-50,l-end", "post": [{type: "transformation", value: "w-100"}]}'
103104
class="file-upload-ik">
104105
</ik-upload>
105106
<button (click)="onAbortFunction()">Abort</button>

angular/src/app/app.component.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export class AppComponent {
1515

1616
transformation: Array<Transformation> = [{
1717
height: "200",
18-
width: "200"
18+
width: "200",
19+
effectShadow: "bl-15_st-40_x-10_y-N5",
20+
effectGradient: "from-red_to-white",
1921
}];
2022

2123
flexibleTransformationOne: Array<Transformation> = [{

python/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
requests==2.22.0
2-
imagekitio~=3.0.0
2+
imagekitio~=4.0.0

python/sample.py

+5
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
overwrite_tags=False,
7777
overwrite_custom_metadata=True,
7878
# custom_metadata={"test": 12}, # only add custom meta data if you have it in account.
79+
transformation={ "pre": 'l-text,i-Imagekit,fs-50,l-end', "post": [{"type": 'transformation', "value": 'w-100'}]}
7980
),
8081
)
8182

@@ -111,6 +112,7 @@
111112
overwrite_tags=False,
112113
overwrite_custom_metadata=True,
113114
# custom_metadata={"test": 12}, # only add custom meta data if you have it in account.
115+
transformation={ "pre": 'l-text,i-Imagekit,fs-50,l-end', "post": [{"type": 'transformation', "value": 'w-100'}]}
114116
),
115117
)
116118

@@ -149,6 +151,7 @@
149151
overwrite_tags=False,
150152
overwrite_custom_metadata=True,
151153
# custom_metadata={"test": 12}, # only add custom meta data if you have it in account.
154+
transformation={ "pre": 'l-text,i-Imagekit,fs-50,l-end', "post": [{"type": 'transformation', "value": 'w-100'}]}
152155
),
153156
)
154157

@@ -299,6 +302,8 @@
299302
"progressive": "true",
300303
"effect_sharpen": "-",
301304
"effect_contrast": "1",
305+
"effect_shadow": "bl-15_st-40_x-10_y-N5",
306+
"effect_gradient": "from-red_to-white",
302307
}
303308
],
304309
}

react/src/App.js

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ function App() {
9191
// style={{display: 'none'}} // hide the default input and use the custom upload button
9292
inputRef={inputRefTest}
9393
ref={ikUploadRefTest}
94+
transformation={{ pre: "l-text,i-Imagekit,fs-50,l-end", post: [{ type: "transformation", value: "w-100" }] }}
9495
/>
9596
<p>Custom Upload Button</p>
9697
{ikUploadRefTest && <button onClick={() => ikUploadRefTest.current.click()}>Upload</button>}

ruby/ruby_app/app.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919

2020
# 2 Using full image URL
2121
image_url = imagekitio.url({src: url_endpoint.chomp("/") + "/default-image.jpg",
22-
transformation: [{height: "300", width: "400"}],})
22+
transformation: [{height: "300", width: "400", effect_shadow: "bl-15",
23+
effect_gradient: "from-lightskyblue_to-mintcream"}],})
2324
puts "-------------------------------------"
2425

2526
puts "Url using full image url => #{image_url}"
@@ -45,7 +46,8 @@
4546
response_fields: 'tags,customCoordinates,isPrivateFile,metadata',
4647
tags: %w[abc def],
4748
use_unique_file_name: false,
48-
is_private_file: true
49+
is_private_file: true,
50+
transformation: { pre: 'l-text,i-Imagekit,fs-50,l-end', post: [{type: 'transformation', value: 'w-100'}]},
4951
)
5052
puts "------------------------------------------", "\n"
5153
puts "Upload Private with binary => ", upload

0 commit comments

Comments
 (0)