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

Added picture is taking the whole sheet/view #1902

Closed
kirqe opened this issue May 20, 2024 · 2 comments
Closed

Added picture is taking the whole sheet/view #1902

kirqe opened this issue May 20, 2024 · 2 comments
Labels
needs more info This issue can't reproduce, need more info

Comments

@kirqe
Copy link

kirqe commented May 20, 2024

Description

I generate an qr with https://github.com/yeqown/go-qrcode and place it into a cell. I have tried scaling options, changing format etc
I'm getting the following result in the preview app. The whole screen is taken by the qr.

When I create a normal screenshot and place it into a cell there're no issues

Is this the bug of this package or go-qrcode?

Steps to reproduce the issue:

  1. Generate a qr
	f := fmt.Sprintf("%s/%s.png", directory, filename)

	w, _ := standard.New(f, standard.WithBuiltinImageEncoder(standard.PNG_FORMAT))


	if err = qrc.Save(w); err != nil {
		log.Fatal("error saving qr: %v", err)
	}
  1. Try to add it to some sheet with the default examples
		enable, disable := true, false
		if err := f.AddPicture("Sheet1", "A2", "sample3.png",
			&excelize.GraphicOptions{
				PrintObject:     &enable,
				LockAspectRatio: false,
				OffsetX:         15,
				OffsetY:         10,
				Locked:          &disable,
			}); err != nil {
			fmt.Println(err)
			return
		}

Describe the results you received:

I add only 1 picture!

image
image

Output of go version:

go version go1.22.3 darwin/arm64

Excelize version or commit ID:

	github.com/xuri/excelize/v2 v2.8.1
	github.com/yeqown/go-qrcode/v2 v2.2.4
	github.com/yeqown/go-qrcode/writer/standard v1.2.3
@kirqe kirqe changed the title Added pictures is taking the whole sheet/view Added picture is taking the whole sheet/view May 20, 2024
@xuri
Copy link
Member

xuri commented May 21, 2024

Thanks for your issue. Could you show us a complete, standalone example program or reproducible demo? If you open an existing workbook, please provide the file attachment without confidential info.

@xuri xuri added the needs more info This issue can't reproduce, need more info label May 21, 2024
@kirqe
Copy link
Author

kirqe commented May 21, 2024

@xuri I figured that the qr spread to the right because I updated widths after placing the image
The problem is still there for vertical axis
https://github.com/kirqe/issue-demo

Sorry if the way I map rows and add styles is incorrect :D

--

Looks like images need to be added after the loop
Same for the styles and height
I feel embarrassed :D

@kirqe kirqe closed this as completed May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info This issue can't reproduce, need more info
Projects
None yet
Development

No branches or pull requests

2 participants