You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the size of the image will change as the coordinates of the lower right corner point change.
When adjusting the row height and column width, the image will also adjust the height and width accordingly, and the ratio of the image will be affected
For example, the original image was in this scale:
After adjusting the row height of row 7 and the column width of column C, the proportions of the image are affected.
However, this phenomenon does not occur when using floating pictures inserted by Excel.
It looks like it's because the floating picture inserted by Excel has the attribute editAs="oneCell", adjusting the row width and column height will not affect the original width and height of the picture.
Probrem 2:
When I put a floating image on top of a collapsed row or column,
Floating images in files exported by Excelize will have the wrong display ratio:
It looks like it's because in the method of func (f *File) positionObjectPixels(sheet string, col, row, x1, y1, width, height int) (int, int, int, int, int, int) {}, when calculating colEnd, rowEnd, width, height, the folded rows and columns will also be calculated.
// Subtract the underlying cell widths to find end cell of the object.forwidth>=f.getColWidth(sheet, colEnd+1) {
colEnd++width-=f.getColWidth(sheet, colEnd)
}
// Subtract the underlying cell heights to find end cell of the object.aaa:=f.getRowHeight(sheet, rowEnd+1)
forheight>=aaa {
rowEnd++bbb:=f.getRowHeight(sheet, rowEnd)
height-=bbbaaa=f.getRowHeight(sheet, rowEnd+1)
}
As a result, when the file is actually opened, if rowEnd is in the folded row, the above image proportion problem will occur.
After unfolding, the display returns to normal. After resuming folding, the display will appear abnormal again.
Probrem 3:
Pictures exported using Excelize have problems with proportions even on rows and columns that are not folded. The original image is a square with the same width and height, but the proportion of the exported image has changed. The screenshots are compared as follows:
This problem may be that the width and height of each cell are inconsistent in files of different standards, which leads to problems in determining the size of the image based on the point in the lower right corner of the image.
Describe the results you received:
support editAs="oneCell" attribute
Output of go version:
1.22.6
Excelize version or commit ID:
v2.8.1
Environment details (OS, Microsoft Excel™ version, physical, etc.):
The text was updated successfully, but these errors were encountered:
Description
I found the following three problems when using excelize's floating picture function, hoped to add the attribute
editAs="oneCell"
Probrem 1:
Use the floating image in the table exported by Excelize, due to the twoCell format,
the size of the image will change as the coordinates of the lower right corner point change.
When adjusting the row height and column width, the image will also adjust the height and width accordingly, and the ratio of the image will be affected
For example, the original image was in this scale:
After adjusting the row height of row 7 and the column width of column C, the proportions of the image are affected.
However, this phenomenon does not occur when using floating pictures inserted by Excel.
It looks like it's because the floating picture inserted by Excel has the attribute
editAs="oneCell"
, adjusting the row width and column height will not affect the original width and height of the picture.Probrem 2:
When I put a floating image on top of a collapsed row or column,
Floating images in files exported by Excelize will have the wrong display ratio:
It looks like it's because in the method of
func (f *File) positionObjectPixels(sheet string, col, row, x1, y1, width, height int) (int, int, int, int, int, int) {}
, when calculatingcolEnd, rowEnd, width, height
, the folded rows and columns will also be calculated.As a result, when the file is actually opened, if
rowEnd
is in the folded row, the above image proportion problem will occur.After unfolding, the display returns to normal. After resuming folding, the display will appear abnormal again.
Probrem 3:
Pictures exported using Excelize have problems with proportions even on rows and columns that are not folded. The original image is a square with the same width and height, but the proportion of the exported image has changed. The screenshots are compared as follows:
This problem may be that the width and height of each cell are inconsistent in files of different standards, which leads to problems in determining the size of the image based on the point in the lower right corner of the image.
Describe the results you received:
support editAs="oneCell" attribute
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: