Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2361,7 +2361,7 @@ ipcMain.handle('get3MFImages', async (event, filePath) => {
const imageFiles = [];
for (const [path, file] of Object.entries(contents.files)) {
// Check if file is in Metadata directory first
if (path.toLowerCase().includes('metadata/') && path.match(/\.(png|jpe?g|gif)$/i)) {
if (path.toLowerCase().includes('metadata/') && path.match(/\.(png|jpe?g|gif|webp)$/i)) {
console.log('Found image in Metadata:', path);
const imageData = await file.async('base64');
imageFiles.push(`data:image/${path.split('.').pop()};base64,${imageData}`);
Expand All @@ -2372,7 +2372,7 @@ ipcMain.handle('get3MFImages', async (event, filePath) => {
if (imageFiles.length === 0) {
console.log('\nLooking for images anywhere in 3MF...');
for (const [path, file] of Object.entries(contents.files)) {
if (path.match(/\.(png|jpe?g|gif)$/i)) {
if (path.match(/\.(png|jpe?g|gif|webp)$/i)) {
console.log('Found image:', path);
const imageData = await file.async('base64');
imageFiles.push(`data:image/${path.split('.').pop()};base64,${imageData}`);
Expand Down
Loading