Skip to content

Commit e29a360

Browse files
committed
Fixed refreshing of thumbnails after saving a single image.
1 parent 59ebea8 commit e29a360

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

mrv2/docs/HISTORY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ v1.0.3
77
- Added the options to show OpenEXRs with data windows bigger than their display windows. You activate it with View->Ignore Display Window and it will reload the exr image or sequence.
88
- Improved drawing of Data and Display Window at high resolutions.
99
- Fixed zooming when Media Information was active on an image sequence.
10+
- Fixed a refresh of mrv2's custom file requester when saving a single image
11+
over a previous image file. The icon would not get refreshed previously.
1012

1113

1214
v1.0.2

mrv2/lib/mrvFLU/Flu_File_Chooser.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ void Flu_File_Chooser::previewCB()
355355
ThumbnailData* data = new ThumbnailData;
356356
data->chooser = this;
357357
data->entry = e;
358+
p.thumbnailCreator->clearCache();
358359
auto id = p.thumbnailCreator->request(
359360
fullname, time, size, createdThumbnail_cb, (void*)data);
360361
p.thumbnailIds.insert(id);
@@ -5051,6 +5052,8 @@ static const char* _flu_file_chooser(
50515052
{
50525053
Flu_File_Chooser::window->value(retname.c_str());
50535054
}
5055+
// Refresh thumbnails in case we saved a frame last time
5056+
Flu_File_Chooser::window->previewCB();
50545057
Flu_File_Chooser::window->set_modal();
50555058
Flu_File_Chooser::window->show();
50565059

mrv2/lib/mrvGL/mrvThumbnailCreator.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace mrv
4848
struct ThumbnailCreator::Private
4949
{
5050
std::weak_ptr<system::Context> context;
51-
51+
5252
struct Request
5353
{
5454
int64_t id;
@@ -80,6 +80,7 @@ namespace mrv
8080

8181
int64_t id = 0;
8282
std::vector<int64_t> cancelRequests;
83+
bool clearCache = false;
8384
size_t requestCount = 1;
8485
std::chrono::milliseconds requestTimeout =
8586
std::chrono::milliseconds(50);
@@ -252,6 +253,8 @@ namespace mrv
252253

253254
void ThumbnailCreator::clearCache()
254255
{
256+
TLRENDER_P();
257+
p.clearCache = true;
255258
}
256259

257260
void ThumbnailCreator::setTimerInterval(double value)
@@ -337,6 +340,12 @@ namespace mrv
337340
options.ioOptions["OpenEXR/IgnoreDisplayWindow"] =
338341
string::Format("{0}").arg(
339342
App::ui->uiView->getIgnoreDisplayWindow());
343+
if (p.clearCache)
344+
{
345+
options.ioOptions["clearCache"] =
346+
string::Format("{0}").arg(rand());
347+
}
348+
340349
file::Path path(request.fileName);
341350
try
342351
{
@@ -347,7 +356,6 @@ namespace mrv
347356
io::Options ioOptions;
348357
ioOptions["Layer"] =
349358
string::Format("{0}").arg(request.layer);
350-
351359
request.futures.push_back(
352360
request.timeline->getVideo(
353361
time::isValid(i)
@@ -361,14 +369,16 @@ namespace mrv
361369
catch (const std::exception& e)
362370
{
363371
// We don't print an error for EDLs as the timeline
364-
// replacement is not be atomic.
372+
// replacement is not atomic.
365373
if (!isTemporaryEDL(path))
366374
LOG_ERROR(e.what());
367375
p.running = false;
368376
continue;
369377
}
370378
}
371379

380+
p.clearCache = false;
381+
372382
// Check for finished requests.
373383
std::vector<Private::Result> results;
374384
auto requestIt = p.requestsInProgress.begin();

0 commit comments

Comments
 (0)