Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-04-2020, 05:13 AM   #1
HaPeSchu
Banned
HaPeSchu began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Feb 2020
Device: tolino epos
New Feature Font Preview is causing problems

Hi,

i'm still inbestigating in this, but i guess Sigil has a problem with the font preview. If a font is obfucated and the bookid in the identfier element is changed sigil is not able to load the file after it has been saved.

This was possible before the fonts could be previewed in sigil, so i guess sigil is checking now something, cant do that anymore terminates itself.

Can anyone confirm this?

Steps:

Epub file with obfuscated fonts
open
change bookid in identifier element (conten.opf)
save
close sigil
open sigil with ebook => crash
HaPeSchu is offline   Reply With Quote
Old 09-04-2020, 08:17 AM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by HaPeSchu View Post
Hi,

i'm still inbestigating in this, but i guess Sigil has a problem with the font preview. If a font is obfucated and the bookid in the identfier element is changed sigil is not able to load the file after it has been saved.

This was possible before the fonts could be previewed in sigil, so i guess sigil is checking now something, cant do that anymore terminates itself.

Can anyone confirm this?

Steps:

Epub file with obfuscated fonts
open
change bookid in identifier element (conten.opf)
save
close sigil
open sigil with ebook => crash
Are you sure this used to work? Since the Font Preview won't try to load when opening an epub, I doubt that the crash is related. There are two kinds of font encryption (IDPF and Adobe). I suspect one of them uses the BookID as part of its encryption key. If that's the case, it wouldn't matter if Sigil crashed or not, the obfuscated fonts would no longer render correctly. Is it possible this has always been broken (for at least one of the supported obfuscation schemes)?

We'll certainly look into eliminating the crash, but just know that changing items that are potentially used in the encryption key for obfuscated fonts is not a good idea.

Best practice would be to de-obfuscate (right click on font files in Book Browser and toggle the obfuscation off), change the ID, and then re-obfuscate (if necessary). If for your own use, obfuscation is typically unnecessary. If for submission, it's generally best to let the upstream retailer apply the obfuscation.
DiapDealer is offline   Reply With Quote
Old 09-04-2020, 08:42 AM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I also can't get Sigil to crash using your steps (on Windows). For either obfuscation scheme. Can you give a more precise example of what you're changing the dc:identifier from, and what you're changing it to?

For what it's worth, changing the dc:identifier is definitely a no-no where Adobe's font obfuscation scheme is concerned. Not without reapplying the obfuscation afterward, anyway. It will render the fonts unusable in the epub. But it shouldn't crash Sigil.
DiapDealer is offline   Reply With Quote
Old 09-04-2020, 09:44 AM   #4
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
The first thing Sigil does when opening a file with obfuscated fonts is de-obfuscate the fonts so that Preview has a chance of actually working. So with broken fonts, Sigil could crash on startup.

A crash could be caused by anything the does not handle obfuscation/deobfuscation properly as fonts are binary data. The key depends on obfuscation version Adobe vs IDPF. In order to try to test things we need to know which obfuscation technique you are using (Adobe or IDPF, and both the opf bookid and any dc:identifiers that are type uuid in the opf, both before and after your changes.

This has nothing to do with font preview changes as once loaded in Sigil, all fonts are de-obfuscated.
KevinH is offline   Reply With Quote
Old 09-04-2020, 10:20 AM   #5
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
I can not recreate this crash either. So we need more details in order to track this down.
Specifically, how *exactly* are you changing the bookid ... what to what. Is the bookid a dc:identifier that has a uuid scheme? Are you using IDPF or Adobe? How exactly are you saving the file after the change to the bookid? Is it a "Save", "Save-As" or via an output plugin.

Please note that deobfuscation always happens on load (assuming the right xml exists) and any obfuscation if enabled, only happens on Save of the epub to the version in the file. Not the fersion stored in Sigil's working directory.
KevinH is offline   Reply With Quote
Old 09-04-2020, 11:28 AM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
We definitely want to track down the crash if possible, but I probably wouldn't edit any epub (with any epub editor) with obfuscated fonts, myself. I would work with all fonts unobfuscated (meaning Sigil doesn't have to do the de-obfuscating/obfuscating on Open/Save). Only after all epub editing was done would I make sure any fonts that needed to be obfuscated, were.
DiapDealer is offline   Reply With Quote
Old 09-06-2020, 11:06 AM   #7
HaPeSchu
Banned
HaPeSchu began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Feb 2020
Device: tolino epos
Ok, it was only an assumption as i had this issue only in the new version with font-preview. Another thing that led me to this assumption: if i delete the fonts before saving the epub can be opened without problem. Its this Libertine dejavu crap which is just wasting space on my e-reader.
New bookid is just psrt of my clean up script (get rid of html elements in the description, separate a list of authors into single authors meta info, grab some informatuon fram amazon and so on...)
HaPeSchu is offline   Reply With Quote
Old 09-06-2020, 12:44 PM   #8
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
But if you use Adobe font obfuscation and your bookid is a uuid scheme and then change it to something not uuid based (ie: made up of groupings of valid base-16 hex chars) you would intentionally be breaking the obfuscation.

