-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
If you insert into two or more images of multiple sheets, the images will be pasted in duplicate. #373
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
Comments
Hi @GinSanaduki, thanks for your issue. I have tested based on your code and it works well. Which version of Excelize and Go are you using? |
Hi @xuri , thanks for the reply. |
I see something similar with comments on package main
import "github.com/360EntSecGroup-Skylar/excelize"
func main() {
xlsx := excelize.NewFile()
xlsx.NewSheet("Sheet2")
err := xlsx.AddComment("Sheet1", "A1", `{"author":"Me:","text":"Comment"}`)
if err != nil {
panic(err)
}
err = xlsx.AddComment("Sheet2", "A2", `{"author":"Me:","text":"Comment"}`)
if err != nil {
panic(err)
}
err = xlsx.SaveAs("./Test.xlsx")
if err != nil {
panic(err)
}
} |
I did not know that the same event would occur even with the addition of comments...thank you for providing the information. |
Hi @nateglims @GinSanaduki, I have fixed it, but the issues of duplicate images haven't been confirmed yet. |
Just in case, I put the reproduction file of those days. |
It did not occur with modified sources. |
Uh oh!
There was an error while loading. Please reload this page.
Create a new Excel file, insert an image into one cell of one sheet, create another sheet, insert another image into one cell of another sheet, as the result, causes a event that pasted two images on both cells of both sheets.
It doesn't occur when you finish inserted an image into one cell of a sheet, or inserted images into two or more cells of the same sheet.
When I extracted the Excel file and saw it, the value of the name held inside of drawing1.xml was the same (Picture 1), so it is considered to be due to that.
If SaveAS is executed first and then reopened and the image is executed only after Save is executed, the stored information will disappear or it will operate normally.
Of course, there is no problem if you insert image1.jpg into one cell of one sheet, execute SaveAS, reopen it, and insert image2.jpg into another cell of another sheet.
When this is executed, Book1.xlsx is generated in which image1.jpg is inserted into only A2 cell of sheet 1 and image2.jpg is inserted into only A20 cell of sheet 2.
The text was updated successfully, but these errors were encountered: