(e)
| 151 | } |
| 152 | |
| 153 | function handleFiles(e) { |
| 154 | const files = Array.from(e.target.files); |
| 155 | const fileObjects = files.map(file => ({ |
| 156 | file, |
| 157 | path: file.webkitRelativePath || file.name |
| 158 | })); |
| 159 | |
| 160 | if (files.length > 0 && files[0].webkitRelativePath) { |
| 161 | folderName = files[0].webkitRelativePath.split('/')[0]; |
| 162 | } |
| 163 | |
| 164 | const webpEnabled = document.getElementById('webpToggle').checked; |
| 165 | const validFiles = fileObjects.filter(f => { |
| 166 | if (webpEnabled) { |
| 167 | return f.file.type === 'image/gif' || f.file.type === 'image/webp' || f.file.type === 'image/png' || f.file.type === 'image/apng'; |
| 168 | } |
| 169 | return f.file.type === 'image/gif'; |
| 170 | }); |
| 171 | |
| 172 | processFiles(validFiles); |
| 173 | } |
| 174 | |
| 175 | async function processFiles(files) { |
| 176 | const progressContainer = document.getElementById('progressContainer'); |
nothing calls this directly
no test coverage detected