mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #388] image_buffer error in version 1.1.5 #310
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#310
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 @slw287r on GitHub (Jan 3, 2023).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/388
Originally assigned to: @jmcnamara on GitHub.
I encountered the follow warning and failed to insert cairo picture from memory on CentOS Linux:
I switched on and off of
USE_MEM_FILEand got the same error.It worked on macOS for version 1.1.5 and CentOS Linux for version 1.1.3 (1.1.4 not tested).
My demo scripts (a.c):
Compile and run:
Normal foo.xlsx
@jmcnamara commented on GitHub (Jan 3, 2023):
What is the issue? The image is in the file you attached and I compiled and confirmed that it works with libxlsxwriter version 1.1.5 on Ubuntu 22.04.
@slw287r commented on GitHub (Jan 3, 2023):
I uploaded the normal xlsx from version 1.1.3 above. Please find the abnormal xlsx without the intended image generated via version 1.1.5 below.
My OS info:
Linux 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
foo_bad.xlsx
@jmcnamara commented on GitHub (Jan 3, 2023):
Could you add this this debug code to your example and run it on the system/version where is doesn't work as expected.
You should get ouput like this:
@slw287r commented on GitHub (Jan 3, 2023):
Here is what I get:
and for v1.1.3, no warning and normal xlsx:
@jmcnamara commented on GitHub (Jan 3, 2023):
Thanks. In the 1.1.5 example are you using
USE_MEM_FILE=ON?@slw287r commented on GitHub (Jan 3, 2023):
@jmcnamara commented on GitHub (Jan 3, 2023):
@mohd-akram could you have a look at this issue. I can't reproduce it on the mac or Ubuntu systems that I have but I suspect that the issue may be the
rewind()below similar to issues you fixed in the second part of your patchset:https://github.com/jmcnamara/libxlsxwriter/blob/main/src/worksheet.c#L10396
That
[WARNING]occurs when the library can't read any image markers in the data but the "PNG" marker is clearly there so I suspect the stream isn't being rewound.@mohd-akram commented on GitHub (Jan 3, 2023):
This is a bit of a strange issue. The image buffer code wasn't really touched since it already used buffers. The CentOS version is quite old and I suspect it might be a glibc issue. Can you print what's the glibc version (
ldd --version)? Also, try with version 1.1.3 and theUSE_FMEMOPENoption set to on, I suspect it didn't work then either.@mohd-akram commented on GitHub (Jan 3, 2023):
Tried this in a
centos:7podman container (glibc 2.17).@jmcnamara Seems to be the bug mentioned here under notes. Changing
w+btowb+removes the warning for me (I haven't tried opening the XLSX file). This will also need to be changed inworksheet_set_background_buffer.@slw287r Try making that change and see if it works for you.
@jmcnamara commented on GitHub (Jan 3, 2023):
@mohd-akram Thanks. Nice detective work.
@slw287r commented on GitHub (Jan 4, 2023):
wb+works for me@jmcnamara commented on GitHub (Jan 4, 2023):
@slw287r Thanks for the test/report. Fixed on main.
Closing.