mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #363] question: <The picture shows the wrong scale> #287
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#287
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Robinhao2k on GitHub (Dec 27, 2021).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/363
Question
Hello Sir,
I am using VC2019 to test the "xlsxwriter" library. I compiled the example project and executed the example program "images.exe". The program produced the "images.xlsx" file. When I opened the "images.xlsx" file with Excel 2019, I found There is a problem with the display ratio of the picture in the file. For example, the first picture does not have a zoom ratio set in the program, but it displays 90% width and 110% height in excel. What is the problem?
I am using VC2019 X64, Windows 10 and Excel 2019.
It is the example code and the xlsx file:

images.zip
In addition, the font used in Excel is Chinese Song Ti. Maybe it's an error caused by the font?

thank you very much
@jmcnamara commented on GitHub (Dec 27, 2021):
That is probably the issue. The scaling calculations for images are based on the font Calibri and size 11.
How are you changing the default font to Song Ti?
@Robinhao2k commented on GitHub (Dec 27, 2021):
Thank you for your reply.

My operating system is Chinese Simplified Windows operating system. So I guess the default font of Excel is Chinese Song Ti. I set the default font to Calibri, size 11.
then open "images.xlsx" again, but Chinese Song Ti is still the default font.

when I create a new xlsx document, Excel uses Calibri as the default font.

How can I use Calibri font as the default font to open images.xlsx document?
@jmcnamara commented on GitHub (Dec 28, 2021):
Transferred issue to the libxlsxwriter Github.
@jmcnamara commented on GitHub (Dec 29, 2021):
Probably there is some other system setting where the default font is set. Setting the default font in Excel won't change the font when you are reading files.
Can you try with this test file created in Excel and see if you get the same behaviour: https://github.com/jmcnamara/libxlsxwriter/blob/main/test/functional/xlsx_files/image10.xlsx
@jmcnamara commented on GitHub (Jan 3, 2022):
Any update on this?
@Robinhao2k commented on GitHub (Jan 4, 2022):
Sorry, I haven't noticed your reply these days. I tested your file. It seems that there is still the same problem. Please see my screen copy. Note, this time I am using the Chinese version of Excel.

.
@jmcnamara commented on GitHub (Jan 4, 2022):
That file was created in Excel. So this issue isn't related to libxlsxwriter (which produces the same file and dimensions as Excel).
I don't any good suggestions on how to deal with this:
Any way this isn't a libxlsxwriter issue. Libxlsxwriter has a lot of code and tests to ensure that it inserts images in exactly the same way as Excel.
So, since I cannot help you any further I will close this issue.