If I change it to something that is a valid uuid identifier, then font obfuscation should work with the new id just fine.

Similarly, if your use IDPF obfuscation and change the id to something non-valid (say a null string) it can break IDPF obfuscation (the bookid need not be uuid for IDPF).

So that is why we asked which obfuscation method was being used (see the encryption.xml in the META-INF) and exactly what it was and what you changed it to.

Please provide that info so we can try to recreate the crash and get it fixed.
KevinH is offline   Reply With Quote
Old 09-06-2020, 04:05 PM   #9
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,311
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by HaPeSchu View Post
Ok, it was only an assumption as i had this issue only in the new version with font-preview. Another thing that led me to this assumption: if i delete the fonts before saving the epub can be opened without problem. Its this Libertine dejavu crap which is just wasting space on my e-reader.
New bookid is just psrt of my clean up script (get rid of html elements in the description, separate a list of authors into single authors meta info, grab some informatuon fram amazon and so on...)
If you aren't running that script from within Sigil so it has the un-obfuscated fonts in memory, you are very likely destroying the key needed to decrypt the fonts. For me, the easiest workaround when an epub has encrypted fonts would be to open the epub with Sigil, select the font file, right click and set Font Obfuscation to none before running your script. You can then re-enable font obfuscation after running your script.

Edit: I managed to crash Sigil when I modified the urn:uuid dc:identifier line.

Code:
Error info: Cannot load file C:\Users\David\Desktop\Starlight - James Thatcher.epub: C:/Users/David/AppData/Local/Temp/Sigil-xhdWEU/OEBPS/Fonts/font00247.ttf: http://ns.adobe.com/pdf/enc#RC: 
Sigil version: 1.3.0
Runtime Qt: 5.12.9
Compiled Qt: 5.12.9
System: Windows 10 (10.0)
Architecture: x86_64

Last edited by DNSB; 09-06-2020 at 04:36 PM.
DNSB is offline   Reply With Quote
Old 09-06-2020, 08:09 PM   #10
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
That is not actually a crash report. It is a Sigil exception report. Sigil is detecting that the font can not be loaded and halting before any real crash happens. DNSB is right in that if your script is running outside of Sigil and not a plugin, there really is no way for Sigil to react properly here.

Last edited by KevinH; 09-06-2020 at 08:12 PM.
KevinH is offline   Reply With Quote
Old 09-07-2020, 05:39 AM   #11
HaPeSchu
Banned
HaPeSchu began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Feb 2020
Device: tolino epos
Quote:
Originally Posted by KevinH View Post
if your script is running outside of Sigil
Which isnt the case.
HaPeSchu is offline   Reply With Quote
Old 09-07-2020, 10:34 AM   #12
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by HaPeSchu View Post
Which isnt the case.
But where are the details we asked for? We can not fix a crash we can not recreate.
KevinH is offline   Reply With Quote
Old 09-07-2020, 04:51 PM   #13
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,311
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by HaPeSchu View Post
Which isnt the case.
A couple of questions:

What operating system and version of Sigil are you using? Linux, Windows, MacOSX? The current version or an older version of Sigl? Version of your OS?

How are you running your script inside Sigil? A homebrew plugin? Other technique such as using the Open with functionality from the context menu for individual files?

Generally, the more information you can give, the easier it is to reproduce and fix an issue. The difference between taking your vehicle in and saying "it makes a funny noise now and then" and "when I am driving over 40 kilometres per hour and tap the brakes, the ABS always kicks in even when I am braking gently".
DNSB is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Feature Request - Font Preview Vanguard3000 Sigil 34 03-05-2020 01:00 AM
PRS-T1 Font causing crash booklover6 Sony Reader 23 09-15-2013 05:36 PM
Image causing problems with book view corroonb Sigil 2 05-13-2013 07:32 PM
Different Adobe ID causing download problems? dandelioncottage Reading and Management 0 08-29-2012 06:46 PM
h3 causing nav problems in epub to mobi BKh Conversion 15 11-03-2011 11:15 PM


All times are GMT -4. The time now is 06:21 PM.


MobileRead.com is a privately owned, operated and funded community.