Skip to content

Commit

Permalink
Fix types of createBlurhashFromImage
Browse files Browse the repository at this point in the history
  • Loading branch information
janicduplessis committed Jun 23, 2024
1 parent 9cd8b75 commit e09a8c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions android/src/main/java/com/mrousavy/blurhash/BlurhashModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class BlurhashModule(reactContext: ReactApplicationContext) :
@ReactMethod
override fun createBlurhashFromImage(
imageUri: String,
componentsX: Double,
componentsY: Double,
componentsX: Int,
componentsY: Int,
promise: Promise
) {
thread(true) {
Expand All @@ -44,7 +44,7 @@ class BlurhashModule(reactContext: ReactApplicationContext) :
override fun onNewResultImpl(bitmap: Bitmap?) {
try {
if (dataSource.isFinished && bitmap != null) {
val blurhash = BlurHashEncoder.encode(bitmap, componentsX.toInt(), componentsY.toInt())
val blurhash = BlurHashEncoder.encode(bitmap, componentsX, componentsY)
promise.resolve(blurhash)
} else {
if (dataSource.failureCause != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public NativeBlurhashModuleSpec(ReactApplicationContext reactContext) {

@ReactMethod
@DoNotStrip
public abstract void createBlurhashFromImage(String imageUri, double componentsX, double componentsY, Promise promise);
public abstract void createBlurhashFromImage(String imageUri, int componentsX, int componentsY, Promise promise);

@ReactMethod
@DoNotStrip
Expand Down

0 comments on commit e09a8c7

Please sign in to comment.