Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 10-23-2024, 01:05 PM   #526
philja
Addict
philja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enough
 
Posts: 265
Karma: 516
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6 & HD8
epubcheck error display is incomplete

Using Sigil 2.3.1 with epubcheck 0.4.7.1

I converted a 'no fault found' epub2 to epub3 using the plugin epub3-itizer v0.5.8 and then ran epubcheck again and was horrified to see vast numbers of pink errors, 25 of which concerned images :

Code:
OEBPS/Text/chapter10.xhtml,18,1118,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter10.xhtml,30,2338,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter10.xhtml,68,3887,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter10.xhtml,86,4610,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter10.xhtml,118,6146,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter10.xhtml,132,7188,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter10.xhtml,140,7419,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter11.xhtml,16,705,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter4.xhtml,77,3766,Col: 89: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter4.xhtml,118,8009,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter5.xhtml,17,839,Col: 89: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter5.xhtml,22,1098,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter5.xhtml,32,2127,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter6.xhtml,20,1345,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter6.xhtml,36,2282,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter6.xhtml,46,2917,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter7.xhtml,60,3084,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter7.xhtml,82,4029,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter8.xhtml,20,1171,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter8.xhtml,34,2041,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter8.xhtml,58,3444,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter8.xhtml,68,4162,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter8.xhtml,90,4786,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter8.xhtml,102,5810,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
OEBPS/Text/chapter9.xhtml,24,2111,Col: 68: ERROR(RSC-005): Error while parsing file: value of attribute ""width"" is invalid; must be an integer
All concerned epub2 code like this :

Code:
<img alt="Image 7.1" src="../Images/image017.gif" width="50%"/>
My immediate concern was about the other 50 images in the book. The rest were all in chapters 11 - 21. They all had the same type of code so why weren't they flagged up?

Subsequent tests showed that epubcheck only reports 25 of these errors at a time. Once I had corrected these 25, I ran the epubcheck plugin again and got another 25.

I imagine this is a function of the EPUBCheck v5.1.0 rather than the plugin. Could the plugin capture and display all instances of an error on the first run through?
philja is offline   Reply With Quote
Old 10-23-2024, 02:04 PM   #527
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,346
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
In the meantime, you could just do a regex search and replace to get all of the same errors:

Find: <img (.*?) width="(.*?)%"/>
Replace: <img \1 width="\2"/>


That should fix them all. The error comes from the % sign is no longer a thing for inline image styling.
Turtle91 is offline   Reply With Quote
Old 10-23-2024, 03:48 PM   #528
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: 45,921
Karma: 168959602
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
As far as I know, epubcheck will only return 25 errors of a type. For me, that is more than enough since I tend to hit regex to correct the error and that will clean up all the instances of that error.
DNSB is offline   Reply With Quote
Old 10-23-2024, 04:53 PM   #529
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: 8,734
Karma: 5703586
Join Date: Nov 2009
Device: many
But I doubt you want to convert width="50%" to width="50" as 50 pixels is much different from 50% of the screen.

Much more likely, is to remove the width attribute and replace it with either a new "class" attribute or even an inline style attribute such as style="width:50%;" or something else that sets the limit for the width of the resulting image.
KevinH is offline   Reply With Quote
Old 10-23-2024, 05:19 PM   #530
philja
Addict
philja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enough
 
Posts: 265
Karma: 516
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6 & HD8
Quote:
Originally Posted by KevinH View Post
But I doubt you want to convert width="50%" to width="50" as 50 pixels is much different from 50% of the screen.

Much more likely, is to remove the width attribute and replace it with either a new "class" attribute or even an inline style attribute such as style="width:50%;" or something else that sets the limit for the width of the resulting image.
Which is essentially what I did. I hacked together a regex FIND:

<img\s+(alt="Image .+?")\s+(src="../Images/image\d+\.gif")\s+width="(\d+)%"\s*/>

[ this also worked <img\s+(alt="[^"]*")\s+(src="[^"]*")\s+width="(\d+)%"\s*/> ]

with a REPLACE:

<img class="w\3" \2 \1/>

[This put the alt entry at the end keeping it out of the way visually when checking images later.]

Since many of the images had width=50%, I started with an additional CSS class in the style sheet :

.w50 {height: auto;width: 50%}

and then did a find/replace one at a time. This was a little tedious but pretty quick. When I came to an image with a different width %, if I then decided it would be better to keep it at that width, I just created an additional CSS style entry.

Afterwards, I was curious to find out why all the image entries were not displayed as errors by the epubcheck plugin. So I redid the epub3 conversion and investigated. I also had a look at the log and saw that it had a line:

Code:
 "message" : "Error while parsing file: value of attribute \"width\" is invalid; must be an integer",
    "additionalLocations" : 50,
I think that if some indication of the total number of errors would be displayed by the epubcheck plugin, it would be helpful to those authors who don't know how to access the log.

Last edited by philja; 10-23-2024 at 05:27 PM.
philja is offline   Reply With Quote
Old 10-24-2024, 01:33 AM   #531
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,725
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by philja View Post
Subsequent tests showed that epubcheck only reports 25 of these errors at a time. Once I had corrected these 25, I ran the epubcheck plugin again and got another 25. [...] Could the plugin capture and display all instances of an error on the first run through?
The plugin runs EPUBCheck in JSON output mode, and in that mode only the first 25 occurrences are shown. I.e., there's nothing I can do about it.
Doitsu is offline   Reply With Quote
Old 10-24-2024, 07:59 AM   #532
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: 8,734
Karma: 5703586
Join Date: Nov 2009
Device: many
And since the user typically reruns the plugin repeatedly until no more errors are reported, that works just fine. As others have pointed out, you do not need to have an error "reported" to "fix" things once an ealier error shows you a repeated general error class. That is one of the primary uses for regular expression find and replace.
KevinH is offline   Reply With Quote
Old 10-24-2024, 08:46 AM   #533
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,665
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by philja View Post
Which is essentially what I did. I hacked together a regex FIND:

<img\s+(alt="Image .+?")\s+(src="../Images/image\d+\.gif")\s+width="(\d+)%"\s*/>

[ this also worked <img\s+(alt="[^"]*")\s+(src="[^"]*")\s+width="(\d+)%"\s*/> ]

with a REPLACE:

<img class="w\3" \2 \1/>

[This put the alt entry at the end keeping it out of the way visually when checking images later.]

Since many of the images had width=50%, I started with an additional CSS class in the style sheet :

.w50 {height: auto;width: 50%}

and then did a find/replace one at a time. This was a little tedious but pretty quick. When I came to an image with a different width %, if I then decided it would be better to keep it at that width, I just created an additional CSS style entry.

Afterwards, I was curious to find out why all the image entries were not displayed as errors by the epubcheck plugin. So I redid the epub3 conversion and investigated. I also had a look at the log and saw that it had a line:

Code:
 "message" : "Error while parsing file: value of attribute \"width\" is invalid; must be an integer",
    "additionalLocations" : 50,
I think that if some indication of the total number of errors would be displayed by the epubcheck plugin, it would be helpful to those authors who don't know how to access the log.
You would solve the IMG problem by removing the width and replacing it with a class. Then all you would need to do is fix that one classes as needed. Plus, converting to ePub3 would work.
JSWolf is offline   Reply With Quote
Old 10-24-2024, 03:32 PM   #534
philja
Addict
philja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enough
 
Posts: 265
Karma: 516
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6 & HD8
Quote:
Originally Posted by JSWolf View Post
You would solve the IMG problem by removing the width and replacing it with a class. Then all you would need to do is fix that one classes as needed. Plus, converting to ePub3 would work.
Hey Jon - that's what I did and what is shown in my earlier post that you quote in yours. Maybe I phrased it badly? I rationalised some widths and ended up with 4 additions to the classes in the styles.css sheet: .w50, .w70, .w80, .w95.

Had I been a bit more competent, I'd have found a way to automate the creation of each new class. As it was, I wrote the first one, (.w50) and copy / pasted 3 copies which just needed the number changing in the name and width.
philja is offline   Reply With Quote
Old 03-21-2025, 11:32 AM   #535
Koen_new
Junior Member
Koen_new began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2025
Device: Kobo
EPUBCheck 5.2.1 Java Error

