You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Video overlay. Just for URL generation testing, you can't actually overlay a video on an image.
272
-
overlay: {
273
-
type: 'video',
274
-
input: 'play-pause-loop.mp4',
275
-
position: {
276
-
x: '10',
277
-
y: '20',
278
-
focus: 'center',
279
-
},
280
-
timing: {
281
-
start: 5,
282
-
duration: '10',
283
-
end: 15,
284
-
},
285
-
transformation: [
286
-
{
287
-
width: 'bw_mul_0.5',
288
-
height: 'bh_mul_0.5',
289
-
rotation: 'N45',
290
-
flip: 'h',
291
-
},
292
-
],
293
-
},
294
-
},
295
-
{
296
-
// Subtitle overlay. Just for URL generation testing, you can't actually overlay a subtitle on an image.
297
-
overlay: {
298
-
type: 'subtitle',
299
-
input: 'subtitle.srt',
300
-
position: {
301
-
x: '10',
302
-
y: '20',
303
-
focus: 'center',
304
-
},
305
-
timing: {
306
-
start: 5,
307
-
duration: '10',
308
-
end: 15,
309
-
},
310
-
transformation: [
311
-
{
312
-
fontSize: 12,
313
-
fontColor: 'white',
314
-
}asany,// Using any to allow general transformations in subtitle overlay for testing
315
-
],
316
-
},
317
-
},
318
-
{
319
-
// Solid color overlay
320
-
overlay: {
321
-
type: 'solidColor',
322
-
color: 'FF0000',
323
-
position: {
324
-
x: '10',
325
-
y: '20',
326
-
focus: 'center',
327
-
},
328
-
timing: {
329
-
start: 5,
330
-
duration: '10',
331
-
end: 15,
332
-
},
333
-
transformation: [
334
-
{
335
-
width: 100,
336
-
height: 50,
337
-
// Using type assertion to allow general transformation params for testing
338
-
}asany,
339
-
],
340
-
},
341
-
},
239
+
{
240
+
// Image overlay
241
+
overlay: {
242
+
type: "image",
243
+
input: "logo.png",
244
+
position: {
245
+
x: "10",
246
+
y: "20",
247
+
focus: "center"
248
+
},
249
+
timing: {
250
+
start: 5,
251
+
duration: "10",
252
+
end: 15
253
+
},
254
+
transformation: [
255
+
{
256
+
width: "bw_mul_0.5",
257
+
height: "bh_mul_0.5",
258
+
rotation: "N45",
259
+
flip: "h",
260
+
overlay: {
261
+
type: "text",
262
+
text: "Nested text overlay",
263
+
}
264
+
}
265
+
]
266
+
}
267
+
},
268
+
{
269
+
// Video overlay. Just for URL generation testing, you can't actually overlay a video on an image.
270
+
overlay: {
271
+
type: "video",
272
+
input: "play-pause-loop.mp4",
273
+
position: {
274
+
x: "10",
275
+
y: "20",
276
+
focus: "center"
277
+
},
278
+
timing: {
279
+
start: 5,
280
+
duration: "10",
281
+
end: 15
282
+
},
283
+
transformation: [{
284
+
width: "bw_mul_0.5",
285
+
height: "bh_mul_0.5",
286
+
rotation: "N45",
287
+
flip: "h",
288
+
}]
289
+
}
290
+
},
291
+
{
292
+
// Subtitle overlay. Just for URL generation testing, you can't actually overlay a subtitle on an image.
293
+
overlay: {
294
+
type: "subtitle",
295
+
input: "subtitle.srt",
296
+
position: {
297
+
x: "10",
298
+
y: "20",
299
+
focus: "center"
300
+
},
301
+
timing: {
302
+
start: 5,
303
+
duration: "10",
304
+
end: 15
305
+
},
306
+
transformation: [{
307
+
background: "red",
308
+
color: "0000ff",
309
+
fontFamily: "Arial",
310
+
fontOutline: "2_A1CCDD50",
311
+
fontShadow: "A1CCDD_3"
312
+
}]
313
+
}
314
+
},
315
+
{
316
+
// Solid color overlay
317
+
overlay: {
318
+
type: "solidColor",
319
+
color: "FF0000",
320
+
position: {
321
+
x: "10",
322
+
y: "20",
323
+
focus: "center"
324
+
},
325
+
timing: {
326
+
start: 5,
327
+
duration: "10",
328
+
end: 15
329
+
},
330
+
transformation: [{
331
+
width: "bw_mul_0.5",
332
+
height: "bh_mul_0.5",
333
+
alpha: 0.5,
334
+
background: "red",
335
+
gradient: true,
336
+
radius: "max"
337
+
}]
338
+
}
339
+
}
342
340
],
343
341
});
344
342
345
-
expect(url).toBe(
346
-
`https://ik.imagekit.io/test_url_endpoint/tr:l-text,i-${encodeURIComponent('Every thing')},lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,fs-20,ff-Arial,co-0000ff,ia-left,pa-5,al-7,tg-b,bg-red,r-10,rt-N45,fl-h,lh-20,l-end:l-image,i-logo.png,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,h-bh_mul_0.5,rt-N45,fl-h,l-text,i-${encodeURIComponent('Nested text overlay')},l-end,l-end:l-video,i-play-pause-loop.mp4,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,l-end:l-subtitle,i-subtitle.srt,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,l-end:l-image,i-ik_canvas,bg-FF0000,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,h-bh_mul_0.5,rt-N45,fl-h,l-end/base-image.jpg`,
0 commit comments