Skip to content

Commit d880b43

Browse files
fix: renamed resize:thumb-> thumbnail
1 parent bc030dd commit d880b43

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

packages/react/src/demo.tsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { videoCodec } from '@cloudinary/url-gen/actions/transcode';
66
import { h264 } from '@cloudinary/url-gen/qualifiers/videoCodec';
77
import { baseline } from '@cloudinary/url-gen/qualifiers/videoCodecProfile';
88
import { vcl31 } from '@cloudinary/url-gen/qualifiers/videoCodecLevel'
9-
import { sepia, backgroundRemoval } from '@cloudinary/url-gen/actions/effect';
9+
import { sepia, backgroundRemoval, blackwhite } from '@cloudinary/url-gen/actions/effect';
1010
import { format, quality } from '@cloudinary/url-gen/actions/delivery';
1111
import { CloudinaryImage, CloudinaryVideo } from './index';
1212

@@ -25,7 +25,7 @@ const LegacyComponentUsage = () => {
2525
.delivery(quality('auto'));
2626

2727
const cloudinaryVideoObject = cloudinary.video('dog.mp4')
28-
.effect(sepia())
28+
.effect(blackwhite())
2929
.transcode(
3030
videoCodec(
3131
h264()
@@ -42,7 +42,7 @@ const LegacyComponentUsage = () => {
4242
}}
4343
>
4444
<CloudinaryImage cldImg={cloudinaryImageObject} />
45-
<CloudinaryVideo cldVid={cloudinaryVideoObject} autoPlay muted />
45+
<CloudinaryVideo cldVid={cloudinaryVideoObject} autoPlay muted loop />
4646
</div>
4747
</>
4848
);
@@ -72,10 +72,15 @@ const NewComponentUsage = () => (
7272
removeBackground
7373
videoProps={{
7474
autoPlay: true,
75-
muted: true
75+
muted: true,
76+
loop: true
7677
}}
78+
duration={1}
7779
resize={{
78-
height: 200
80+
mode: 'thumbnail',
81+
height: 200,
82+
width: 200,
83+
gravity: 'auto'
7984
}}
8085
videoCodec={{
8186
use: 'h264',
@@ -84,8 +89,12 @@ const NewComponentUsage = () => (
8489
}}
8590
effects={[
8691
{ type: 'sepia' },
92+
{ type: 'noise', level: 100 },
8793
{ type: 'blur' }
8894
]}
95+
roundCorners={100}
96+
rotate={50}
97+
startOffset={1}
8998
/>
9099
</div>
91100
</>

packages/react/src/transformationParsers/parseResize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export const createParseResize =
109109
parseWhenDefined(resize.width, parseWidth)}${
110110
parseWhenDefined(resize.height, parseHeight)
111111
}`;
112-
case 'thumb':
112+
case 'thumbnail':
113113
return `c_thumb${
114114
parseWhenDefined(resize.gravity, parseGravity)}${
115115
parseWhenDefined(resize.aspectRatio, parseAspectRatio)}${

packages/react/src/transformationTypes/effect.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
// FIXME image only
12
type Sepia = {
23
type: 'sepia';
34
level?: number;
45
};
5-
6+
// FIXME image only
67
type BackgroundRemoval = {
78
type: 'backgroundRemoval';
89
mode?: 'fineEdges';
@@ -20,7 +21,7 @@ type Gamma = {
2021
*/
2122
duration: number;
2223
}
23-
24+
// FIXME image only
2425
type Grayscale = {
2526
type: 'grayscale'
2627
}

packages/react/src/transformationTypes/resize.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ type CropResize = {
6363
} & RequireAtLeastTwoProperties<SizeOptions & { aspectRatio: AspectRatio }>;
6464

6565
type ThumbResize = {
66-
mode: 'thumb';
66+
mode: 'thumbnail';
6767
gravity: Gravity;
6868
zoom?: number;
6969
} & RequireAtLeastTwoProperties<SizeOptions & { aspectRatio: AspectRatio }>;
@@ -77,6 +77,7 @@ type ImaggaScaleResize = {
7777
mode: 'imaggaScale';
7878
} & RequireAtLeastTwoProperties<SizeOptions & { aspectRatio: AspectRatio }>;
7979

80+
// FIXME improve error reporting (misinferring in tsc)
8081
export type Resize =
8182
| (RequireAtLeastOneProperty<SizeOptions> & { mode?: never })
8283
| ImaggaScaleResize

0 commit comments

Comments
 (0)