diff --git a/src/lib/code39barcode.cpp b/src/lib/code39barcode.cpp --- a/src/lib/code39barcode.cpp +++ b/src/lib/code39barcode.cpp @@ -142,6 +142,7 @@ // then maximize narrow bar width int smallWidth = (w - largeWidth*wide) / narrow; // if the requested size was too small return a null image + setMinimumSize(QSize(2* wide + narrow, 10)); if(largeWidth<2) { return QImage(); } diff --git a/src/lib/code93barcode.cpp b/src/lib/code93barcode.cpp --- a/src/lib/code93barcode.cpp +++ b/src/lib/code93barcode.cpp @@ -291,6 +291,7 @@ // try to fill the requested size const int barWidth = int(size.width() / barcode.size()); + setMinimumSize(QSize(barcode.size(), 10)); if(barWidth < 1 ) { // can't go below 1 pixel return QImage(); }