excelize icon indicating copy to clipboard operation
excelize copied to clipboard

Added picture is taking the whole sheet/view

Open kirqe opened this issue 9 months ago • 2 comments

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 avatar May 20 '24 22:05 kirqe