Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 03-04-2019, 07:09 AM   #1
quinta@ebf.cz
Connoisseur
quinta@ebf.cz began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Mar 2019
Device: Kindle 3 Paperwhite
display: block for image converted from docx

Hello,

seems images converted from docx to epub obtain css rule "display: block".

Such styling has negative consequences for (at least) inline images:
- image no longer appears centered (when centering is achieved by the paragraph format, eventually applaing css rule "text-align: center" to parent paragraph in epub)
- image surrounded by text appears with undesirable line breaks before and after the image itself

Can I somehow disable this behaviour? So far the workaround for me is to manually edit converted epub – delete rule "display: block" (for class applied to images).
quinta@ebf.cz is offline   Reply With Quote
Old 03-04-2019, 09:13 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,258
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No such thing, whether an image gets diplsay block or not depends on how it is styled, and positioned in the original document, see the example at: https://manual.calibre-ebook.com/con...word-documents
kovidgoyal is offline   Reply With Quote
Advert
Old 03-04-2019, 11:37 AM   #3
quinta@ebf.cz
Connoisseur
quinta@ebf.cz began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Mar 2019
Device: Kindle 3 Paperwhite
Hm. Seems the issue is somehow influented by compatibility mode of source docx.

In vanilla docx, inline image is converted as expected.
When source docx is set to compatibility mode (docx saved as doc, then saved as docx again, with "compatibility mode" option; Word 2013, 32b, czech localization), inline image is converted as "display: block". Sample docx and epub files attached.

On the other hand, original sample docx is in compatibility mode, too. And conversion issue is not detected...
Attached Files
File Type: docx Test compatibility mode.docx (13.6 KB, 93 views)
File Type: epub Test compatibility mode.epub (4.1 KB, 91 views)

Last edited by quinta@ebf.cz; 03-04-2019 at 12:19 PM. Reason: typing error
quinta@ebf.cz is offline   Reply With Quote
Old 03-04-2019, 08:08 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,258
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Does not have anything to do with compatibility mode. It depends on how the original image is sized and positioned and styled. The problem is DOCX has no conceyt of block vs inline images, so that has to be guessed based on heuristics. You can always override it for images that get wrongly guessed using th eEdit book tool.
kovidgoyal is offline   Reply With Quote
Old 03-05-2019, 03:00 AM   #5
quinta@ebf.cz
Connoisseur
quinta@ebf.cz began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Mar 2019
Device: Kindle 3 Paperwhite
Resaving test document without compatibility mode resolves the issue.
Resaving Calibre demo document in compatibility mode causes the issue appears.

Following detection method described on https://www.howtogeek.com/256269/wha...rosoft-office/, the compatibility mode versions of tested documents are the same ("Word 97-2003"). There must be some additional difference.

Anyway thank You for your assistence. The problem is quite specific and not primarily caused by Calibre.
quinta@ebf.cz is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DOCX to EPUB and Tables are not converted correctly lbdyck Conversion 4 01-17-2017 06:27 AM
Converted file to DOCX is not readable by Word HagaWaga Conversion 1 01-28-2016 11:47 AM
Display block ... why? (Question about CSS and Calibre) NASCARaddicted ePub 7 06-23-2013 09:26 PM
HTML input -<b> and <i> being converted to block elements? fluxcore Conversion 2 02-18-2011 09:36 PM
Code block view (converted from CHM) Replika Calibre 3 10-19-2010 02:08 PM


All times are GMT -4. The time now is 07:56 AM.


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