After a complete reinstall on my PC, I now get this error when I try to run the epubcheck plugin:

Status: failed

Running EPUBCheck 5.2.1... please wait.
EPUBCheck Java error.
java.lang.StackOverflowError
at com.thaiopensource.relaxng.pattern.DuplicateAttrib uteDetector.startChoice(DuplicateAttributeDetector .java:42) etc...


sigil version: 2.4.2
java version: 1.8.0.441

other plugins work OK, so I don't understand what I', doing wrong.

Any suggestions?
Attached Thumbnails
Click image for larger version

Name:	EpubCheckError.jpg
Views:	77
Size:	60.0 KB
ID:	214501  
Koen_new is offline   Reply With Quote
Old 03-21-2025, 12:04 PM   #536
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: 8,734
Karma: 5703586
Join Date: Nov 2009
Device: many
You are probably using a 32 bit version of Java instead of a 64 bit version of java, resulting in very small stacks which overflowed.

Try removing that 32 bit version of java and install a 64 bit version of java.

Alternatively there are extra options to tell the 32 bit version of java to use larger stacks, but everything is 64 bits now so upgrading to 64 bit should be the better solution.

Last edited by KevinH; 03-21-2025 at 12:18 PM.
KevinH is offline   Reply With Quote
Old 03-21-2025, 12:18 PM   #537
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,725
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Koen_new View Post
After a complete reinstall on my PC, I now get this error when I try to run the epubcheck plugin:
As KevinH has already pointed out, this error is usually displayed if a 32bit Java version is installed.

You either change the following setting:
Code:
  "is32bit": false
to true:
Code:
  "is32bit": true
(for more information see the first post in this post)

or you could simply uninstall the current Java version and install the latest 64bit Java version.
Doitsu is offline   Reply With Quote
Old 03-21-2025, 12:30 PM   #538
Koen_new
Junior Member
Koen_new began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2025
Device: Kobo
Quote:
Originally Posted by KevinH View Post
You are probably using a 32 bit version of Java instead of a 64 bit version of java, resulting in very small stacks which overflowed.

Try removing that 32 bit version of java and install a 64 bit version of java.

Alternatively there are extra options to tell the 32 bit version of java to use larger stacks, but everything is 64 bits now so upgrading to 64 bit should be the better solution.
changing to the 64 bit version of java worked, thanks!
Koen_new is offline   Reply With Quote
Old 04-18-2025, 05:21 PM   #539
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: 45,921
Karma: 168959602
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I was noticing that epubcheck in Sigil does not offer me the update to 5.2.1 which fixes the regression that was flagging mailto: links as errors. I manually installed it back in January and didn't think about it until now when I did a new Sigil install on a virtual machine and got a mailto: error on the first epub I checked. calibre's editor did suggest the update.

Update check is true in the prefs file and last_time_checked shows as about 5 minutes ago when I last ran epubcheck.
DNSB is offline   Reply With Quote
Old 04-19-2025, 08:45 AM   #540
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,725
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by DNSB View Post
I was noticing that epubcheck in Sigil does not offer me the update to 5.2.1
I wasn't able to reproduce this problem.

I just replaced the EPUBCheck files in the plugin folder with the EPUBCheck v5.1.0 files and changed the year of last_time_checked to:

Code:
  "last_time_checked": "2024-04-19 14:28:46.465902",
and when I ran the plugin, it downloaded and installed 5.2.1.

BTW, you can always force an upgrade by deleting the lib folder in the plugin folder.
Doitsu is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] PunctuationSmarten Sigil plugin DiapDealer Plugins 138 07-11-2023 11:22 AM
[Plugin] KindleImport Sigil plugin DiapDealer Plugins 187 07-04-2022 10:11 AM
Sigil Plugin Index Thasaidon Plugins 0 10-04-2014 07:41 AM
FC and Sigil 0.5.3 ePUBcheck failure Hitch Sigil 32 04-17-2012 02:56 AM
Web-based epubcheck upgraded to epubcheck 1.0.5 kjk ePub 4 02-09-2010 09:53 PM


All times are GMT -4. The time now is 05:30 PM.


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