Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docx: use proper DPI for fallback PNG #9288

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Commits on Dec 27, 2023

  1. hlint: fix some warnings

    edwintorok committed Dec 27, 2023
    Configuration menu
    Copy the full SHA
    4aef107 View commit details
    Browse the repository at this point in the history
  2. log(svgToPng): log calls to rsvg-convert with --trace

    Signed-off-by: Edwin Török <[email protected]>
    edwintorok committed Dec 27, 2023
    Configuration menu
    Copy the full SHA
    0c88562 View commit details
    Browse the repository at this point in the history
  3. refactor(svgToPng): introduce PandocMonad.svgToPng

    This will be needed to run the conversion inside the PandocMonad,
    where we know the desired image size.
    
    The arguments are: (dpi, width, height).
    The width and height is optional to more easily convert existing code.
    
    [API change]
    
    Signed-off-by: Edwin Török <[email protected]>
    edwintorok committed Dec 27, 2023
    Configuration menu
    Copy the full SHA
    682f972 View commit details
    Browse the repository at this point in the history
  4. fix(docx): use proper DPI when creating fallback images

    Introduce getOrCreateFallback, and pass the desired size in points to
    rsvg-convert.
    Otherwise it'll guess the size based on the SVG's viewbox and completely
    ignore the DPI argument.
    
    Signed-off-by: Edwin Török <[email protected]>
    edwintorok committed Dec 27, 2023
    Configuration menu
    Copy the full SHA
    0f45ea1 View commit details
    Browse the repository at this point in the history
  5. test(docx): add PNG fallback generation test for SVG

    Just look at --trace output.
    Can't use a golden test because the actual .png will be different
    depending on rsvg-convert version.
    
    Signed-off-by: Edwin Török <[email protected]>
    edwintorok committed Dec 27, 2023
    Configuration menu
    Copy the full SHA
    d56f9bb View commit details
    Browse the repository at this point in the history
  6. fix(docx): honour percentage widths for SVG images

    Signed-off-by: Edwin Török <[email protected]>
    edwintorok committed Dec 27, 2023
    Configuration menu
    Copy the full SHA
    438a451 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    39cc916 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1e2dbf9 View commit details
    Browse the repository at this point in the history