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.

basic function cutoffs the image resized on both sides

See original GitHub issue
sharp(file3)
	.resize(400, 280)
	.toFile(file3x, function(err) {
	// output.jpg is a 200 pixels wide and 200 pixels high image
	// containing a scaled and cropped version of input.jpg
	});

is there another extra setting I need to add?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lovellcommented, Feb 21, 2018

@ryanvanderpol Processing starts on the input image when one of toFile(), toBuffer() or pipe() are called to access the output image. This means a second call to resize() on the same pipeline before processing begins will update the internal state, replacing the parameters from the first call.

0reactions
lovellcommented, Mar 13, 2018

@lesterjanpearson Hope this helped, please feel free to re-open with more details if required.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Proposal: move resize-related options-as-functions to become ...
By default the image is centered, meaning an equal amount is cut off on both sides. For more control you can use the...
Read more >
Working with Pictures in PowerPoint 2016 - InformIT
It's important to learn to crop and resize pictures properly rather than simply stretching them to fit into a space.
Read more >
Image Resize (Cropping, Resampling, or Scaling), including ...
This is about those first basics of resizing images (i.e., the necessary steps to be able ... Aspect Ratio is the simple ratio...
Read more >
Resize, crop and other common transformations
A comprehensive guide that covers all the commonly used image transformations that you will need for your web applications.
Read more >
Images are getting cut off when the website is viewed in a ...
It appears the problem is due to the inconstant aspect ratio of the height and width of the images. In the case of...
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