Bug 10762 - Make it possible to adjust the barcode height and width on labels
Summary: Make it possible to adjust the barcode height and width on labels
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Thibaud Guillot
QA Contact: Katrin Fischer
URL:
Keywords: release-notes-needed
: 14149 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-08-19 14:06 UTC by Jesse Maseto
Modified: 2024-01-04 16:10 UTC (History)
19 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
When creating a new layout for the label creator, you can now define the width and height for the printed barcode.
Version(s) released in:
23.11.00


Attachments
Bug 10762: Change the size of barcodes in label creator (13.53 KB, patch)
2021-11-17 13:21 UTC, Jérémy Breuillard
Details | Diff | Splinter Review
Bug 10762: Change the size of barcodes in label creator (13.57 KB, patch)
2022-05-06 17:09 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 10762: (follow-up) Update test plan, add kohastructure.sql files (2.08 KB, patch)
2023-01-02 14:11 UTC, Thibaud Guillot
Details | Diff | Splinter Review
Bug 10762: (follow-up) Add exec right on atomic update file (651 bytes, patch)
2023-01-03 12:35 UTC, Thibaud Guillot
Details | Diff | Splinter Review
Bug 10762: Change the size of barcodes in label creator (13.64 KB, patch)
2023-01-03 15:25 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 10762: (follow-up) Update test plan, add kohastructure.sql files (2.13 KB, patch)
2023-01-03 15:25 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 10762: (follow-up) Add exec right on atomic update file (707 bytes, patch)
2023-01-03 15:25 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 10762: Change the size of barcodes in label creator (13.63 KB, patch)
2023-08-16 10:10 UTC, Thibaud Guillot
Details | Diff | Splinter Review
Bug 10762: (follow-up) Update test plan, add kohastructure.sql files (2.13 KB, patch)
2023-08-16 10:10 UTC, Thibaud Guillot
Details | Diff | Splinter Review
Bug 10762: (follow-up) Add exec right on atomic update file (707 bytes, patch)
2023-08-16 10:10 UTC, Thibaud Guillot
Details | Diff | Splinter Review
Bug 10762: (follow-up) Add tests (1.72 KB, patch)
2023-08-16 10:10 UTC, Thibaud Guillot
Details | Diff | Splinter Review
Bug 10762: Change the size of barcodes in label creator (13.69 KB, patch)
2023-08-17 12:37 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 10762: (follow-up) Update test plan, add kohastructure.sql files (2.20 KB, patch)
2023-08-17 12:37 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 10762: (follow-up) Add exec right on atomic update file (775 bytes, patch)
2023-08-17 12:38 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 10762: (follow-up) Add tests (1.78 KB, patch)
2023-08-17 12:38 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 10762: Change the size of barcodes in label creator (13.75 KB, patch)
2023-10-14 21:42 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 10762: (follow-up) Update test plan, add kohastructure.sql files (2.25 KB, patch)
2023-10-14 21:42 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 10762: (follow-up) Add exec right on atomic update file (832 bytes, patch)
2023-10-14 21:42 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 10762: (follow-up) Add tests (1.86 KB, patch)
2023-10-14 21:42 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 10762: (QA follow-up) Perltidy (32.23 KB, patch)
2023-10-14 21:42 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 10762: Fix default values test (2.02 KB, patch)
2023-10-27 20:18 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 10762: Fix tests continued (3.11 KB, patch)
2023-10-28 13:03 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Maseto 2013-08-19 14:06:15 UTC
I created a new layout (section 2.5.3.1 in the manual) that just shows the barcode, and I set the font size big. First I did 14, then 32 just to make sure my eyes weren't deceiving me. The numbers below the barcode didn't change size!

It seems like the font settings only affect the bibliographic data. What I want to change is the barcode number itself.
Comment 1 Binu Thomas 2014-04-21 13:38:20 UTC
Hello,

Is this issue confirmed as a bug. We are also facing this issue in Koha 3.14.05.? Any timeline of getting this resolved? Is anyone working on this?

Regards,

Binu
Comment 2 Binu Thomas 2014-04-21 13:39:22 UTC
Hello,

