Giter VIP home page Giter VIP logo

Comments (10)

cbenhagen avatar cbenhagen commented on August 16, 2024 2

@Solido I agree that most of the time you would want to do this server side but there are cases like ours where it makes a lot of sense to generate the hash on a Flutter based desktop client. Computing power is not the problem there but we could optimize further by wrapping the C library. Would you accept a PR doing the encoding?

@aytunch I am currently using a cloud function to generate the hash using the Python package which also wraps the C library.

from flutter_blurhash.

aytunch avatar aytunch commented on August 16, 2024 1

@Solido @cbenhagen I just found out about this package which seems to do the encoding part in Dart. It does not have a nice Widget wrapper though.

BlurHash-Dart

from flutter_blurhash.

Solido avatar Solido commented on August 16, 2024

My approach to this problem is base on economics ...
Expensive low level operations are better handled by optimised langs like go, rust or C.
On the long run it's much more cheap.

If would advise to run FAAS using
https://github.com/woltapp/blurhash/tree/master/C

Having a dart encoder on the server side has few advantages and the case of encoding should not be handled by the client.

Thanks for sharing your idea.

from flutter_blurhash.

aytunch avatar aytunch commented on August 16, 2024

@Solido thanks for your reply, it makes sense.
For my last part of the question regarding cloud functions which I am not experienced with, do you have any idea if it is possible to encode the images calling the C library you provided above? Do you have plans on working with the Firestore Cloud Functions part of this great package?

from flutter_blurhash.

aytunch avatar aytunch commented on August 16, 2024

@cbenhagen Ben, thanks a lot for these. Just to make sure, is this the way to upload your Python package to Cloud Functions?

Cloud Functions - Python Quickstart

from flutter_blurhash.

cbenhagen avatar cbenhagen commented on August 16, 2024

Yes that should get you started. Be sure to checkout the links at the bottom of that document to see more in depth guides on cloud functions.

from flutter_blurhash.

aytunch avatar aytunch commented on August 16, 2024

Inside of the BlurHash Algorithm details they have an example of Swift Decoder and Swift Encoder. I believe Swift is not a backend language. Maybe this can help porting the encoder code to dart from swift.

from flutter_blurhash.

Solido avatar Solido commented on August 16, 2024

@cbenhagen I see the kind of solutions your working on and for some reasons it appears that desktop encoding is the way to go.

We have 3 solutions

  • pure dart
  • plugin
  • ffi

Do you think the last two have any advantages compared to resizing assets and sampling with dart ?

from flutter_blurhash.

cbenhagen avatar cbenhagen commented on August 16, 2024

I'd highly prefer a pure Dart solution which uses whatever Flutter provides for resizing. Not sure if the slight speed increase a native solution might bring would justify the burden of maintaining it for all the platforms.

from flutter_blurhash.

Solido avatar Solido commented on August 16, 2024

Let's go for a pure dart implementation yet I'll keep an eye on FFI/Rust later on.

from flutter_blurhash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.