Skip to content

Commit

Permalink
dev: Configure ImageFactory project, fix the missing jpg when creatin…
Browse files Browse the repository at this point in the history
…g an image.
  • Loading branch information
cosmin42 committed Jan 14, 2024
1 parent 517cdda commit 3f744b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions PB/src/ImageFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ std::shared_ptr<TextImage> ImageFactory::createTextImage(Path path)
image = PB::Process::addText({3508 / 2, 2480 / 2}, path.stem().string(),
{0, 0, 0})(image);

auto imagePath = VirtualImage::platformInfo->localStatePath / "th" /
mProject->active().pathCache.hashCreateIfMissing(path);
auto imagePath =
VirtualImage::platformInfo->localStatePath / "th" /
(mProject->active().pathCache.hashCreateIfMissing(path) + ".JPG");

Process::imageWriteThumbnail(image, imagePath);

Expand Down
2 changes: 2 additions & 0 deletions PB/src/PhotoBook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ void Photobook::configure(ImageMonitorListener *listener)
void Photobook::configure(std::shared_ptr<PB::Project> project)
{
mImportLogic.configure(mProjectPersistence.currentProject());
ImageFactory::inst().configure(mProjectPersistence.currentProject());
}

void Photobook::loadProject()
Expand Down Expand Up @@ -180,6 +181,7 @@ void Photobook::newProject(std::string name)
// updated
mProjectPersistence.newProject(name, std::make_shared<Project>());
mImportLogic.configure(mProjectPersistence.currentProject());
ImageFactory::inst().configure(mProjectPersistence.currentProject());
}

void Photobook::onMappingStarted(Path path) { mParent->onMappingStarted(path); }
Expand Down

0 comments on commit 3f744b7

Please sign in to comment.