Closed N0cynym closed 5 months ago
Ok I found this commit https://github.com/INTI-CMNB/KiBot/commit/1dea3970bc063340d17251ecc8a11e860fb51f31 and will test to scale my logo.
So I could not work out how the scaling is working correctly.
logo_scale: -10
removes my png
Which logo is used in default?
Hi @N0cynym !
So I could not work out how the scaling is working correctly.
logo_scale: -10
removes my png
What do you expect using a negative scale? How does your logo look using the default scale (2)? Too big? Use 1 or less than 1. Too small? Use more than 2.
But note that (as documented) not all spreadsheet software applies the scale. Also note that the size you get is dependent on the spreadsheet. So you must experiment it for the software you use.
Which logo is used in default?
The KiBot logo, a 370x200 PNG embedded in the code.
About adding support for SVG: This can be done, but for this KiBot must convert the image to PNG, I don't see any advantage of doing this inside KiBot.
If I use the scale >1 the logo is to big.
A negative scale will remove the logo.
Trying a positive scale <1 and >0 give me:
ERROR:In section 'bom_xlsx' (bom): Option
logo_scalemust be a number not
string(kibot - error.py:40)
Are you using .
as decimal separator?
I modified the XLSX test 7 like this:
# Example KiBot config file
kibot:
version: 1
outputs:
- name: 'bom_internal'
comment: "Bill of Materials in HTML format"
type: bom
dir: BoM
options:
format: XLSX
xlsx:
logo: docs/images/bot.png
logo_scale: 0.1
col_colors: false
And worked perfectly, I got it scaled to a good size, the original PNG looks huge.
Thanks for your look into it.
It's working and my fault was logo_scale: '0,5'
Could you make a note into the README.md what the default size/resolution is of the used logo? This will help if you want to use your own logo.
Question: So it's impossible to embed a svg vector graphics in html and xlsx formats?
Hi @N0cynym !
YAML numbers use a point as decimal separator, like in most programming languages this isn't affected by the user locale. Also note that using quotes you are converting it to a string.
About the default: is already documented:
logo_scale
: [number=2] Scaling factor for the logo. Note that this value isn't honored by all spreadsheet software.Here the docs says the value must be a number, and its default is 2.
About SVG: For the HTML could be possible, but not for the XLSX. I don't see much advantage in doing it for the HTML, in particular knowing that SVGs are problematic.
What KiBot could do is convert the SVG to PNG, but this is really low priority. I always wanted to create an output to convert image formats, so it could help in the future
Ok thank you very much! 👍
I'll have a look into it if I see that a new feature is availible.
Ok, the above patch adds support for SVGs. Is a good starting point, please report any issue.
Is your feature request related to a problem? Please describe.
ERROR:In section 'bom_html' (bom): Only PNG images are supported for the logo (kibot - error.py:40)
Describe the solution you'd like Supporting vector graphics as logo in bill of materials.
Describe alternatives you've considered Automatic sizing of high resolution png.
I have a 1043x919 px png and use
convert
to resize it. The problem here is that it looks bad after resize.Additional context I do currently create one PCB documentation with
pdfunite
and export my generated xlsx spreadsheet withsoffice
. Unfortunately just png is supported which is let the logo look not so nice compared to the rest of thebom
. It's just a request if this is possible.