@react-native-ohos/react-native-blurhash 2.2.0-rc.1 → 2.2.0-rc.2
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/README.OpenSource +1 -1
- package/harmony/blurhash/BuildProfile.ets +1 -1
- package/harmony/blurhash/oh-package.json5 +1 -1
- package/harmony/blurhash/src/main/cpp/Blurhash.cpp +3 -1
- package/harmony/blurhash/src/main/cpp/BlurhashViewComponentInstance.cpp +3 -1
- package/harmony/blurhash.har +0 -0
- package/package.json +1 -1
package/README.OpenSource
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"Name": "react-native-blurhash",
|
|
4
4
|
"License": "MIT License",
|
|
5
5
|
"License File": "https://github.com/mrousavy/react-native-blurhash/blob/master/LICENSE",
|
|
6
|
-
"Version Number": "2.
|
|
6
|
+
"Version Number": "2.1.3",
|
|
7
7
|
"Owner" : "xiafeng@huawei.com",
|
|
8
8
|
"Upstream URL": "https://github.com/mrousavy/react-native-blurhash",
|
|
9
9
|
"Description": "🖼 Blurhash is a compact representation of a placeholder for an image. This is a Native UI Module for React Native to asynchronously wrap the Blurhash implementations and make them usable in React Native. Also supports encoding!"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Use these variables when you tailor your ArkTS code. They must be of the const type.
|
|
3
3
|
*/
|
|
4
|
-
export const HAR_VERSION = '2.2.0-rc.
|
|
4
|
+
export const HAR_VERSION = '2.2.0-rc.2';
|
|
5
5
|
export const BUILD_MODE_NAME = 'debug';
|
|
6
6
|
export const DEBUG = true;
|
|
7
7
|
export const TARGET_NAME = 'default';
|
|
@@ -219,7 +219,9 @@ std::string decode(std::string_view blurhash, size_t width, size_t height, float
|
|
|
219
219
|
i.height = height;
|
|
220
220
|
i.width = width;
|
|
221
221
|
|
|
222
|
-
std::string filename = path + std::string(blurhash) + "
|
|
222
|
+
std::string filename = path + std::string(blurhash) + "_" +
|
|
223
|
+
std::to_string(width) + "x" + std::to_string(height) +
|
|
224
|
+
"_p" + std::to_string(static_cast<int>(punch * 100)) + ".bmp";
|
|
223
225
|
stbi_write_bmp(filename.c_str(), i.width, i.height, 3, (void *)i.image.data());
|
|
224
226
|
return filename;
|
|
225
227
|
}
|
|
@@ -78,7 +78,9 @@ void BlurhashViewComponentInstance::onPropsChanged(SharedConcreteProps const &pr
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
std::string BlurhashViewComponentInstance::decodeImageByBlurhash(const std::string &blurhash, const int &width, const int &height, const float &punch) {
|
|
81
|
-
std::string expectedName =
|
|
81
|
+
std::string expectedName =
|
|
82
|
+
blurhash + "_" + std::to_string(width) + "x" + std::to_string(height) +
|
|
83
|
+
"_p" + std::to_string(static_cast<int>(punch * 100)) + ".bmp";
|
|
82
84
|
blurhash::decode(blurhash, width, height, punch);
|
|
83
85
|
auto rnInstance = m_deps->rnInstance.lock();
|
|
84
86
|
auto turboModule = rnInstance->getTurboModule("ImageLoader");
|
package/harmony/blurhash.har
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-ohos/react-native-blurhash",
|
|
3
3
|
"title": "React Native Blurhash",
|
|
4
|
-
"version": "2.2.0-rc.
|
|
4
|
+
"version": "2.2.0-rc.2",
|
|
5
5
|
"description": "🖼 Blurhash is a compact representation of a placeholder for an image. This is a Native UI Module for React Native to asynchronously wrap the Blurhash implementations and make them usable in React Native. Also supports encoding!",
|
|
6
6
|
"main": "lib/commonjs/index.js",
|
|
7
7
|
"types": "lib/typescript/index.d.ts",
|