337: Filesystem browser thumbnail fallback: offscreen viewport has no render handler for supplied ImageBufPtr - #338
Closed
pleprince wants to merge 1 commit into
Conversation
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>
|
Contributor
Author
|
This is not the best fix: closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issues
Fixes #337
Summarize your change.
Add the missing
render_viewport_to_image_atommessage handler toOffscreenViewportthat renders a suppliedmedia_reader::ImageBufPtrdown to a thumbnail:The handler renders the supplied full-resolution image through the viewport's colour-managed offscreen pipeline (
renderToImageBuffer→RGBA_16F) and converts the result to an RGB24ThumbnailBufferPtrvia the existingrgb96thumbFromHalfFloatImage, mirroring the regularrenderToThumbnailpath. 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:OffscreenViewporthad 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 (
ThumbnailReaderinsrc/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.
unexpected messageCAF warning or theThumbnail 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 returningThumbnailBufferPtr(RGB24), with null/dimension validation.(atom, int, int, ImageFormat) → ImageBufPtrhandler — its third element is the image buffer, not a pixel format — so CAF dispatch is unambiguous. It reuses the existingrenderToImageBuffer/rgb96thumbFromHalfFloatImagecolour-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.