attribute style redefined

Image generation in epub3 does not display in nook or “Books” on iOS 14.4.
In Books, an error message is displayed “Attribute style redefined”. The generated ePub does not validate. Upon inspection of the source, I can see “

dsc_0147_whitesandbeach_resized

This seems to occur only on images that are resized. On images that are not resized, I see :

IMG_0692_Laborers-300x196

Note: I pasted xhtml clips from the epub doc. If you do see them, you probably have to view the source in the browser.

The resizing mentioned occurs in Scrivener, I suppose?

If so, you can avoid it by not using width, height, or % options such as <$img:w=673>. Instead, you can resize the image outside of Scrivener before dragging it in or refer to it with an external pathname.

You may benefit from checking my workflow for managing images:

https://www.notion.so/deepspacecorps/Managing-Images-in-Scrivener-c0d536a7edd94d2b81a789f4d4d7d606

Yes, Scrivener is the tool I am reporting on.

Thank you for the link and the advice. I don’t use any html tags explicitly in my project, they are automatically generated. The compiled resizing is very convenient but I can see the value in not designing for a one size fits all targets solution.

If I had to, I could just go in and fix the code, removing the duplicate tags. The epub validation tool gives me all the spots where the problems occur.

Hi guys, I could not reproduce the double-style attribute issue. It is most likely due to a combination of compile options.
Could you please upload a demo project with one document and the compile format being used that will help us reproduce the problem. Thanks!

Did someone manage to reproduce this issue, guys?

Curiously, when I copy the project and reduce the size, the code generation is not the same. Two examples are provided below. So, it doesn’t appear that I can replicate the problem. I can give you access to the project and generated file (~5GB). What about the project size would cause the code generation to change?

body2.html(22,116)
original:

DSC_0493_ButterflEyes

reduced project:

DSC_0493_ButterflEyes

body9.html(15,143)
original:

IMG_4663-2_MoonRiseBW-720x540

reduced:

IMG_4663-2_MoonRiseBW-720x540

Note: I downloaded the latest beta version and the problem still manifests.

Using command:
java -jar …\epubcheck-4.2.4\epubcheck.jar TheUnabridgedDictionaryOfRegurgitations.epub 2> bugs.txt
Validating using EPUB version 3.2 rules.

FATAL(RSC-016): TheUnabridgedDictionaryOfRegurgitations.epub/OPS/body2.xhtml(22,116): Fatal Error while parsing file: Attribute “style” was already specified for element “img”.
ERROR(RSC-005): TheUnabridgedDictionaryOfRegurgitations.epub/OPS/body2.xhtml(-1,-1): Error while parsing file: Attribute “style” was already specified for element “img”.
FATAL(RSC-016): TheUnabridgedDictionaryOfRegurgitations.epub/OPS/body9.xhtml(15,143): Fatal Error while parsing file: Attribute “style” was already specified for element “img”.
ERROR(RSC-005): TheUnabridgedDictionaryOfRegurgitations.epub/OPS/body9.xhtml(-1,-1): Error while parsing file: Attribute “style” was already specified for element “img”.
FATAL(RSC-016): TheUnabridgedDictionaryOfRegurgitations.epub/OPS/body10.xhtml(15,131): Fatal Error while parsing file: Attribute “style” was already specified for element “img”.
ERROR(RSC-005): TheUnabridgedDictionaryOfRegurgitations.epub/OPS/body10.xhtml(-1,-1): Error while parsing file: Attribute “style” was already specified for element “img”.
FATAL(RSC-016): TheUnabridgedDictionaryOfRegurgitations.epub/OPS/body11.xhtml(15,127): Fatal Error while parsing file: Attribute “style” was already specified for element “img”.
ERROR(RSC-005): TheUnabridgedDictionaryOfRegurgitations.epub/OPS/body11.xhtml(-1,-1): Error while parsing file: Attribute “style” was already specified for element “img”.
FATAL(RSC-016): TheUnabridgedDictionaryOfRegurgitations.epub/OPS/body19.xhtml(17,114): Fatal Error while parsing file: Attribute “style” was already specified for element “img”.
ERROR(RSC-005): TheUnabridgedDictionaryOfRegurgitations.epub/OPS/body19.xhtml(-1,-1): Error while parsing file: Attribute “style” was already specified for element “img”.

If you copy/paste the project and remove all documents but the one with the images producing the broken “img” tag, should be sufficient. Feel free to send an archived copy of the complete project to me in a private message, if it still contains sensitive info. Thanks!

Hi again ANGELMI,

After checking your demo project and looking at the generated code in your double style examples again, it seems like another tool is messing with the HTML,

We always write attributes in width/height attribute order, but the doubled style attribute writes the attributes in reverse order i.e. “height/width” (most likely alphabetical order). This makes me feel like that the second style attribute is not generated from Scrivener.

The length of the document should not be a problem, but if you have a very long document it might be that some other HTML Scrivener processing is messing the style attribute too.

Please try to duplicate the problem in a project and send it to us to investigate this further, but at the moment I am out of ideas how to trace this further.