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

Landscape splitting #3

Closed
insanelysick opened this issue Jan 8, 2013 · 15 comments
Closed

Landscape splitting #3

insanelysick opened this issue Jan 8, 2013 · 15 comments
Assignees
Labels
Enhancement New feature or request

Comments

@insanelysick
Copy link

This is almost perfect. The only problem is that when converting a manga that has double page spreads it puts them in the wrong order after cutting them as manga is read from right-to-left. Any chance of an update for this?

@ghost ghost assigned ciromattia Jan 8, 2013
@ciromattia
Copy link
Owner

Yep, I've planned to add an option to specify the reading direction so splitting would be correctly done.
Adding options would need a GUI, but I've been quite busy ATM, I'm going with further development soon :)

@insanelysick
Copy link
Author

Wow fast reply! I wasn't expecting anything so soon, so no problem mate. I did try setting righttoleft=True in Image.py , however that didn't seem to have any effect on the output. Also is it your script that determines the direction of the panel view or is that on the kindle side?

Anyway fantastic bit of work, makes reading comics on the paperwhite even better! cant wait to see what you have in store for the future updates.

@ciromattia
Copy link
Owner

Should be fixed now, just use the new CLI option -m to have manga-style page splitting.

Tell me if it works for you :)

@insanelysick
Copy link
Author

Thanks! It works nicely. Is there a way of setting the droplet to do the same?

@ciromattia
Copy link
Owner

Yep, open it in AppleScript Editor and add -m to the options specified at the line:
set shellcommand to "python " & (quoted form of comic2ebookPath) & " -p KHD -t " & (quoted form of TheTitle) & " " & (quoted form of dirPath)
so the line becomes
set shellcommand to "python " & (quoted form of comic2ebookPath) & " -p KHD -m -t " & (quoted form of TheTitle) & " " & (quoted form of dirPath)
Then save and go :)
If you need you can change profile the same way changing the KHD string.

@insanelysick
Copy link
Author

Hmm has anything changed in the other scripts? As I seem to be getting errors from kidlegen now that I wasn't getting before.

@insanelysick
Copy link
Author

Sorry to bombard you mate, I think Kindlegen is working as normal with the same errors as usual. But after kindlegen has done its work the script stops and doesn't call kindlestrip.

@ciromattia
Copy link
Owner

Il giorno 10/gen/2013, alle ore 14:25, insanelysick notifications@github.com ha scritto:

Sorry to bombard you mate, I think Kindlegen is working as normal with the same errors as usual. But after kindlegen has done its work the script stops and doesn't call kindlestrip.

don't worry, every report helps to improve :)
I just tried the droplet and it works without flaws so I expect something in the comic, can you send me a sample of the one you're working on so I can investigate?
If it's too large please upload to e.g. Dropbox.
Thanks!

Ciro Mattia Gonano
FB: http://www.facebook.com/ciromattia
Skype: ciromattia
Tweets: http://twitter.com/ciromattia

@insanelysick
Copy link
Author

I've just converted from cbz to mobi using the scripts individually and that works fine, I've also converted the same comic using the previous version droplet and that works fine too. It just seems to be the new droplet that this occurs with.
I also called kindlestrip manually on the failed content.mobi file after the droplet errors out and that works too. I'm wondering if it has something to do with the way the droplet names the files when kindlestrip is called and the fact my OS language is Japanese? Although the previous version works fine. Any thoughts? I'll try uploading the cbz file when I get back to my computer.

@ciromattia
Copy link
Owner

Il giorno 10/gen/2013, alle ore 15:03, insanelysick notifications@github.com ha scritto:

I'm wondering if it has something to do with the way the droplet names the files when kindlestrip is called and the fact my OS language is Japanese?

mmm, could be… can you send me the KindleComicConverter.log file? It should contain the error log.

Ciro Mattia Gonano
FB: http://www.facebook.com/ciromattia
Skype: ciromattia
Tweets: http://twitter.com/ciromattia

@insanelysick
Copy link
Author

I had a look at it but it doesn't really seem to specify much. I'll send it when I'm back at my computer again.

@insanelysick
Copy link
Author


  • Amazon.com kindlegen(MAC OSX) V2.7 build 1019-d6e4792 *
  • A command line e-book compiler *
  • Copyright Amazon.com 2012 *

