Skip to content

337: Filesystem browser thumbnail fallback: offscreen viewport has no render handler for supplied ImageBufPtr - #338

Closed
pleprince wants to merge 1 commit into
AcademySoftwareFoundation:developfrom
pleprince:#337-Filesystem-browser-thumbnail-fallback
Closed

337: Filesystem browser thumbnail fallback: offscreen viewport has no render handler for supplied ImageBufPtr#338
pleprince wants to merge 1 commit into
AcademySoftwareFoundation:developfrom
pleprince:#337-Filesystem-browser-thumbnail-fallback

Conversation

@pleprince

Copy link
Copy Markdown
Contributor

Linked issues

Fixes #337

Summarize your change.

Add the missing render_viewport_to_image_atom message handler to OffscreenViewport that renders a supplied media_reader::ImageBufPtr down to a thumbnail:

(render_viewport_to_image_atom, int width, int height, media_reader::ImageBufPtr)
    -> thumbnail::ThumbnailBufferPtr  // TF_RGB24

The handler renders the supplied full-resolution image through the viewport's colour-managed offscreen pipeline (renderToImageBufferRGBA_16F) and converts the result to an RGB24 ThumbnailBufferPtr via the existing rgb96thumbFromHalfFloatImage, mirroring the regular renderToThumbnail path. Invalid input (null buffer or non-positive dimensions) returns a CAF error instead of dereferencing or attempting an invalid FBO size.

File changed: src/ui/qt/viewport_widget/src/offscreen_viewport.cpp (+33 lines).

Describe the reason for the change.

When a media reader cannot produce a thumbnail buffer directly (MediaDetailAndThumbnailReaderActor::get_thumbnail_from_reader_plugin, src/media_reader/src/media_detail_and_thumbnail_reader_actor.cpp), it falls back to reading the full image and asking the offscreen viewport to render it to a thumbnail, sending:

mail(ui::viewport::render_viewport_to_image_atom_v, thumb_width, thumb_height, buf)  // buf = ImageBufPtr

OffscreenViewport had no handler for this signature, so the CAF runtime reported it as an unexpected message:

unexpected message [id: 651, name: user.scheduled-actor]: message(xstudio::ui::viewport::render_viewport_to_image_atom(), 128, 72, xstudio::media_reader::ImageBufPtr)

The failed request propagated back as an error, which the QML thumbnail provider (ThumbnailReader in src/ui/qml/helper/src/thumbnail_provider_ui.cpp) reported as "Thumbnail does not exist 2." — surfaced at the filesystem browser delegate:

qrc:/FileSystemBrowser/FileSystemBrowser/xstudio/FSThumbItem.qml:74:21: QML QQuickImage*: Thumbnail does not exist 2.

So formats that took the full-image fallback showed blank thumbnails and spammed these two messages whenever the filesystem browser loaded thumbnails.

Describe what you have tested and on which operating system.

  • Windows 10 (x64), MSVC 2022, Release.
  • The reported messages are gone: loading thumbnails in the filesystem browser no longer produces the unexpected message CAF warning or the Thumbnail does not exist 2. QML error for media that exercises the full-image fallback.

Add a list of changes, and note any that might need special attention during the review.

  • src/ui/qt/viewport_widget/src/offscreen_viewport.cpp: new (render_viewport_to_image_atom, int, int, media_reader::ImageBufPtr) handler returning ThumbnailBufferPtr (RGB24), with null/dimension validation.
  • Note for review: the new handler is intentionally signature-distinct from the existing (atom, int, int, ImageFormat) → ImageBufPtr handler — its third element is the image buffer, not a pixel format — so CAF dispatch is unambiguous. It reuses the existing renderToImageBuffer / rgb96thumbFromHalfFloatImage colour-management path; no other code was touched.

If possible, provide screenshots.

N/A — the observable change is the absence of the two console/QML error messages above.

Add a new CAF message handler to OffscreenViewport that renders a
supplied full-resolution image down to a thumbnail via the viewport's
colour-managed pipeline. The handler normalises the input image buffer
to RGBA_16F format before generating the thumbnail, and converts the
result to RGB24. This provides a fallback thumbnail generation path
for the filesystem browser when native thumbnails are unavailable.

The handler validates input dimensions and image buffers, returning a
descriptive error on invalid input, and catches any exceptions during
rendering to return them as CAF errors.

Signed-off-by: ext-philippe.leprince <ext-philippe.leprince@forticheprod.com>
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Missing ID

  • ❌ The email address for the commit (19041a5) is not linked to the GitHub account, preventing the EasyCLA check. Consult this Help Article and GitHub Help to resolve. (To view the commit's email address, add .patch at the end of this PR page's URL.) For further assistance with EasyCLA, please visit our EasyCLA portal and chat with our support bot.

@pleprince

Copy link
Copy Markdown
Contributor Author

This is not the best fix: closing.

@pleprince pleprince closed this Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant