Maxicode with scale less than 1.0 doesn't work because of this line in the function "plot_raster_maxicode" in "raster.c":
hexagon_size = (int)scaler * 10;
the cast to int rounds off the variable before multiplying it. If changed the maxicode is generated correctly, but the position of the bullseye is still incorrect. The function "draw_bullseye" probably needs to be improved to be more general.
The problem is probably related to this earlier observation:
I have made the obvious fix for this so that at least something plots if the scale is less than 1.0. I think, however, that trying to plot these symbols in so few pixels is just asking for trouble and really should be discouraged.
A better solution is either to increase the resolution (I would suggest at least 600dpi) or to use a vector format such as SVG.
Hi Robin. Thanks for the fix.
I'm printing this symbol with 203 dpi, with the scale of 0.667 - there is much ancient equipment out there... (203 dpi is the lowest resolution still being used widely in label printing.)
Here is my fix for the bullseye problem. It works like before for scales >= 1.0, but additionally supports scale 0.667 when scale < 1.0
It should be possible to generalize this function for other scales less than 1.0 after some cleanup.
Last edit: codemonkey82 2019-03-16
Apparently, something was done.
The line is now:
I close the bug.
Come back if issue persists.
Hi Harald,
we additionally need to change the draw_bullseye function to support resolutions less than 1.0
Change the function call to:
draw_bullseye(pixelbuf, image_width, image_height, (2 * xoffset), (2 * yoffset), scaler * 10);and the implementation to:
and it will work. The 1.0 scale seems to target 12 pixels resolution. I need 8 pixels resolution and therefore I use the scale 0.667
The implementation I included supports this, but I don't know if it will work for other resolutions like 10 or 6 etc.
Committed. Is this ok ?
Thank you,
Harald
Hello Harald,
This is not ok.
using command line :
zint -o toto.png --esc --filetype=PNG -b 57 --primary='070940000840090' -d '[)>\R01\G961Z92338169\GUPSN\G1729X7\R07ZV./1Q% \G8B'\''A-ACTH/ HL+%"2J,\rTVMOZ(YZ42&K3$S\r\R\E'
I got segmentation error.
During the build we got warning on draw_bullseye() function
char *pixelbuf ; the star is missing
Regards,
Rémi
This seems to now work without issue. Can this ticket be closed?
Yes, it works fine for me. The ticket can be closed. Thanks!