(bytes: number)
| 125 | canvas.height = dimensions.height; |
| 126 | const context = canvas.getContext('2d'); |
| 127 | if (!context) { |
| 128 | throw new Error('Could not resize image'); |
| 129 | } |
| 130 | |
| 131 | context.drawImage(bitmap, 0, 0, dimensions.width, dimensions.height); |
| 132 | const blob = await blobFromCanvas(canvas, file.type, resizeImages.quality); |
| 133 | return new File([blob], file.name, { type: file.type, lastModified: file.lastModified }); |
| 134 | } finally { |
no outgoing calls
no test coverage detected