Closed BernhardBehrendt closed 1 month ago
Did you see https://sharp.pixelplumbing.com/api-resize#resize ? What you describe sounds more like fit: contain
.
Thanks yes using fit contain it's working. Had another issue that made it appear contain was the wrong solution. Thank you so much for pointing me to the right direction.
Question about an existing feature => resize(number, number, { fit: 'inside' })
Using the resize method to scale down an image into a target format
What are you trying to achieve?
Keeping the desired dimension:
The resulting output image is 610 × 471 and desired taget height of 854 is not applied as value for the down sized image. I think especially with
fit:inside
option set that the output image has a size of 610x854 with the image having a size of 610x471 vertically centered. Is this somehow achievable? Thanks very much for any guidance :-)Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this question
The code above is a working example that can be reproduced by e.g. using this image: