( buffer: Buffer, mediaType: string, originalSize: number, dimensions?: ImageDimensions, )
| 782 | } |
| 783 | |
| 784 | function createImageResponse( |
| 785 | buffer: Buffer, |
| 786 | mediaType: string, |
| 787 | originalSize: number, |
| 788 | dimensions?: ImageDimensions, |
| 789 | ): ImageResult { |
| 790 | return { |
| 791 | type: 'image', |
| 792 | file: { |
| 793 | base64: buffer.toString('base64'), |
| 794 | type: `image/${mediaType}` as Base64ImageSource['media_type'], |
| 795 | originalSize, |
| 796 | dimensions, |
| 797 | }, |
| 798 | } |
| 799 | } |
| 800 | |
| 801 | /** |
| 802 | * Inner implementation of call, separated to allow ENOENT handling in the outer call. |
no test coverage detected