miikanissi/zebrafy

GFA vs GFC for Z64

Closed this issue · 1 comments

It seems like Z64 encoding should use GFA, because it's an ascii representation, not binary. Labelary (https://labelary.com/viewer.html) refuses to display your test Z64 images without changing ^GFC to ^GFA.

GFC is meant to be some other raw bytes format.

I grabbed this screenshot of a section of the ZPL programming guide: Screenshot 2024-03-19 at 1 41 47 PM

It might make sense to change the interface from compression_type = "A" | "B" | "C" and then funneling that directly into the compression field of ^GF to instead use a format= enumeration of ASCII,BINARY, B64, Z64 options and then pick the compression field to be A or B appropriately based on the selection (B for BINARY, A for the rest). It's not clear to me what output should actually be used for ^GFC, though if you do find out then presumably a COMPRESSED_BINARY option could be added for that too.

Thanks for raising this issue. You seem to be spot on that it should use ^GFA instead of ^GFB or ^GFC since the B64 and Z64 are converted into ASCII for the end result.

I couldn't actually figure out at all what format the (compressed) binary data should be for ^GFB or ^GFC so I have removed them completely and the library will only ever output ^GFA fields. I have also now deprecated the compression_type argument in favor of format and updated the docs.