Is this issue confirmed as a bug. We are also facing this issue in Koha 3.14.05.? Any timeline of getting this resolved? Is anyone working on this?

Regards,

Binu
Comment 3 Bernardo Gonzalez Kriegel 2014-05-02 00:06:59 UTC
Currently generated barcodes are images produced using GD::Barcode.
It's not possible to set font size for numbers.
Comment 4 Rajeshwari Nair 2015-07-17 06:45:03 UTC
Hi,

It is true that the options to change the size of the barcode is non functional. 

However, while exporting the batch if you choose 'spine label' in the 'Template' option and Barcode in the 'layout' option the size of the barcode increases. But this disturbs the printing set up if you are using specific labels for printing the barcodes. 

-Rajeshwari
Comment 5 Marc Véron 2016-06-13 12:44:08 UTC
I fixed it for patron cards, there could be a similar solution for labels, but there is som more work necessary.

Bug 14107 - Patron cards: Make barcode width and height scaling editable
See also comment #1 on Bug 14149 - Labels: Make barcode width and height scaling editable
Comment 6 Marjorie Barry-Vila 2021-06-08 18:14:43 UTC
Still valid on 20.05

Marjorie
Comment 7 Jérémy Breuillard 2021-11-17 13:21:09 UTC
Created attachment 127729 [details] [review]
Bug 10762: Change the size of barcodes in label creator

Test plan:
1)Home > Tools > Label creator > Manage Layout or New Layout
2)Make a new layout or edit an existing one
3)Notice the 2 new fields "Barcode width/Barcode height"
4)Save it like this
5)Create a batch of barcode and export if in PDF
6)Notice the size of barcode
7)Go back to your existing layout
8)Enter some values (Barcode width: 1.6 / Barcode height: 0.04), save
9)Take back your batch of barcode and export it in PDF
10)The barcode should be 2x bigger
Comment 8 Owen Leonard 2022-05-06 17:09:45 UTC
Created attachment 134754 [details] [review]
Bug 10762: Change the size of barcodes in label creator

Test plan:
1)Home > Tools > Label creator > Manage Layout or New Layout
2)Make a new layout or edit an existing one
3)Notice the 2 new fields "Barcode width/Barcode height"
4)Save it like this
5)Create a batch of barcode and export if in PDF
6)Notice the size of barcode
7)Go back to your existing layout
8)Enter some values (Barcode width: 1.6 / Barcode height: 0.04), save
9)Take back your batch of barcode and export it in PDF
10)The barcode should be 2x bigger

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 9 Marcel de Rooy 2022-05-13 09:39:13 UTC
Please submit reports under your own name. Change assignee field.
Comment 10 Katrin Fischer 2022-05-13 09:59:19 UTC
(In reply to Marcel de Rooy from comment #9)
> Please submit reports under your own name. Change assignee field.

I changed the assignee.
Comment 11 Jonathan Druart 2022-05-18 13:08:19 UTC
+            scale_height    =>      0.02,

Not 0.01 here?
Comment 12 Katrin Fischer 2022-05-20 09:35:00 UTC
I believe this actually fixes something different than originally reported.

This makes it possible to pick the size of the barcode, the original was a bug saying that the font size was not taken into account for the barcode number shown below the barcode.

I've filed a new bug and reset this as enh, because it's a nice new feature now.

Bug 30819 - Not able to adjust size of barcode numbers
Comment 13 Katrin Fischer 2022-05-20 09:44:07 UTC
1) QA test tools:

 FAIL	installer/data/mysql/atomicupdate/update-BZ_10762.pl
   FAIL	  file permissions
		File must have the exec flag

2) See comment#11, it looks like the original value was 0.01:

+            scale_height    =>      0.02,

-    my $barcode_y_scale_factor = 0.01 * $self->{'height'};              # this scales the barcode height to 10% of the label height

3) Defaults

Just a question, maybe someone else can answer that one too:

The patch adds the 2 new database columns with defaults 0.02 and 0.8 in the database and also sets the defaults in new. 

Should we do both or would one option suffice?

