Fork me on GitHub
#babashka
<
2022-07-04
>
henryw37409:07:47

has anyone used babashka to compress stuff? I see java.util.zip.Deflater is not there. are there other options anyone knows of?

1
borkdude09:07:50

Also the gzip interop stuff is supported. We can expose Deflater, so far it hasn't been necessary, but if you can provide an example where this would be useful, we could expose it. There is also fs/unzip EDIT: turns out it was already exposed :)

1
henryw37410:07:59

what I am trying to do is encode diagrams so they can be used by kroki https://kroki.io/. It looks like the encoding they require is pretty specific, zlib on max compression: https://docs.kroki.io/kroki/setup/encode-diagram/#java I am finding it just fails with gzip or even lower compression :(.

borkdude10:07:33

@henryw374 If I would add a branch with the necessary class and you could download that binary as a temporary solution, would that help?

borkdude10:07:20

and if it works out, we can merge to master and it becomes part of the next release

henryw37410:07:32

that'd be great

borkdude10:07:38

what's your OS?

borkdude10:07:12

Hey, wait java.util.zip.Deflater is already there

henryw37410:07:14

ah... I just upgraded bb. possibly wasnt in my version

borkdude10:07:25

$ bb -e 'java.util.zip.Deflater/BEST_COMPRESSION'
9

henryw37410:07:41

thanks! sorry for the noise

❤️ 1
henryw37409:07:35

thanks I'll have a look

henryw37412:07:08

in case anyone finds it helpful, here are bb scripts to round trip from diagram files to kroki urls (kroki creates diagrams from text see https://kroki.io/#try) : https://gist.github.com/henryw374/070845dbd8cfb4672a3c0d06cf8b00e4

borkdude12:07:37

@henryw374 Awesome! Since when does github gists highlight .bb as clojure? Perhaps you have an idea on this too (sharing scripts): https://github.com/babashka/babashka/discussions/1307

🚀 1
borkdude12:07:34

Awesome, it seems we won from BlitzBasic then!

lispyclouds12:07:02

yeah bb finally is not written in basic

henryw37413:07:27

cheers. installing scripts would be nice to have