bbrks / go-blurhash

🖼#️⃣ A pure Go implementation of Blurhash
MIT License
146 stars 7 forks source link

(MISSING) #4

Closed bartekpacia closed 3 years ago

bartekpacia commented 3 years ago

After trying to generate a blurhash from this webp image

I get the following blurhash: LUC%!j(MISSING)g-=RixvyGo~nhS5jFj?kCWB

What does (MISSING) mean? I couldn't find any info about this.

bbrks commented 3 years ago

%!j(MISSING) is likely coming from a Sprintf/Printf that is interpreting a %j as a parameter with no value being passed in. I'm guessing you're trying to log the hash using one of these functions with the hash itself being the "format" argument.

E.g: https://golang.org/pkg/fmt/#hdr-Printing

Too few arguments: %!verb(MISSING)
    Printf("hi%d"):            hi%!d(MISSING)

All errors begin with the string "%!" followed sometimes by a single character (the verb) and end with a parenthesized description. 

You can try this approach instead, so the hash value is not interpreted as a format string, and is kept intact:

fmt.Printf("%s\n", hash)

bartekpacia commented 3 years ago

aah, facepalm

I was doing fmt.Printf(blurhashString)

After changing to Println it works just fine.

thank you very much for a fast response!