question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Image position - stretching image

See original GitHub issue

Hello everyone. I have a problem with images using exceljs. If I just run excel file through and save it, images are immediately deformed (stretched). I tried workaround and so I just removed images from original excel file and inserted them with add image. Again stretched. So I tried not to specify cells for image to include, but also other(more specific option):

{tl: { col: 1.2, row: 0.4 }, br: { col: 3.2, row: 0.9 }}

This worked when row number was not decimal. Because the example above didn’t scale the image from 0.4 to 0.9 of the cell, but rather deformed it … Which is weird as the image started the position on 0.4. This for example worked fine:

{tl: { col: 1.2, row: 0.4 }, br: { col: 3.2, row: 1 }}

but any decimal number in br->row does weird things.

I also tried to specify editAs attribute and all its options, but no luck there.

Am I doing something wrong or is it a bug? Is there any workaround where I can specify the place where I want to include image without stretching image?

Thank you for your help!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:22 (10 by maintainers)

github_iconTop GitHub Comments

7reactions
jwmanncommented, Apr 26, 2018

I’m just wondering why @Trynex’s fix isn’t pulled into master. It’s an actual bug that editAs: 'absolute' doesn’t actually do what it says.

6reactions
Trynexcommented, Jan 17, 2018

Hi man. I know what you mean, I tried everything with this plugin but it didnt work. So I had to fork this package and fix it. Currently I’m not near PC but tomorrow I will write you how to use my modified version to make pictures scalable any way you want.

Read more comments on GitHub >

github_iconTop Results From Across the Web

160826 Stretching Positions Images, Stock Photos & Vectors
Find Stretching Positions stock images in HD and millions of other royalty-free stock photos, illustrations and vectors in the Shutterstock collection.
Read more >
How to Stretch and Scale an Image in the Background with CSS
Answer: Use the CSS background-size Property. You can use the CSS background-size: cover; to stretch and scale an image in the background with...
Read more >
Stretch and scale a CSS image in the background
This scales the image so that the background area is completely covered by the background image while maintaining the aspect ratio. The entire...
Read more >
Use CSS3 to Stretch a Background Image to Fit a Web Page
The best way to stretch an image to fit the background of an element is to use the CSS3 property, for background-size, and...
Read more >
background-image-position attribute - BFO
Where to position the background image in it's containing block. The default value is "stretch", which means the image is drawn once but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found