Skip to content
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

[Feature Request] Add CLI option to not split or rotate images #372

Closed
flying-sausages opened this issue Sep 16, 2020 · 1 comment · Fixed by #785
Closed

[Feature Request] Add CLI option to not split or rotate images #372

flying-sausages opened this issue Sep 16, 2020 · 1 comment · Fixed by #785
Labels
Enhancement New feature or request

Comments

@flying-sausages
Copy link

From what I gather, there is no way for me to have manga processed without horizontal images being either split or rotated. I have a kobo forma which has a gyroscope and can do 90deg rotation. It would be optimal to leave horizntal images as they are, and then I can actually rotate my device to fit the content if I so desire, or zoom into it manually.

The logic for the splitting image is pretty convoluted, and seeing as I have little python experience I would really need a hand with getting that done.

@joeization
Copy link

split and rotate configs are done here

def splitCheck(self):
width, height = self.image.size
dstwidth, dstheight = self.size
if (width > height) != (dstwidth > dstheight) and width <= dstheight and height <= dstwidth \
and not self.opt.webtoon and self.opt.splitter == 1:
self.payload.append(['R', self.source, self.image.rotate(90, Image.BICUBIC, True), self.color, self.fill])
elif (width > height) != (dstwidth > dstheight) and not self.opt.webtoon:
if self.opt.splitter != 1:
if width > height:
leftbox = (0, 0, int(width / 2), height)
rightbox = (int(width / 2), 0, width, height)
else:
leftbox = (0, 0, width, int(height / 2))
rightbox = (0, int(height / 2), width, height)
if self.opt.righttoleft:
pageone = self.image.crop(rightbox)
pagetwo = self.image.crop(leftbox)
else:
pageone = self.image.crop(leftbox)
pagetwo = self.image.crop(rightbox)
self.payload.append(['S1', self.source, pageone, self.color, self.fill])
self.payload.append(['S2', self.source, pagetwo, self.color, self.fill])
if self.opt.splitter > 0:
self.payload.append(['R', self.source, self.image.rotate(90, Image.BICUBIC, True),
self.color, self.fill])
else:
self.payload.append(['N', self.source, self.image, self.color, self.fill])

comment this line should work

self.splitCheck()

@darodi darodi added the Enhancement New feature or request label Jan 22, 2023
@darodi darodi added this to the 5.7.0 milestone Jan 22, 2023
@axu2 axu2 modified the milestones: 5.7.0, 5.7.1 Mar 23, 2024
@axu2 axu2 removed this from the 6.1 milestone Jul 1, 2024
@axu2 axu2 mentioned this issue Dec 14, 2024
@axu2 axu2 closed this as completed in #785 Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants