Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File corrupted after calling insertImage() #40

Open
mrstecklo opened this issue Jun 18, 2019 · 8 comments
Open

File corrupted after calling insertImage() #40

mrstecklo opened this issue Jun 18, 2019 · 8 comments

Comments

@mrstecklo
Copy link

Calling insertImage() or insertChart() leads to creating corrupted file. Microsoft Excel shows warning when trying to open file: "We found a problem with some content in 'filename.xlsx'. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes." Clicking 'Yes' results in an empty file.
dbzhang800's code works fine, except for QList/QVector thing in xlsxzipreader.cpp.

@VSRonin
Copy link
Owner

VSRonin commented Jun 18, 2019

Very strange, we made no change to the code that handles images from the original library. Can you share a minimal example to reproduce the problem?

@mrstecklo
Copy link
Author

This example shows, that insertImage() works fine with original library. But insertChart() doesn't work with both yours and dbzhang800's.
qtxlsx-example.zip

@mrstecklo
Copy link
Author

You need to actually put some "Logo.jpeg" to the build directory

@ChristopheBeugnetSC
Copy link

First, thanks for the lib. It's a much better solution than make my app generate a python script depending on pyExcelerator !

But ...

I have the same problem: as soon as there is an image in a generated .xlsx file, Excel complains. In a multi sheet document, pure text sheets are OK, but sheets containing image(s) are ending blank.

I can provide you with the .xlsx file, but I don't want to make it public. I could remove the sensitive information, but I don't want to alter the file. Is it possible on a private channel ?

I'm developing under Linux for a Linux colorimetry test bench. I made all my dev tests using LibreOffice under Linux, without any problem. But as soon as I tested in real conditions, which means sending the file to Windows users depending on Excel 2010, we encountered the problem.

At least, here is the "repair report" from Excel:

Réparer le résultat vers 2019.07.02-11h06m03.691--Colorimetrie--000000000000--Samsung--Galaxy Note 9 02520.zip

It's in French and it won't help a lot I'm afraid.

@liufeijin
Copy link

Very strange, we made no change to the code that handles images from the original library. Can you share a minimal example to reproduce the problem?

I remember this bug was resolved on
https://github.com/QtExcel/QXlsx
you can check the code and patch on your project.

@ChristopheBeugnetSC
Copy link

That was quick, thanks !

I did not realized I was using a outdated version. I thought I was using a fork or something. Strange.

Anyway, I'm about to check https://github.com/QtExcel/QXlsx and adapt my code if necessary. I will keep you updated.

@ChristopheBeugnetSC
Copy link

So far, so good. Many thanks again !
API is the same, no adjustment required.

I found a lot of warnings though. I could propose a correction. But I'm not familiar with GitHub and how to push code. Is there a tutorial that explain how I can push, or send a patch or something ? (before I google that myself ... No time right now, sorry)

@VSRonin
Copy link
Owner

VSRonin commented Jul 4, 2019

https://github.com/QtExcel/QXlsx is not a fork to this project. The initial design of this library, however, makes it almost impossible to develop advanced functionality. My suggestion would be to abandon this library and move on to the one actively developed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants