Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How would I implement blurhash? #112

Open
ffMathy opened this issue Jan 22, 2021 · 1 comment
Open

How would I implement blurhash? #112

ffMathy opened this issue Jan 22, 2021 · 1 comment

Comments

@ffMathy
Copy link

ffMathy commented Jan 22, 2021

I'm interested in implementing https://blurha.sh for my images while they are loading.

For that, I'll need to be able to load an array of pixel colors into the image view. Is that possible?

That's all that's required for me to get this working.

@m1ga
Copy link
Contributor

m1ga commented Jan 23, 2021

I think you should create an own module for that. Look at the official Kotlin demo:
https://github.com/woltapp/blurhash/blob/master/Kotlin/demo/src/main/java/com/wolt/blurhashapp/MainActivity.kt#L18
it will return a Bitmap from the string you've entered. So it should be trivial to set it as an image to av.imageview or even a normal imageview.

Inside TiBlob there is a blobFromImage: https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/TiBlob.java#L137

You might even be able to do this with Hyperloop without creating a module.

edit: and of course: join us at tislack.org (#module-development)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants