Images created with migration.createAsset are not considered as images

Following the migration API docs, I'm doing the following :

migration.createAsset(fs.readFileSync(imagePath), 'test.webp')

The migration runs smoothly and I can see the new media in media library. However there is no preview, and I cannot use it in a ImageField :


Note that the file is not corrupted, if I download it from the media library, it is identical to my original image.

Strangely, if I host the image somewhere and do the exact same, it works fine :

migration.createAsset('https://www.example.com/test.webp', 'test.webp')

I'm not sure what's going wrong here ?

Regards,
Grégoire

Hi Grégoire,

Is it happening specifically to this image, and no other? Are other .webp assets working fine?

Let me know!