feat: reorder spread image processing to crop before splitting#1280
Open
johnny-official wants to merge 1 commit intociromattia:masterfrom
Open
feat: reorder spread image processing to crop before splitting#1280johnny-official wants to merge 1 commit intociromattia:masterfrom
johnny-official wants to merge 1 commit intociromattia:masterfrom
Conversation
Signed-off-by: Johnny <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The current image processing pipeline for spread images applies cropping after the image has been split into two individual pages. This can lead to visual misalignment of the artwork when the comic is viewed, especially in landscape mode, as the cropping on each half might not be perfectly symmetrical or might remove content intended to be continuous across the original spread. The root cause is the incorrect order of operations.
Changes
Locate the function responsible for processing spread images (e.g.,
split_spread,process_page). Within this function, reorder the image manipulation steps to ensure that any global cropping (e.g., smart cropping, margin removal) is applied to the entire spread image first. After the spread image has been pre-cropped, then proceed to split it into two separate pages. This ensures that the cropping is consistent across the entire spread before division, preserving artwork alignment.Modified files:
kindlecomicconverter/image_processor.py(new)Tested by running the project's existing test suite. No unrelated changes included.
Closes #594