I have opened the command prompt on a Raspberry Pi and typed the command as:
lp -d ZJ-58 -o fit-to-page /home/pi/Documents/image_name.bmp
which produces the gibberish printing as follows:
Could anybody tell me, how to resolve this issue?
Sorry to say this, but considering the quality of the printing in your photo, I wouldn't expect this printer to ever produce a picture of decent quality.
More to the point, I would use
lpstat commands to see if (a) the printer's URI corresponds to the expected configuration (like matching baudrate if this is set by the URI) and that a compatible driver is used (that is, if your device is really a ZJ-58, and the driver that is used is also set to ZJ-58).
I also see "CircuitPythonAMSIndia" repeated several times in the printout. Are you sure the printer is actually trying to print the picture, and not something else? Check out the printing queue (
lpq): it may so happen that there is zero connection between this printout (resulting form your earlier experiments) and the picture (which sits in the printing queue and is not getting printed at all).
Have you installed a printer „driver“ (CUPS filter)? I am using klirichek/zj-58 with great success.