![]() |
#121 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,504
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Note, filesystem/path encodings in Python can differ greatly on Windows from the utf-8 standard used on Linux and Macs.
So if you are trying to convert a bytestring in Python that contains a path or partial path to full unicode you should probably decode it using sys.getfilesystemencoding() to create a full unicode string and then encode that into utf-8 for printing. Alternatively, you can use 'replace' with decode and encode routines to prevent problems with unknown bytestrings. See my unipath.py code here for routines for fighting this battle: https://github.com/Sigil-Ebook/Sigil...hon/unipath.py |
![]() |
![]() |
![]() |
#122 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Thanks Kevin, I will take a look of that. As my main platform is Windows (although currently I develop on Linux for Python), I would have never catched this.
|
![]() |
![]() |
Advert | |
|
![]() |
#123 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,504
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Python 3.6 has a new PEP 528 and PEP 529 that changes things for paths on Windows.
Windows is hard but Python 3.6 and sys.getfilesystemencoding() will fix most of this. The real problem for paths in Python is in Linux which can theoretically use arbitrary bytes sequences with no encoding at all inside file paths when the C-locale is set by the user forcing the use of surrogateescape to smuggle/hide these non-utf-8 byte sequences into utf-8 strings. But, of course these can not be printed either! https://www.python.org/dev/peps/pep-0528/ https://www.python.org/dev/peps/pep-0529/ |
![]() |
![]() |
![]() |
#124 | |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Apr 2018
Device: Kindle
|
Hope it's okay to bump this, but I am having an issue.
I have installed the latest Sigil on my Mac. I have also installed Mono Framework from here. However, when I run ePub optimizer, I get the following error message: Quote:
I am running Mac Os 10.13.4 |
|
![]() |
![]() |
![]() |
#125 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,388
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
It just can't find the mono binary for some reason.
At a guess (defer to Toxaris' advice if and when he responds), I'd say mono needs to be in the Path for the plugin to find it. Was there an option for adding Mono to the Path when installing it? Last edited by DiapDealer; 04-13-2018 at 02:46 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#126 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,689
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
@big_smile: If you've Calibre installed on your Mac, you can also use Polish Books. (It also uses cjpeg, jpegtran and optipng for lossless image compression.)
@DiapDealer: Even though I have Mono installed on my Arch Linux machine I never could get the plugin to work. Does it work on your Linux machine? |
![]() |
![]() |
![]() |
#127 | |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Apr 2018
Device: Kindle
|
Quote:
![]() Does it do all the shrinking to ebooks that ePUB Optimizer does? No, it didn't give an option. Do you know which path it should be in? Maybe I can move it manually. Thanks for your help! |
|
![]() |
![]() |
![]() |
#128 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,388
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#129 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,245
Karma: 145488788
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
OS X 10.13.4 will only run 64-bit software. That means that if anything in Sigil relies on 32-bit code, it won't work. So that means even Python has to be 64-bit.
|
![]() |
![]() |
![]() |
#130 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,504
Karma: 5703586
Join Date: Nov 2009
Device: many
|
No, 32 bit software still runs fine in OSX with the latest update. It will just warn you that with the next major update it will not.
On OSX, python is embedded in Sigil and everything already is 64 bit and has been for years. |
![]() |
![]() |
![]() |
#131 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
The plugin will not search for mono. It should be in the path so it can be called directly. Open an command prompt and just run mono to see if it is in the path. If not, you could try 'which mono' to see if you can find a path and adapt that yourself in the plugin call.
If you don't use fonts in your ePUB, Polish Ebooks will do the same. |
![]() |
![]() |
![]() |
#132 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,388
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
In addition to mono, you need to install the VisualBasic.Net interpreter: mono-basic from the AUR. Make sure you run: Code:
export TERM=xterm After that, the plugin completed successfully. I didn't try it on anything but the simple, default empty plugin, but there were no errors. Hope that helps Arch users. EDIT: and of course; libjpeg-turbo, optipng, and gifsicle for the image stuff Last edited by DiapDealer; 04-14-2018 at 02:55 PM. |
|
![]() |
![]() |
![]() |
#133 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,689
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
|
![]() |
![]() |
![]() |
#134 | |
Member
![]() Posts: 23
Karma: 10
Join Date: Jun 2012
Device: Samsung Note20 Ultra, Kindle Fire HD10
|
![]()
I apologize if you were aware of it, but I was attempting to download the latest (0.73) version of the SIGIL Plugin, but the link you showed (below) wasn't working.
Quote:
http://toxaris.nl/optimizer.html I'm going to guess that though there might have been many people who were able to figure it out like I did, you might want to actually update your post to help those who were not able to get to the correct destination? Sorry to bother you. Frank |
|
![]() |
![]() |
![]() |
#135 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 312
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
|
Have any macOS users used this lately? I'm having a heck of a time getting it to find mono. I installed mono via the instructions here: https://www.mono-project.com/docs/ge...d/install/mac/, which places it in /Library/Frameworks/Mono.framework. I added a symlink to it in my PATH, and it appears to work in Terminal (in that tab/autocomplete on "mono" pulls it up), but the plugin still fails for me with "Error: [Errno 2] No such file or directory: 'mono'".
I'm sure I'm either overlooking something obvious or have done something silly here, if anyone has any ideas for things I might try, I'd be very grateful. Last edited by phillipgessert; 09-29-2021 at 04:25 PM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Comic optimizer script | rhon | Kobo Reader | 0 | 11-08-2012 06:04 PM |
Mokle - Mangas Optimizer for Kindle | devorez | Kindle Developer's Corner | 11 | 08-14-2012 07:15 PM |
Patent/Heavy graphics pdfs and Adobe PDF Optimizer | andrewscheinman | iRex | 4 | 12-26-2009 11:39 AM |
epub, ePub, EPUB, warum blos ePub? | flowoeB | Lounge | 5 | 11-27-2009 09:37 AM |
PRS-500 PDF file optimizer | phigdon | Sony Reader Dev Corner | 1 | 04-01-2007 11:40 PM |