MCPcopy Create free account
hub / github.com/IamIsPra/tinywebp / processFiles

Function processFiles

src/pages/Home.tsx:90–99  ·  view source on GitHub ↗
(files: File[])

Source from the content-addressed store, hash-verified

88 };
89
90 const processFiles = async (files: File[]) => {
91 setIsConverting(true);
92 const imageFiles = files.filter(file =>
93 ['image/webp', 'image/avif', 'image/jpeg', 'image/png', 'image/gif', 'image/tiff', 'image/bmp'].includes(file.type)
94 );
95
96 const converted = await Promise.all(imageFiles.map(convertToWebP));
97 setConvertedImages(prev => [...prev, ...converted]);
98 setIsConverting(false);
99 };
100
101 const handleDownload = (image: ConvertedImage) => {
102 const url = URL.createObjectURL(image.webpBlob);

Callers 2

handleFileSelectFunction · 0.85
handleDropFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected