优化QrCodeUtil

This commit is contained in:
TomXin 2022-08-23 13:13:21 +08:00
parent e6fc469e60
commit a764477cc0

View File

@ -358,7 +358,7 @@ public class QrCodeUtil {
*/
public static BufferedImage generate(String content, BarcodeFormat format, QrConfig config) {
final BitMatrix bitMatrix = encode(content, format, config);
final BufferedImage image = toImage(bitMatrix, config.foreColor != null ? config.foreColor : 0xFF000000, config.backColor);
final BufferedImage image = toImage(bitMatrix, config.foreColor != null ? config.foreColor : Color.BLACK.getRGB(), config.backColor);
final Image logoImg = config.img;
if (null != logoImg && BarcodeFormat.QR_CODE == format) {
// 只有二维码可以贴图