sam159 / brotherql_grocylabels

Brother QL Grocy Label Printer Service
MIT License
8 stars 0 forks source link

Support for endless labels #2

Closed ThomasLawful closed 2 months ago

ThomasLawful commented 3 months ago

Is it possible to add support for endless label rolls?

brother_ql returns label size as [x,0] for them https://github.com/pklaus/brother_ql/blob/56cf4394ad750346c6b664821ccd7489ec140dae/brother_ql/labels.py#L89

So function https://github.com/sam159/brotherql_grocylabels/blob/7d1c782d5e5d4e3b7fc2de27124fec747ba66c9c/app/imaging.py#L22 cannot create proper image.

I think of a workaround like set height of the label to NAME_FONT_SIZE multiplied by NAME_MAX_LINES plus feed_margin that can be received from ALL_LABELS.

sam159 commented 3 months ago

@ThomasLawful I think thats certainly possible. I'll have a try at implementing it this weekend. Would you be able to test it if I do?

sam159 commented 3 months ago

@ThomasLawful I've added support for endless labels, can you give it a spin? Its under the develop tag over on dockerhub

I've set the height to be roughly the line height * max lines + due date height (if used). Theres also new a new environmental variable for ENDLESS_MARGIN which defaults to 10, but I might change to 35 if thats needed

ThomasLawful commented 3 months ago

It works.

Got Label 62, 62mm endless as / response Used GET /print?product=test&grocycode=1234 - printed and cut.

Will check margins with proper grocy products, different codes with dates and a handheld qrcode reader. Default seems a bit large at the bottom when printed without a date, will play with new ENV. But overall this update made this service golden for me.