On Wed, May 16, 2018 at 01:43:45PM -0400, Richard Kimberly Heck wrote: > I think you are right that it is during metrics. Tracing some things, > RenderGraphic::metrics seems to be responsible for starting the preview, > and it gets called from InsetGraphics::metrics. > > But maybe it is as easy as expanding the cases for which we check in > graphics::Loader::startLoading?
I tried this but it doesn't seem to work (see preview3.diff). However, the patch preview2.diff should accomplish the same goal and it seems to work. -- Enrico
diff --git a/src/graphics/GraphicsCacheItem.cpp b/src/graphics/GraphicsCacheItem.cpp index f54ce80ec3..9f7d246e43 100644 --- a/src/graphics/GraphicsCacheItem.cpp +++ b/src/graphics/GraphicsCacheItem.cpp @@ -145,6 +145,8 @@ FileName const & CacheItem::filename() const bool CacheItem::tryDisplayFormat() const { + if (pimpl_->status_ == Converting) + return false; if (pimpl_->status_ != WaitingToLoad) pimpl_->reset(); FileName filename;
diff --git a/src/graphics/GraphicsLoader.cpp b/src/graphics/GraphicsLoader.cpp index 683f0925fc..3c64c88379 100644 --- a/src/graphics/GraphicsLoader.cpp +++ b/src/graphics/GraphicsLoader.cpp @@ -299,7 +299,8 @@ void Loader::reset(Params const & params) const void Loader::startLoading() const { - if (pimpl_->status_ != WaitingToLoad || !pimpl_->cached_item_) + if (pimpl_->status_ != WaitingToLoad || !pimpl_->cached_item_ + || pimpl_->status_ == Converting) return; pimpl_->startLoading(); }