async function rejectSmallImages(input)
When configuring failOn , you typically choose between different severity levels. While specific implementations can vary based on your version of Sharp or the wrapper (like Directus ), the logic generally follows these tiers: sharp failon option
const sharp = require('sharp'); sharp('corrupted.jpg', failOn: 'none' ) .resize(300, 200) .toFile('output.jpg') .catch(err => // This will only trigger for catastrophic failures console.error("Critical error:", err); ); Use code with caution. Copied to clipboard Critical Limitations failOn: 'none' ) .resize(300
If you are using Sharp directly in a Node.js environment, you might implement the option within the constructor or the global configuration: javascript sharp failon option