4) Changes to kohastructure.sql are missing
Comment 14 Caroline Cyr La Rose 2022-10-03 15:59:49 UTC
*** Bug 14149 has been marked as a duplicate of this bug. ***
Comment 15 Thibaud Guillot 2023-01-02 14:11:00 UTC
Created attachment 144900 [details] [review]
Bug 10762: (follow-up) Update test plan, add kohastructure.sql files

I also change the default value for scale_height to '0.01'

Test plan:

1)Home > Cataloguing > Tools: Label creator > Manage Layout or New Layout
2)Make a new layout or edit an existing one
3)Notice the 2 new fields "Barcode width/Barcode height"
4)Save it like this
5)Create a batch of barcode and export if in PDF
6)Notice the size of barcode
7)Go back to your existing layout
8)Enter some values (Barcode width: 1.6 / Barcode height: 0.02), save
9)Take back your batch of barcode and export it in PDF
10)The barcode should be 2x bigger
Comment 16 Thibaud Guillot 2023-01-02 14:15:01 UTC
(In reply to Katrin Fischer from comment #13)
> 1) QA test tools:
> 
>  FAIL	installer/data/mysql/atomicupdate/update-BZ_10762.pl
>    FAIL	  file permissions
> 		File must have the exec flag
> 
> 2) See comment#11, it looks like the original value was 0.01:
> 
> +            scale_height    =>      0.02,
> 
> -    my $barcode_y_scale_factor = 0.01 * $self->{'height'};              #
> this scales the barcode height to 10% of the label height
> 
> 3) Defaults
> 
> Just a question, maybe someone else can answer that one too:
> 
> The patch adds the 2 new database columns with defaults 0.02 and 0.8 in the
> database and also sets the defaults in new. 
> 
> Should we do both or would one option suffice?
> 
> 4) Changes to kohastructure.sql are missing

Hello Katrin,

Normally I fixed this things on my last 'push'

For default value (repeat in sql and view on 'sub new()' I'm not an expert but it like the same than 'layout_name' for example (set to 'DEFAULT' in default sql value and also in the template when we passed vars).

I hope this will be okay for everyone :)
Comment 17 Thibaud Guillot 2023-01-03 12:35:38 UTC
Created attachment 144933 [details] [review]
Bug 10762: (follow-up) Add exec right on atomic update file

https://bugs.koha-community.org/show_bug.cgi?id=17062
Comment 18 Thibaud Guillot 2023-01-03 12:37:23 UTC
I forgot this file, fixed and push
Comment 19 Lucas Gass 2023-01-03 15:25:09 UTC
Created attachment 144939 [details] [review]
Bug 10762: Change the size of barcodes in label creator

Test plan:
1)Home > Tools > Label creator > Manage Layout or New Layout
2)Make a new layout or edit an existing one
3)Notice the 2 new fields "Barcode width/Barcode height"
4)Save it like this
5)Create a batch of barcode and export if in PDF
6)Notice the size of barcode
7)Go back to your existing layout
8)Enter some values (Barcode width: 1.6 / Barcode height: 0.04), save
9)Take back your batch of barcode and export it in PDF
10)The barcode should be 2x bigger

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 20 Lucas Gass 2023-01-03 15:25:15 UTC
Created attachment 144940 [details] [review]
Bug 10762: (follow-up) Update test plan, add kohastructure.sql files

I also change the default value for scale_height to '0.01'

Test plan:

1)Home > Cataloguing > Tools: Label creator > Manage Layout or New Layout
2)Make a new layout or edit an existing one
3)Notice the 2 new fields "Barcode width/Barcode height"
4)Save it like this
5)Create a batch of barcode and export if in PDF
6)Notice the size of barcode
7)Go back to your existing layout
8)Enter some values (Barcode width: 1.6 / Barcode height: 0.02), save
9)Take back your batch of barcode and export it in PDF
10)The barcode should be 2x bigger

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 21 Lucas Gass 2023-01-03 15:25:21 UTC
Created attachment 144941 [details] [review]
Bug 10762: (follow-up) Add exec right on atomic update file

https://bugs.koha-community.org/show_bug.cgi?id=17062

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 22 Marcel de Rooy 2023-02-24 09:49:45 UTC
First observation: Normally when we modify modules, we need to add unit tests. Unfortunately here I cant find any test yet for e.g. C4/Creators/Layout.pm.

