I am using the library for generating Code128 barcodes which will later be integrated in another image.
Without setting any writer options the default values for the ImageWriter are: DPI=300 and ModuleWidth=0.2 (labeled mm in the docs but that is not correct, as 0.2 results in 2mm).
These settings do not go well together, as with 300dpi one dot has the size of 0.8466mm - so the default module width would equal 2.36dots.
I did not have a look into the rounding but I can confirm, that some barcodes I generate can not be read with these settings. If I set the module width to a number that results in an integer number of dots (e.g. 0.8466mm or multiples thereof) I am able to scan these barcodes.
In general one could ask, why it uses mm as a unit at all and not pixels or at least offers the possibility to set the module width in pixels without using DPI.