We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Description
Picture counting problem makes two sheets have the same picture.
Steps to reproduce the issue:
func TestDeletePictureBug(t *testing.T) { f, err := excelize.OpenFile(filepath.Join("test", "Book1.xlsx")) assert.NoError(t, err) // f.countDrawings = 1, pkg: drawing1.xml, drawings: nil assert.NoError(t, f.DeletePicture("Sheet1", "A1")) // f.countDrawings = 2, pkg: (drawing1.xml, sheet1), drawings: (drawing1.xml, sheet1) f.NewSheet("Sheet3") assert.NoError(t, f.AddPicture("Sheet3", "P1", filepath.Join("test", "images", "excel.jpg"), "")) // f.countDrawings = 3, pkg: (drawing1.xml, sheet1), drawings: (drawing1.xml, sheet1), (drawing3.xml, sheet3) assert.NoError(t, f.AddPicture("Sheet2", "P1", filepath.Join("test", "images", "excel.jpg"), "")) // f.countDrawings = 4, pkg: (drawing1.xml, sheet1), drawings: (drawing1.xml, sheet1), (drawing3.xml, sheet3), (drawing4.xml, sheet2) assert.NoError(t, f.DeletePicture("Sheet2", "P1")) f.DeleteSheet("Sheet1") assert.NoError(t, f.SaveAs(filepath.Join("test", "TestDeletePicture1.xlsx"))) f, err = excelize.OpenFile(filepath.Join("test", "TestDeletePicture1.xlsx")) assert.NoError(t, err) // f.countDrawings = 3, pkg: (drawing1.xml, sheet1),(drawing3.xml, sheet3), (drawing4.xml, sheet2), drawings: nil f.NewSheet("Sheet1") assert.NoError(t, f.AddPicture("Sheet1", "H1", filepath.Join("test", "images", "pic.jpg"), `{"x_scale": 0.5, "y_scale": 0.5}`)) // f.countDrawings = 4, pkg: (drawing1.xml, sheet1),(drawing3.xml, sheet3), (drawing4.xml, sheet2), drawings: (drawing4.xml, sheet1) assert.NoError(t, f.SaveAs(filepath.Join("test", "TestDeletePicture2.xlsx"))) // sheet1 and sheet2 all have pic.jpg ! }
Describe the results you received: sheet1 and sheet2 all have pic.jpg
Describe the results you expected: only sheet2 has pic.jpg
Output of go version:
go version
go1.18.3 windows/amd64
Excelize version or commit ID:
v2.6.1
Environment details (OS, Microsoft Excel™ version, physical, etc.):
The text was updated successfully, but these errors were encountered:
Book1.xlsx and excel.jpg are under excelize's path "test" and "test/images"
Sorry, something went wrong.
c071395
Thanks for your feedback. I have made a fix for this issue, please upgrade to the master branch code.
This closes qax-os#1404, fixes the insert picture problem in some cases
1be0889
- Updates unit tests - Updates documentation for stream mode functions - Updates hyperlinks in the documentation
8b46b7d
No branches or pull requests
Description
Picture counting problem makes two sheets have the same picture.
Steps to reproduce the issue:
Describe the results you received:
sheet1 and sheet2 all have pic.jpg
Describe the results you expected:
only sheet2 has pic.jpg
Output of
go version
:Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, physical, etc.):
The text was updated successfully, but these errors were encountered: