diff --git a/PB/include/pb/image/ImageFactory.h b/PB/include/pb/image/ImageFactory.h index 8fd6401ac..25e661732 100644 --- a/PB/include/pb/image/ImageFactory.h +++ b/PB/include/pb/image/ImageFactory.h @@ -18,6 +18,7 @@ class ImageFactory final { std::shared_ptr durableHashService); std::shared_ptr createRegularImage(Path path); + std::shared_ptr createRegularImage(std::string hash); std::shared_ptr createTextImage(Path path, std::string hash); GenericImagePtr createImage(Path path); diff --git a/PB/src/CollageMakerJob.cpp b/PB/src/CollageMakerJob.cpp index c486350e0..10f0c451a 100644 --- a/PB/src/CollageMakerJob.cpp +++ b/PB/src/CollageMakerJob.cpp @@ -107,12 +107,6 @@ void CollageMakerJob::onTaskFinished(PBDev::MapReducerTaskId reducerTaskId) if (mCollagePath.find(reducerTaskId) != mCollagePath.end()) { PBDev::basicAssert(mProject != nullptr); - auto coreHash = mDurableHashService->getHash( - PBDev::ProjectId(mProject->first), mCollagePath.at(reducerTaskId)); - - auto imageHash = - mPlatformInfo->thumbnailByHash(mProject->first, coreHash, ".jpg"); - auto newHash = boost::uuids::to_string(boost::uuids::random_generator()()); auto maybeNewHash = ThumbnailsTask::createThumbnailsByPath( @@ -122,17 +116,9 @@ void CollageMakerJob::onTaskFinished(PBDev::MapReducerTaskId reducerTaskId) auto newImage = mImageFactory->createRegularImage(mCollagePath.at(reducerTaskId)); - std::function onFinished = - [this, newImage{newImage}](unsigned width, unsigned height) { - mListener->onCollageCreated(newImage); - }; - - ImportImageTask importImageTask( - newImage->full(), newImage->medium(), newImage->smaLL(), onFinished, - mPlatformInfo->screenSize.first, mPlatformInfo->screenSize.second, - std::stop_source().get_token()); + spdlog::info("Collage created {}", newImage->full().string()); - importImageTask(); + mListener->onCollageCreated(newImage); } } diff --git a/PB/src/ImageFactory.cpp b/PB/src/ImageFactory.cpp index 9d648525e..03747dbd2 100644 --- a/PB/src/ImageFactory.cpp +++ b/PB/src/ImageFactory.cpp @@ -31,6 +31,11 @@ std::shared_ptr ImageFactory::createRegularImage(Path path) return regularImage; } +std::shared_ptr ImageFactory::createRegularImage(std::string hash) +{ + return std::make_shared(hash, Path()); +} + std::shared_ptr ImageFactory::createTextImage(Path path, std::string hash) {