MCPcopy Create free account
hub / github.com/MemeTray/MemeTray / handleFiles

Function handleFiles

tools/animation-compression/script.js:153–173  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

151}
152
153function 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
175async function processFiles(files) {
176 const progressContainer = document.getElementById('progressContainer');

Callers

nothing calls this directly

Calls 1

processFilesFunction · 0.70

Tested by

no test coverage detected