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, 02:05 PM   #526
philja
Groupie
philja began at the beginning.
 
Posts: 177
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6
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, 03: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,219
Karma: 19000635
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, 04: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: 40,417
Karma: 156982136
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, 05: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,156
Karma: 5450818
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, 06:19 PM   #530
philja
Groupie
philja began at the beginning.
 
Posts: 177
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6
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 06:27 PM.
philja is offline   Reply With Quote
Old 10-24-2024, 02: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,640
Karma: 23191067
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, 08: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,156
Karma: 5450818
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, 09: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: 76,337
Karma: 136006010
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, 04:32 PM   #534
philja
Groupie
philja began at the beginning.
 
Posts: 177
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6
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
Reply


Forum Jump

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


All times are GMT -4. The time now is 07:26 PM.


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