Closed kadikraman closed 9 months ago
We should validate any of the images that can be specified in Expo app config. Should we validate these images (that they are valid pngs, and whatever else) inside of doctor? Or is there another place that would make more sense? If in doctor, should we be running doctor before running a build? (or some subset of doctor checks?) [image (2).png](https://uploads.linear.app/4a409308-b1e3-45fc-94fd-9ef8703ee369/0e59982a-7226-477d-98fd-26e5a05eb897/2cd983a9-f174-43e8-b7b5-801a647f62e9)
Why
We want to check whether the app icon and splash screen images in the codebase are invalid before pre-building so we could show the user an error message and fail the build. ENG-9956.
How
Added an
getPngInfo
function returns the PNG data if a valid PNG is found, and throws otherwise.Intended usage:
Test Plan
Added
packages/image-utils/src/__tests__/image-test.ts
to verify for different file types.