Info(prcgen):I1047: Added metadata dc:Title "01"
Info(prcgen):I1047: Added metadata book-type "comic"
Info(prcgen):I1047: Added metadata fixed-layout "true"
Info(prcgen):I1047: Added metadata orientation-lock "portrait"
Info(prcgen):I1047: Added metadata original-resolution "758x1024"
Info(prcgen):I1047: Added metadata zero-gutter "true"
Info(prcgen):I1047: Added metadata zero-margin "true"
Info(prcgen):I1002: Parsing files 0000226
Info(prcgen):I1016: Building enhanced PRC file
Info(prcgen):I1006: Resolving hyperlinks
Info(prcgen):I1015: Building PRC file
Info(prcgen):I1049: Building table of content URL: /Users/johnnystyx/Desktop/kcc-master-1/01/content.ncx
Info(prcgen):I8002: Atleast one tag must be there in ncx file.
Warning(prcgen):W14016: Cover not specified
Info(pagemap):I8000: No Page map found in the book
Info(prcgen):I1045: Computing UNICODE ranges used in the book
Info(prcgen):I1046: Found UNICODE range: Basic Latin [20..7E]
Info(prcgen):I1017: Building PRC file, record count: 0000003
Info(prcgen):I1039: Final stats - text compressed to (in % of original size): 24.26%
Info(prcgen):I1040: The document identifier is: "01"
Info(prcgen):I1041: The file format version is V5
Info(prcgen):I1031: Saving PRC file
Info(prcgen):I1033: PRC built with WARNINGS!
Info(prcgen):I1007: Resolving mediaidlinks
Info(prcgen):I1011: Writing mediaidlinks
Info(prcgen):I1009: Resolving guide items
Info(prcgen):I1046: Found UNICODE range: /Users/johnnystyx/Desktop/kcc-master-1/01/content.ncx
Info(prcgen):I1017: Building PRC file, record count: 0000019
Info(prcgen):I1039: Final stats - text compressed to (in % of original size): 27.10%
Info(prcgen):I1040: The document identifier is: "/Users/johnnystyx/Desktop/kcc-master-1/01/content.ncx"
Info(prcgen):I1041: The file format version is V8
Info(prcgen):I1032: PRC built successfully
Info(prcgen):I15000: Approximate Standard Mobi Deliverable file size : 0032950KB
Info(prcgen):I15001: Approximate KF8 Deliverable file size : 0032983KB
Info(prcgen):I1037: Mobi file built with WARNINGS!

@ciromattia
Copy link
Owner

Il giorno 10/gen/2013, alle ore 16:24, insanelysick notifications@github.com ha scritto:

Amazon.com kindlegen(MAC OSX) V2.7 build 1019-d6e4792 *
A command line e-book compiler *
Copyright Amazon.com 2012 * *********************************************************

totally similar to mine output, there isn't any error… I wonder why the droplet complaints.
Please try to launch the ./syncDroplet.sh script (after that you'll want to re-apply edits on the script file)...

Ciro Mattia Gonano
FB: http://www.facebook.com/ciromattia
Skype: ciromattia
Tweets: http://twitter.com/ciromattia

@insanelysick
Copy link
Author

Right I have found the problem, Its to do with the error logging from Kindlegen. Rather than continue on the script halts progress once it encounters errors, so removing;

on error the error_message number the error_number
set shellresult to error_message
end try
if (offset of "Error" in shellresult) > 0 or (offset of "Warning" in shellresult) > 0 then
set fileRef to open for access file resultsFile with write permission
set eof fileRef to 0
write shellresult to fileRef
close access fileRef
ErrorMessage()
end if
from

on Kindlegen(dir)
set opfPath to POSIX path of dir & "/content.opf"
set resultsFile to ParentFolder & "KindleComicConverter.log"
set shellcommand to kindlegenPath & " " & (quoted form of opfPath)
try
set shellresult to do shell script shellcommand
on error the error_message number the error_number
set shellresult to error_message
end try
if (offset of "Error" in shellresult) > 0 or (offset of "Warning" in shellresult) > 0 then
set fileRef to open for access file resultsFile with write permission
set eof fileRef to 0
write shellresult to fileRef
close access fileRef
ErrorMessage()
end if
return
end Kindlegen

does the process without error logging kindlegen and completes the script nicely. Not the best method but it works for me :D

@insanelysick
Copy link
Author

Maybe you can use something along these lines to make it handle the errors more gracefully https://developer.apple.com/library/mac/#documentation/applescript/Conceptual/ApplescriptLangGuide/reference/ASLR_error_xmpls.html

AcidWeb added a commit that referenced this issue Jan 16, 2014
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

No branches or pull requests

2 participants