The plugin runs all imported SVG files through svgo.
For index.html, you can use the following syntax:
```html
<use svg="file.svg" size="24" />
```
For scripts, use the `?svg` import query
```javascript
import SVG_FILE from './file.svg?svg&size=24
```
Note: size is shorthand for specifying both width and height individually. You can also set any property of the base SVG element.
You can also use the `?svg&icon` query to return a function that allows dynamically resizing the SVG string.
- feat(taglib): updated audio buffer handling in metadata.js to use Uint8Array.
- feat(taglib): refactored addMetadataToAudio to support return type as Blob or Uint8Array
- feat(taglib): add timeout functionality to metadata functions
- Introduced `withTimeout` utility function to handle operation timeouts.
- Updated `addMetadataWithTagLib` to use `withTimeout` for promise resolution.
- Updated `getMetadataWithTagLib` to use `withTimeout` for promise resolution.
- Added default timeout parameter to both metadata functions.
- feat(taglib): improve metadata handling with ChunkedByteVectorStream
- Enhanced metadata handling in taglib.ts and taglib.worker.ts to utilize ChunkedByteVectorStream.
- fix(taglib): handle metadata addition failure gracefully
- Updated `addMetadataWithTagLib` to catch errors and return original audio data if metadata addition fails.
fix(downloads): return original blob if metadata addition fails
- Wrap addMetadataToAudio call in try-catch to handle errors.
feat(taglib): add direct calling of taglib methods
- Introduced `direct` parameter to `addMetadataWithTagLib` and `getMetadataWithTagLib` functions for direct processing in the current thread.
- Exported taglib worker functions.
- Refactor metadata handling to use fetchTagLib and addMetadataWithTagLib for improved loading and worker-based processing
- Update prefetchMetadataObjects and addMetadataToAudio for simplified and more robust metadata extraction
- Add taglib.worker.ts for audio metadata processing in a worker
- Implement getMetadataWithTagLib function
- Auto-fix linting issues and remove unnecessary debugger statements
taglib supports multiple media formats beyond what was previously supported, this would enable transcoding to other formats without needing to write additional metadata libraries.
Implements MP3 320kbps download functionality using ffmpeg.wasm for
industry-standard encoding with libmp3lame.
Features:
- New MP3_320 quality option in download settings UI
- ID3v2.3 metadata writing (title, artist, album, cover art, ISRC, etc.)
- Non-blocking encoding via Web Worker to keep UI responsive
- Proper UTF-16 with BOM text encoding for international characters
- Album artist fallback to track artist (mirrors FLAC/M4A behavior)
- Automatic format detection for downloaded audio
- Year validation to prevent writing NaN to ID3 tags
Implementation:
- mp3-encoder.js: Main encoder module with worker orchestration
- mp3-encoder.worker.js: FFmpeg Web Worker for async encoding
- id3-writer.js: ID3v2.3 tag writer with synchsafe size encoding
- Updates to api.js, metadata.js, utils.js for MP3 support
- Vite config excludes @ffmpeg packages from dep optimization
Technical details:
- Uses @ffmpeg/ffmpeg (libmp3lame 320kbps CBR, 44.1kHz)
- FFmpeg binary lazy-loaded from CDN (~25MB, cached)
- Encoding runs in separate thread (non-blocking UI)
- Proper error handling with distinct encoding vs network errors
- Memory-efficient: transfers ArrayBuffer with zero-copy
Dependencies:
- @ffmpeg/ffmpeg ^0.12.10
- @ffmpeg/util ^0.12.1
- Removed: package-lock.json (project uses bun.lock)
Closes maintainer request to use ffmpeg.wasm instead of lamejs.