#8 CMYK PDF generation fails with fedora-horizontal and fedora-vertical
Opened 4 years ago by salimma. Modified 3 days ago

Discovered this when writing automated tests. Fails with v2.2.1 in updates-testing as well as the current master.

❯ fedora-business-cards --cmyk-pdf fedora-vertical
Login to FAS:
Username: salimma
Password: 
Current business card layout:
Vertical cards don't hold much data ...:
   +-------------------------------------+
 n | Michel Alexandre Salim              |
 t | Fedora Project Contributor          |
   |                                     |
 0 | salimma@fedoraproject.org           |
 1 | fedoraproject.org                   |
 2 | michel-slm on irc.freenode.net      |
 3 |                                     |
 4 |                                     |
   +-------------------------------------+
Enter a line number to edit, or [y] to accept: y
Generating front...
Traceback (most recent call last):
  File "/usr/bin/fedora-business-cards", line 11, in <module>
    load_entry_point('fedora-business-cards==2.2', 'console_scripts', 'fedora-business-cards')()
  File "/usr/lib/python3.8/site-packages/fedora_business_cards/frontend/cmdline.py", line 114, in main
    export.svg_to_cmyk_pdf(xml, 'front.pdf', options.height, options.width,
  File "/usr/lib/python3.8/site-packages/fedora_business_cards/export.py", line 109, in svg_to_cmyk_pdf
    eps = eps_cmyk_convert(epsfilename, converter)
  File "/usr/lib/python3.8/site-packages/fedora_business_cards/export.py", line 161, in eps_cmyk_convert
    rgb = tuple([int(x) for x in (red, green, blue)])
  File "/usr/lib/python3.8/site-packages/fedora_business_cards/export.py", line 161, in <listcomp>
    rgb = tuple([int(x) for x in (red, green, blue)])
ValueError: invalid literal for int() with base 10: '0.298096'

https://pagure.io/fork/salimma/fedora-business-cards/tree/fix-cmyk has the fix but waiting for #7 to be merged before opening a PR, since it also modifies the test code to reenable cmyk_pdf output testing.

This is not occurring on my F31 box. I wonder if we are missing a dependency? I also can't reproduce it in an F32 container (assuming you were on F32). What is your OS version?

Metadata Update from @bex:
- Issue assigned to salimma

4 years ago

That's on my Fedora 32 box. Let me double check on another machine (and also verify that the stable version is also affected, not just my modified version - I'm pretty sure it was, on my machine anyway)

@bex Replicated on a new machine where I have not messed with this source code. Note, it only affects the fedora-horizontal and fedora-vertical generators - the default fedora one is fine. I'll update the summary.

~
❯ rpm -q fedora-business-cards
fedora-business-cards-2.2.1-1.fc32.noarch

~
❯ cat /etc/fedora-release
Fedora release 32 (Thirty Two)

❯ fedora-business-cards --cmyk-pdf fedora-vertical       
Login to FAS:
Username: salimma
Password: 

Current business card layout:
Vertical cards don't hold much data ...:
   +-------------------------------------+
 n | Michel Alexandre Salim              |
 t | Fedora Project Contributor          |
   |                                     |
 0 | salimma@fedoraproject.org           |
 1 | fedoraproject.org                   |
 2 | michel-slm on irc.freenode.net      |
 3 |                                     |
 4 |                                     |
   +-------------------------------------+
Enter a line number to edit, or [y] to accept: Generating front...
Traceback (most recent call last):
  File "/usr/bin/fedora-business-cards", line 11, in <module>
    load_entry_point('fedora-business-cards==2.2', 'console_scripts', 'fedora-business-cards')()
  File "/usr/lib/python3.8/site-packages/fedora_business_cards/frontend/cmdline.py", line 114, in main
    export.svg_to_cmyk_pdf(xml, 'front.pdf', options.height, options.width,
  File "/usr/lib/python3.8/site-packages/fedora_business_cards/export.py", line 109, in svg_to_cmyk_pdf
    eps = eps_cmyk_convert(epsfilename, converter)
  File "/usr/lib/python3.8/site-packages/fedora_business_cards/export.py", line 161, in eps_cmyk_convert
    rgb = tuple([int(x) for x in (red, green, blue)])
  File "/usr/lib/python3.8/site-packages/fedora_business_cards/export.py", line 161, in <listcomp>
    rgb = tuple([int(x) for x in (red, green, blue)])
ValueError: invalid literal for int() with base 10: '0.298096'

Out of curiosity, I checked if this is just because with my username there's too much info to fit for the vertical generator. Fails with bex as well:

~
❯ fedora-business-cards --cmyk-pdf fedora-vertical -u bex
Login to FAS:
Username: salimma
Password: 
Current business card layout:
Vertical cards don't hold much data ...:
   +-------------------------------------+
 n | Brian (bex) Exelbierd               |
 t | Fedora Project Contributor          |
   |                                     |
 0 | bex@fedoraproject.org               |
 1 | fedoraproject.org                   |
 2 | bexelbie on irc.freenode.net        |
 3 |                                     |
 4 |                                     |
   +-------------------------------------+
Enter a line number to edit, or [y] to accept: y
Generating front...
Traceback (most recent call last):
  File "/usr/bin/fedora-business-cards", line 11, in <module>
    load_entry_point('fedora-business-cards==2.2', 'console_scripts', 'fedora-business-cards')()
  File "/usr/lib/python3.8/site-packages/fedora_business_cards/frontend/cmdline.py", line 114, in main
    export.svg_to_cmyk_pdf(xml, 'front.pdf', options.height, options.width,
  File "/usr/lib/python3.8/site-packages/fedora_business_cards/export.py", line 109, in svg_to_cmyk_pdf
    eps = eps_cmyk_convert(epsfilename, converter)
  File "/usr/lib/python3.8/site-packages/fedora_business_cards/export.py", line 161, in eps_cmyk_convert
    rgb = tuple([int(x) for x in (red, green, blue)])
  File "/usr/lib/python3.8/site-packages/fedora_business_cards/export.py", line 161, in <listcomp>
    rgb = tuple([int(x) for x in (red, green, blue)])
ValueError: invalid literal for int() with base 10: '0.298096'

OK, I got that replicated now too. I've done some reading and your fix looks good.

VN Video Supervisor Creator Backrooms Game VlogNow is a Video Players and Editors Application created by Ubiquiti Labs, LLC. For an immersive Android experience on your PC or Mac, BlueStacks app player is the best platform.

To create PDF files with CMYK color space on Fedora (or any Linux operating system), you can use tools like Scribus, Inkscape, Suika game or Ghostscript.

On Fedora (or any Linux operating system), you can use tools such as Scribus, Inkscape, or Ghostscript to create PDF files in the bitlife CMYK color space.

When it comes to gaming, cluster rush is at the top of its game with its innovative combination of rapid-fire action and strategic difficulties. Players will face increasingly difficult groupings of enemies as they go deeper into this fascinating realm.

moto x3m is an exciting online motorcycle racing game that challenges players to complete various obstacle courses with precision and speed. Players can perform stunts and tricks while navigating through different levels, each filled with unique challenges and hazards.

basket random's vibrant, randomized characters and erratic match dynamics provide a distinctive take on basketball. Playing alone or with company, it ensures a humorous and enjoyable experience, making it perfect for casual players.

Slope Game requires you to pay attention to every little detail. Observing changes in your surroundings will help you be better prepared for unexpected situations.

Log in to comment on this ticket.

Metadata