(files)
| 298 | |
| 299 | // Process the collected files |
| 300 | async function processFiles(files) { |
| 301 | if (files.length === 0) { |
| 302 | alert('No GIF files found!'); |
| 303 | return; |
| 304 | } |
| 305 | |
| 306 | console.log(`Processing ${files.length} GIF files`); |
| 307 | state.originalFiles = files; |
| 308 | |
| 309 | // Wait for Pyodide to finish loading if it is still initializing |
| 310 | if (!state.pyodideReady) { |
| 311 | console.log('⏳ Waiting for Pyodide to load...'); |
| 312 | while (!state.pyodideReady) { |
| 313 | await new Promise(resolve => setTimeout(resolve, 100)); |
| 314 | } |
| 315 | console.log('✅ Pyodide ready, starting workflow...'); |
| 316 | } |
| 317 | |
| 318 | // Launch the processing workflow |
| 319 | await startWorkflow(); |
| 320 | } |
| 321 | |
| 322 | // Execute the end-to-end processing workflow |
| 323 | async function startWorkflow() { |
no test coverage detected