Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let images = baseColorImages.map((index) => {
const image = container.json.images[index];
const arrayBuffer = container.resolveURI(image.uri);
const mimeType = image.mimeType || (image.uri.match(/\.png$/) ? 'image/png' : 'image/jpeg');
atlasIsPNG = atlasIsPNG || mimeType === 'image/png';
const {width, height} = GLTFUtil.getImageSize(container, index);
return {index, width, height, arrayBuffer, mimeType, x: undefined, y: undefined};
});