-
Notifications
You must be signed in to change notification settings - Fork 12
Baseline jpg converter #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
zgredex
wants to merge
18
commits into
crosspoint-reader:master
Choose a base branch
from
zgredex:Baseline_JPG_Converter
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
57ef8fa
Add files via upload
zgredex fcb94b4
Add files via upload
zgredex 9834ae3
Delete crosspoint_reader-v0.1.1.zip
zgredex 83102a1
Rename crosspoint_reader-v0_2_0.zip to crosspoint_reader-v0.2.0.zip
zgredex dc95ef6
Delete crosspoint_reader-v0.2.0.zip
zgredex b701cf3
Add files via upload
zgredex 2949f1a
Rename crosspoint_reader-v0_2_1.zip to crosspoint_reader-v0.2.1.zip
zgredex 4b2a7f0
Add files via upload
zgredex e0f1d2b
Add files via upload
zgredex ba1f741
Add files via upload
zgredex 3213450
Add files via upload
zgredex de5db42
Add files via upload
zgredex 76456ef
Delete crosspoint_reader-v0.2.2.zip
zgredex 4cb0e53
Delete crosspoint_reader-v0.2.1.zip
zgredex 73ea589
Update image conversion instructions in README
zgredex 9c671cd
Fix socket drain on Windows by using platform-specific approach
pablohc 35444ab
Fix SVG images and increase upload timeout
pablohc f2cdf90
Merge pull request #1 from zgredex/fix/svg-images
zgredex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,110 @@ | ||
| # CrossPoint Reader Calibre Plugin | ||
|
|
||
| This plugin adds CrossPoint Reader as a wireless device in Calibre. It uploads | ||
| EPUB files over WebSocket to the CrossPoint web server. | ||
|
|
||
| Protocol: | ||
| - Connect to ws://<host>:<port>/ | ||
| - Send: START:<filename>:<size>:<path> | ||
| - Wait for READY | ||
| - Send binary frames with file content | ||
| - Wait for DONE (or ERROR:<message>) | ||
|
|
||
| Default settings: | ||
| - Auto-discover device via UDP | ||
| - Host fallback: 192.168.4.1 | ||
| - Port: 81 | ||
| - Upload path: / | ||
|
|
||
| Install: | ||
| 1. Download the latest release from the [releases page](https://github.com/crosspoint-reader/calibre-plugins/releases) (or zip the contents of this directory). | ||
| 2. In Calibre: Preferences > Plugins > Load plugin from file. | ||
| 3. The device should appear in Calibre once it is discoverable on the network. | ||
|
|
||
| No configuration needed. The plugin auto-discovers the device via UDP and | ||
| falls back to 192.168.4.1:81. | ||
| # CrossPoint Reader - Calibre Plugin | ||
|
|
||
| A Calibre device driver plugin for CrossPoint e-readers with built-in EPUB image conversion for optimal e-reader compatibility. | ||
|
|
||
| ## Version 0.2.1 | ||
|
|
||
| ## Features | ||
|
|
||
| ### Wireless Book Transfer | ||
| - Automatic device discovery via UDP broadcast | ||
| - WebSocket-based file transfer | ||
| - Support for nested folder structures | ||
| - Configurable upload paths | ||
|
|
||
| ### EPUB Image Conversion | ||
| Automatically converts EPUB images before uploading for maximum e-reader compatibility: | ||
|
|
||
| - **Image Format Conversion**: Converts PNG, GIF, WebP, and BMP to baseline JPEG | ||
| - **SVG Cover Fix**: Converts SVG-based covers to standard HTML img tags | ||
| - **Image Scaling**: Scales oversized images to fit your e-reader screen | ||
| - **Light Novel Mode**: Rotates horizontal images 90° and splits them into multiple pages for manga/comics reading on vertical e-reader screens | ||
|
|
||
| ### Configuration Options | ||
|
|
||
| #### Connection Settings | ||
| - **Host**: Device IP address (default: 192.168.4.1) | ||
| - **Port**: WebSocket port (default: 81) | ||
| - **Upload Path**: Default upload directory (default: /) | ||
| - **Chunk Size**: Transfer chunk size in bytes (default: 2048) | ||
| - **Debug Logging**: Enable detailed logging | ||
| - **Fetch Metadata**: Read metadata from device (slower) | ||
|
|
||
| #### Image Conversion Settings | ||
| - **Enable Conversion**: Turn EPUB image conversion on/off | ||
| - **JPEG Quality**: 1-95% (default: 85%) | ||
| - Presets: Low (60%), Medium (75%), High (85%), Max (95%) | ||
| - **Light Novel Mode**: Rotate and split wide images | ||
| - **Screen Size**: Target screen dimensions (default: 480×800 px) | ||
| - **Split Overlap**: Overlap percentage for split pages (default: 15%) | ||
|
|
||
| ## Installation | ||
|
|
||
| 1. Download the plugin ZIP file | ||
| 2. In Calibre, go to Preferences → Plugins → Load plugin from file | ||
| 3. Select the downloaded ZIP file | ||
| 4. Restart Calibre | ||
|
|
||
| ## Usage | ||
|
|
||
| 1. Connect your CrossPoint Reader to the same WiFi network as your computer | ||
| 2. The device should appear automatically in Calibre's device list | ||
| 3. Configure settings via Preferences → Plugins → CrossPoint Reader → Customize plugin | ||
| 4. Send books to device as usual - images will be automatically converted | ||
|
|
||
| ## What the Converter Does | ||
|
|
||
| ✓ Converts PNG/GIF/WebP/BMP to baseline JPEG | ||
| ✓ Fixes SVG covers for e-reader compatibility | ||
| ✓ Scales large images to fit your screen dimensions | ||
| ✓ Light Novel Mode: rotates & splits wide images for manga/comics | ||
| ✓ Maintains EPUB structure and metadata | ||
| ✓ Preserves original file if conversion fails | ||
|
|
||
| ## Requirements | ||
|
|
||
| - Calibre 5.0 or later | ||
| - CrossPoint Reader device with WebSocket server enabled | ||
| - Same WiFi network for device discovery | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Device not detected | ||
| 1. Ensure device and computer are on the same network | ||
| 2. Check the Host setting in plugin configuration | ||
| 3. Enable debug logging to see discovery attempts | ||
| 4. Try manually entering the device IP address | ||
|
|
||
| ### Images not converting | ||
| 1. Verify "Enable EPUB image conversion" is checked | ||
| 2. Check the debug log for conversion errors | ||
| 3. Ensure sufficient disk space for temporary files | ||
|
|
||
| ### Poor image quality | ||
| - Increase JPEG Quality setting (try 85% or 95%) | ||
|
|
||
| ### Split images not aligned | ||
| - Adjust Split Overlap percentage (try 15-20%) | ||
|
|
||
| ## License | ||
|
|
||
| This plugin is provided as-is for use with CrossPoint Reader devices. | ||
|
|
||
| ## Changelog | ||
|
|
||
| ### v0.2.1 | ||
| - Fixed: mimetype now written first in EPUB archive (EPUB OCF spec compliance) | ||
| - Fixed: Preset quality buttons now disable when conversion is toggled off | ||
| - Fixed: Closure variable binding in replacement functions (B023) | ||
|
|
||
| ### v0.2.0 | ||
| - Added EPUB image conversion | ||
| - Added Light Novel Mode (rotate & split) | ||
| - Added configurable JPEG quality | ||
| - Added screen size settings | ||
| - Improved configuration UI with grouped settings | ||
|
|
||
| ### v0.1.1 | ||
| - Initial release | ||
| - Wireless book transfer | ||
| - Device auto-discovery | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,22 @@ | ||
| """ | ||
| CrossPoint Reader - Calibre Device Driver Plugin | ||
|
|
||
| A wireless device driver for CrossPoint e-readers with built-in | ||
| EPUB image conversion for optimal e-reader compatibility. | ||
|
|
||
| Features: | ||
| - Wireless book transfer via WebSocket | ||
| - Automatic EPUB image conversion to baseline JPEG | ||
| - PNG/GIF/WebP/BMP to JPEG conversion | ||
| - SVG cover fixing | ||
| - Image scaling to fit e-reader screen | ||
| - Light Novel Mode: rotate and split wide images for manga/comics | ||
| - Configurable JPEG quality and screen dimensions | ||
| """ | ||
|
|
||
| from .driver import CrossPointDevice | ||
|
|
||
|
|
||
| class CrossPointReaderDevice(CrossPointDevice): | ||
| """CrossPoint Reader device driver for Calibre.""" | ||
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.