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

DeletePicture not work #2059

Closed
jingc1413 opened this issue Dec 31, 2024 · 2 comments
Closed

DeletePicture not work #2059

jingc1413 opened this issue Dec 31, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jingc1413
Copy link

jingc1413 commented Dec 31, 2024

Description

Steps to reproduce the issue:

func main() {
	{
		f, err := excelize.OpenFile("delete-pic.xlsx")
		if err != nil {
			return
		}
		cells, err := f.GetPictureCells("Sheet1")
		if err != nil {
			return
		}
		for _, cell := range cells {
			fmt.Println(cell)
			err = f.DeletePicture("Sheet1", cell)
			if err != nil {
				fmt.Println(err)
			}
		}
		f.SaveAs("new.xlsx")
	}
}

goland output result:
image

delete-pic.xlsx pic:
image

new file pic:
image

Describe the results you received:

Describe the results you expected:
delete the image correctly
Output of go version:
1.20.14

(paste your output here)

Excelize version or commit ID:

(paste here)

Environment details (OS, Microsoft Excel™ version, physical, etc.):

@jingc1413
Copy link
Author

delete-pic.xlsx

@xuri xuri added the bug Something isn't working label Jan 1, 2025
@xuri xuri moved this to Bugfix in Excelize v2.9.1 Jan 1, 2025
@xuri xuri added the in progress Working in progress label Jan 1, 2025
@xuri xuri closed this as completed in caf22e4 Jan 1, 2025
@xuri
Copy link
Member

xuri commented Jan 2, 2025

Thanks for your issue. I fixed it, please upgrade to the master branch code by following command, this patch will be released on the next version.

go get -u github.com/xuri/excelize/v2@master

@xuri xuri removed the in progress Working in progress label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Bugfix
Development

No branches or pull requests

2 participants