Converting EPUB to DOCX Results in Small Images

Bug #1715807 reported by Ukie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Expired
Undecided
Unassigned

Bug Description

When converting EPUB books to DOCX, often times the images are noticeably smaller in DOCX than they were originally in EPUB.
Would it be possible upscale them by default to around 30–50%?

Thank you!

Revision history for this message
Ukie (ukiews) wrote :

Something to keep in mind is that there are two types of images that Word recognizes: "Shapes" and "InlineShapes"
I have written a macro (below) to do this, but it would be much more convenient to add the option under "DOCX output" in Caliber.

Sub UpscaleAllImages()
Dim i As Long
With ActiveDocument
    q = .InlineShapes.Count
    r = .Shapes.Count
    countMsg = MsgBox("There Are " & q + r & " Images found. Proceed to Upscale?", vbYesNo)
    If countMsg = vbNo Then End

    For i = 2 To .Shapes.Count 'Skip first image (cover)

        With .Shapes(i)
            .ScaleHeight 1.4, msoFalse
            .ScaleWidth 1.4, msoFalse
        End With
    Next i

    For j = 2 To .InlineShapes.Count 'Skip firt image (cover)
    With .InlineShapes(j)
            .ScaleHeight = 80
            .ScaleWidth = 80
        End With
    Next j

End With
End Sub

Ukie (ukiews)
description: updated
Vadim (vadimchp5)
Changed in calibre:
status: New → Confirmed
status: Confirmed → New
Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1715807

calibre generally tries to preserve the formatting of input documents as
much as possible. The imaging models of EPUB and DOCX are very different
so a one-to-one conversion is not always possible. That said if you
provide some example documents, I can take a look at improving the
translation heuristics for image sizes.

  status incomplete

Changed in calibre:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for calibre because there has been no activity for 60 days.]

Changed in calibre:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.