Allow images Upscaling at upload #1638
Replies: 6 comments
-
Thanks for the report @anthonyivol! Others have been asking for this as well, we probably should support this. Looks like your solution could work. If you want to open a PR with your changes, we can get have it reviewed pretty quick. We may want to expose other Sharp options while were at it though. |
Beta Was this translation helpful? Give feedback.
-
For now, because this is a new feature request, I'm going to convert it to a discussion, because it's technically functioning as intended at this time. But let's keep the conversation going! |
Beta Was this translation helpful? Give feedback.
-
Thanks for your replies. |
Beta Was this translation helpful? Give feedback.
-
To complete, I thought it was a bug as Reading the doc ("More" link to https://sharp.pixelplumbing.com/api-resize) I thought that this option was available : That way I think, sharp.resize should also get the resizeOptions from the config :
|
Beta Was this translation helpful? Give feedback.
-
Hi, i have the same requirement. It is often required to create an larger version of an image. For example for hero banners on websites. In my opinion, the needsResize check is unnecessary and should be removed completely. Because when i configure clear image dimensions like:
I expect that there are three images with exact this dimensions. |
Beta Was this translation helpful? Give feedback.
-
I'm having the same issue -- there definitely could be a better fallback at the very least for when an image size isn't generated |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Bug Report
Image are not upscaled at upload even with
config.upload.resizeOptions.withoutEnlargement
explicitlyfalse
Steps to Reproduce
Other Details
It may cause problems if the editor doesn't upload an image big enough and you use it on your frontend or as admin thumbnail.
This may be solved here : https://github.com/payloadcms/payload/blob/master/src/uploads/imageResizer.ts
Line 57 :
changed with :
Beta Was this translation helpful? Give feedback.
All reactions