You could do for C4::Labels::Label though.

Rest looks good to me.
Comment 23 Thibaud Guillot 2023-08-16 10:10:34 UTC
Created attachment 154456 [details] [review]
Bug 10762: Change the size of barcodes in label creator

Test plan:
1)Home > Tools > Label creator > Manage Layout or New Layout
2)Make a new layout or edit an existing one
3)Notice the 2 new fields "Barcode width/Barcode height"
4)Save it like this
5)Create a batch of barcode and export if in PDF
6)Notice the size of barcode
7)Go back to your existing layout
8)Enter some values (Barcode width: 1.6 / Barcode height: 0.04), save
9)Take back your batch of barcode and export it in PDF
10)The barcode should be 2x bigger

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 24 Thibaud Guillot 2023-08-16 10:10:40 UTC
Created attachment 154457 [details] [review]
Bug 10762: (follow-up) Update test plan, add kohastructure.sql files

I also change the default value for scale_height to '0.01'

Test plan:

1)Home > Cataloguing > Tools: Label creator > Manage Layout or New Layout
2)Make a new layout or edit an existing one
3)Notice the 2 new fields "Barcode width/Barcode height"
4)Save it like this
5)Create a batch of barcode and export if in PDF
6)Notice the size of barcode
7)Go back to your existing layout
8)Enter some values (Barcode width: 1.6 / Barcode height: 0.02), save
9)Take back your batch of barcode and export it in PDF
10)The barcode should be 2x bigger

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 25 Thibaud Guillot 2023-08-16 10:10:44 UTC
Created attachment 154458 [details] [review]
Bug 10762: (follow-up) Add exec right on atomic update file

https://bugs.koha-community.org/show_bug.cgi?id=17062

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 26 Thibaud Guillot 2023-08-16 10:10:49 UTC
Created attachment 154459 [details] [review]
Bug 10762: (follow-up) Add tests
Comment 27 Biblibre Sandboxes 2023-08-17 12:37:54 UTC
Created attachment 154559 [details] [review]
Bug 10762: Change the size of barcodes in label creator

Test plan:
1)Home > Tools > Label creator > Manage Layout or New Layout
2)Make a new layout or edit an existing one
3)Notice the 2 new fields "Barcode width/Barcode height"
4)Save it like this
5)Create a batch of barcode and export if in PDF
6)Notice the size of barcode
7)Go back to your existing layout
8)Enter some values (Barcode width: 1.6 / Barcode height: 0.04), save
9)Take back your batch of barcode and export it in PDF
10)The barcode should be 2x bigger

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Johanna Miettunen <johanna.miettunen@haaga-helia.fi>
Comment 28 Biblibre Sandboxes 2023-08-17 12:37:57 UTC
Created attachment 154560 [details] [review]
Bug 10762: (follow-up) Update test plan, add kohastructure.sql files

I also change the default value for scale_height to '0.01'

Test plan:

1)Home > Cataloguing > Tools: Label creator > Manage Layout or New Layout
2)Make a new layout or edit an existing one
3)Notice the 2 new fields "Barcode width/Barcode height"
4)Save it like this
5)Create a batch of barcode and export if in PDF
6)Notice the size of barcode
7)Go back to your existing layout
8)Enter some values (Barcode width: 1.6 / Barcode height: 0.02), save
9)Take back your batch of barcode and export it in PDF
10)The barcode should be 2x bigger

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Johanna Miettunen <johanna.miettunen@haaga-helia.fi>
Comment 29 Biblibre Sandboxes 2023-08-17 12:38:01 UTC
Created attachment 154561 [details] [review]
Bug 10762: (follow-up) Add exec right on atomic update file

https://bugs.koha-community.org/show_bug.cgi?id=17062

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Johanna Miettunen <johanna.miettunen@haaga-helia.fi>
Comment 30 Biblibre Sandboxes 2023-08-17 12:38:04 UTC
Created attachment 154562 [details] [review]
Bug 10762: (follow-up) Add tests

Signed-off-by: Johanna Miettunen <johanna.miettunen@haaga-helia.fi>
Comment 31 Johanna Miettunen 2023-08-17 12:41:30 UTC
Worked as designed.
Comment 32 Johanna Miettunen 2023-08-17 12:50:57 UTC
Works as described.
Comment 33 Katrin Fischer 2023-10-14 21:42:09 UTC
Created attachment 157168 [details] [review]
Bug 10762: Change the size of barcodes in label creator

Test plan:
1)Home > Tools > Label creator > Manage Layout or New Layout
2)Make a new layout or edit an existing one
3)Notice the 2 new fields "Barcode width/Barcode height"
4)Save it like this
5)Create a batch of barcode and export if in PDF
6)Notice the size of barcode
7)Go back to your existing layout
8)Enter some values (Barcode width: 1.6 / Barcode height: 0.04), save
9)Take back your batch of barcode and export it in PDF
10)The barcode should be 2x bigger

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Johanna Miettunen <johanna.miettunen@haaga-helia.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 34 Katrin Fischer 2023-10-14 21:42:13 UTC
Created attachment 157169 [details] [review]
Bug 10762: (follow-up) Update test plan, add kohastructure.sql files

I also change the default value for scale_height to '0.01'

Test plan:

1)Home > Cataloguing > Tools: Label creator > Manage Layout or New Layout
2)Make a new layout or edit an existing one
3)Notice the 2 new fields "Barcode width/Barcode height"
4)Save it like this
5)Create a batch of barcode and export if in PDF
6)Notice the size of barcode
7)Go back to your existing layout
8)Enter some values (Barcode width: 1.6 / Barcode height: 0.02), save
9)Take back your batch of barcode and export it in PDF
10)The barcode should be 2x bigger

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Johanna Miettunen <johanna.miettunen@haaga-helia.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 35 Katrin Fischer 2023-10-14 21:42:17 UTC
Created attachment 157170 [details] [review]
Bug 10762: (follow-up) Add exec right on atomic update file

https://bugs.koha-community.org/show_bug.cgi?id=17062

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Johanna Miettunen <johanna.miettunen@haaga-helia.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 36 Katrin Fischer 2023-10-14 21:42:21 UTC
Created attachment 157171 [details] [review]
Bug 10762: (follow-up) Add tests

Signed-off-by: Johanna Miettunen <johanna.miettunen@haaga-helia.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 37 Katrin Fischer 2023-10-14 21:42:25 UTC
Created attachment 157172 [details] [review]
Bug 10762: (QA follow-up) Perltidy

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 38 Tomás Cohen Arazi 2023-10-25 13:36:07 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 39 Fridolin Somers 2023-10-26 07:57:21 UTC
Enhancement not pushed to 23.05.x
Comment 40 Tomás Cohen Arazi 2023-10-26 19:36:15 UTC
Hey, this broke tests. Please provide a fix ASAP.

https://jenkins.koha-community.org/job/Koha_Master/lastCompletedBuild/testReport/
Comment 41 Tomás Cohen Arazi 2023-10-27 20:11:00 UTC
Please fix the tests or I will need to revert this from master.
Comment 42 Tomás Cohen Arazi 2023-10-27 20:18:45 UTC
Created attachment 157999 [details] [review]
Bug 10762: Fix default values test

This patch adds the new default values to the data structure the result
is compared with.

It also fixes the tests count (probably an untested rebase issue)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 43 Tomás Cohen Arazi 2023-10-27 20:19:37 UTC
I fixed the first trivial case. One failing test remains.
Comment 44 Tomás Cohen Arazi 2023-10-28 13:03:09 UTC
Created attachment 158014 [details] [review]
Bug 10762: Fix tests continued

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 45 Tomás Cohen Arazi 2023-10-28 13:03:41 UTC
(In reply to Tomás Cohen Arazi from comment #43)
> I fixed the first trivial case. One failing test remains.

Done.
Comment 46 Katrin Fischer 2023-10-28 13:04:01 UTC
(In reply to Tomás Cohen Arazi from comment #45)
> (In reply to Tomás Cohen Arazi from comment #43)
> > I fixed the first trivial case. One failing test remains.
> 
> Done.

Thank you, Tomas!