github rupor-github/fb2cng v2.1.0

42 minutes ago

Image Processing and Kobo Spacing Improvements

New image-processing options

  • Proportional cover filling — document.images.cover.resize: fill
    Enlarge or shrink covers proportionally until both configured screen dimensions are covered. Unlike stretch, this preserves proportions; unlike fit, it may leave excess pixels beyond the screen bounds. No pixels are cropped or padded by the converter.

  • Body-image screen limiting — document.images.fit_to_screen: true
    Limit body images to the configured screen dimensions while preserving proportions. This composes with scale_factor: calculate the scaled size first, then apply the screen limit in a single resize. Small images are enlarged only when explicitly requested by a scale factor above 1. Existing PDF SVG sizing remains unchanged.

  • Baseline JPEG compatibility — document.images.baseline_jpeg: true
    Convert decodable non-baseline JPEGs, including progressive JPEGs, for readers with limited JPEG support. Applies to covers and illustrations independently of optimize. Already-baseline JPEGs remain untouched unless another operation requires processing.

  • Grayscale conversion — document.images.grayscale: luma
    Convert raster covers and illustrations using brightness-weighted RGB values. JPEG output uses single-channel grayscale; PNG transparency is preserved without darkening partially transparent colors. Rasterized SVGs are included, but native vector artwork and text colors remain unchanged. Supported values are none and luma.

JPEG re-encoding uses jpeg_quality_level, is lossy, and does not guarantee smaller files. Combined processing requests share the final encoding pass.

Kobo empty-line spacing

Explicit 1em-high spacers are now the default for body empty lines in KEPUB and KEPUB3, preventing consecutive empty-line margins from collapsing together. No configuration switch is required.

This changes the Kobo default, not the available formatting capabilities: empty-line spacing has always been controlled through the standard stylesheet. Custom stylesheets can adjust the spacing or apply the same approach to ordinary EPUB and AZW3. Page-boundary behavior remains reader-dependent.

Defaults and documentation

  • Existing image-processing defaults remain unchanged.
  • Image-handling documentation explains the new options, interactions, and limitations.
  • Stylesheet documentation covers empty-line spacing and customization.
  • The sample FB2 includes labeled examples with one, two, and three consecutive empty lines.

Full Changelog: v2.0.1...v2.1.0

Don't miss a new fb2cng release

NewReleases is sending notifications on new releases.