Skip to content

Commit 06d5a40

Browse files
fix: Fix types of createBlurhashFromImage (#193)
1 parent 9cd8b75 commit 06d5a40

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

android/src/main/java/com/mrousavy/blurhash/BlurhashModule.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class BlurhashModule(reactContext: ReactApplicationContext) :
2222
@ReactMethod
2323
override fun createBlurhashFromImage(
2424
imageUri: String,
25-
componentsX: Double,
26-
componentsY: Double,
25+
componentsX: Int,
26+
componentsY: Int,
2727
promise: Promise
2828
) {
2929
thread(true) {
@@ -44,7 +44,7 @@ class BlurhashModule(reactContext: ReactApplicationContext) :
4444
override fun onNewResultImpl(bitmap: Bitmap?) {
4545
try {
4646
if (dataSource.isFinished && bitmap != null) {
47-
val blurhash = BlurHashEncoder.encode(bitmap, componentsX.toInt(), componentsY.toInt())
47+
val blurhash = BlurHashEncoder.encode(bitmap, componentsX, componentsY)
4848
promise.resolve(blurhash)
4949
} else {
5050
if (dataSource.failureCause != null) {

android/src/paper/java/com/mrousavy/blurhash/NativeBlurhashModuleSpec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public NativeBlurhashModuleSpec(ReactApplicationContext reactContext) {
3434

3535
@ReactMethod
3636
@DoNotStrip
37-
public abstract void createBlurhashFromImage(String imageUri, double componentsX, double componentsY, Promise promise);
37+
public abstract void createBlurhashFromImage(String imageUri, int componentsX, int componentsY, Promise promise);
3838

3939
@ReactMethod
4040
@DoNotStrip

0 commit comments

Comments
 (0)