@umituz/react-native-image 1.3.6 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-image",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"description": "Image manipulation and viewing for React Native apps - resize, crop, rotate, flip, compress, gallery viewer",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -33,8 +33,7 @@
|
|
|
33
33
|
"expo-image-manipulator": ">=12.0.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@umituz/react-native-
|
|
37
|
-
"@umituz/react-native-design-system": "^2.1.0",
|
|
36
|
+
"@umituz/react-native-design-system": "latest",
|
|
38
37
|
"expo-image": ">=1.0.0",
|
|
39
38
|
"expo-media-library": ">=15.0.0",
|
|
40
39
|
"expo-sharing": ">=12.0.0",
|
|
@@ -44,8 +43,7 @@
|
|
|
44
43
|
"react-native-reanimated": ">=3.0.0"
|
|
45
44
|
},
|
|
46
45
|
"devDependencies": {
|
|
47
|
-
"@umituz/react-native-
|
|
48
|
-
"@umituz/react-native-design-system": "^2.1.0",
|
|
46
|
+
"@umituz/react-native-design-system": "latest",
|
|
49
47
|
"expo-image": "~2.0.0",
|
|
50
48
|
"expo-image-manipulator": "~13.0.0",
|
|
51
49
|
"expo-media-library": "~17.0.0",
|
|
@@ -65,4 +63,4 @@
|
|
|
65
63
|
"README.md",
|
|
66
64
|
"LICENSE"
|
|
67
65
|
]
|
|
68
|
-
}
|
|
66
|
+
}
|
|
@@ -13,7 +13,7 @@ export class ImageTemplateService {
|
|
|
13
13
|
* @returns Formatted memegen.link URL
|
|
14
14
|
*/
|
|
15
15
|
static generateMemeUrl(options: MemeTemplateOptions): string {
|
|
16
|
-
const { templateKey, topText = '', bottomText = '' } = options;
|
|
16
|
+
const { templateKey, topText = '', bottomText = '', style, width, height } = options;
|
|
17
17
|
|
|
18
18
|
// Internal helper for memegen-specific encoding
|
|
19
19
|
const encodeMemeText = (text: string) => {
|
|
@@ -26,14 +26,24 @@ export class ImageTemplateService {
|
|
|
26
26
|
.replace(/\?/g, "~q")
|
|
27
27
|
.replace(/#/g, "~h")
|
|
28
28
|
.replace(/\//g, "~s")
|
|
29
|
-
// Additional memegen.link requirements if needed
|
|
30
29
|
);
|
|
31
30
|
};
|
|
32
31
|
|
|
33
32
|
const top = encodeMemeText(topText);
|
|
34
33
|
const bottom = encodeMemeText(bottomText);
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
let url = `https://api.memegen.link/images/${templateKey}/${top}/${bottom}.png`;
|
|
36
|
+
|
|
37
|
+
const params: string[] = [];
|
|
38
|
+
if (style) params.push(`style=${style}`);
|
|
39
|
+
if (width) params.push(`width=${width}`);
|
|
40
|
+
if (height) params.push(`height=${height}`);
|
|
41
|
+
|
|
42
|
+
if (params.length > 0) {
|
|
43
|
+
url += `?${params.join('&')}`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return url;
|
|
37
47
|
}
|
|
38
48
|
|
|
39
49
|
/**
|