github dheerajshenoy/lektra v0.7.2

6 hours ago

Features

  • Add Lua API view:export_highlights(path) that serialises all highlight annotations to
    a JSON file. Each entry contains page (1-based), text, and optionally comment.
    Returns true on success or nil, error on failure.

Bug Fixes

  • Fix crash when right-clicking on the overlay scrollbar — right-click events were
    unconditionally forwarded to the scrollbar, causing its built-in context menu
    (QMenu::exec) to spin a nested event loop while GraphicsView::contextMenuEvent
    also fired, leading to a double-menu crash. Non-left-button clicks on the scrollbar
    are now silently ignored.
  • Fix animated GIF frames being skipped: QImageReader::read() auto-advances the frame
    position for animated formats, so the subsequent jumpToNextImage() call was
    double-advancing and skipping every other frame.
  • Fix animated GIF playback running at ~1.5× speed: the elapsed clock was started before
    the first timer fired, so the first callback measured ~100 ms of wait time as "render
    overhead" and scheduled the next frame at 0 ms delay. Subsequent frames alternated
    between 0 ms and ~95 ms, averaging half the intended interval. The clock is now
    restarted at the top of each callback so it measures only actual render overhead.
  • Fix image files always rendering blurry: pixel dimensions were stored directly as
    typographic points in the page dimension cache, causing pageSceneSize and
    repositionPages to apply an extra ×(dpi/72) upscale on every render. Dimensions
    are now converted to pts (px * 72 / dpi) on load, matching the DjVu path.
  • Fix image zoom leaving blurry pixels: setZoomAnchored for images only applied a
    Qt scene-transform scale and never triggered a pixel-level re-render. The HQ render
    timer is now started after each anchor zoom so that, once zoom settles, renderImage
    re-renders at the exact target dimensions using Qt::SmoothTransformation.
  • Add collectHighlightTexts() on Model returning a std::vector<HighlightText> with
    page, text, comment, and quad fields. Multi-line highlights are grouped into a
    single entry (lines joined with a space) rather than one entry per line.

Performance

  • Animated GIF memory usage reduced from O(all frames) to O(1 frame): switched from
    pre-decoding every frame into a QList<QImage> buffer to QMovie with
    CacheMode::CacheNone, which decodes one frame at a time on demand. The manual
    timer and elapsed-clock machinery is replaced by QMovie::frameChanged.

SVG Rendering

  • SVG files are now rendered via librsvg + Cairo when available, with automatic fallback
    to Qt's QSvgRenderer. librsvg is probed at runtime using QLibrary (no build-time
    dependency, no configuration flag) — if librsvg-2.so.2 and libcairo.so.2 are
    installed on the system they are used automatically, otherwise rendering falls back
    silently. librsvg handles CSS class-based styles, <switch> fallback elements, and
    CSS functions such as light-dark() that Qt's renderer ignores, producing correct
    output for SVGs generated by tools like draw.io.

DjVu

  • DjVu support is now detected at runtime via QLibrary instead of requiring a
    compile-time WITH_DJVU flag and a link-time dependency on libdjvulibre.
    If it is installed on the system, DjVu files are opened automatically;
    if it is absent, DjVu is silently unavailable. The WITH_DJVU CMake option and the
    HAS_DJVU preprocessor define have been removed.

Breaking Changes

  • Remove ImageMagick dependency as it's a headache to maintain and to link against for cross-platform compatibility.
  • Removed lektra.capabilities table as it's not useful

Don't miss a new lektra release

NewReleases is sending notifications on new releases.