Skip to content

Commit

Permalink
Fix 2D image view (#79)
Browse files Browse the repository at this point in the history
- get file list as string and not as path

Closes: #78
  • Loading branch information
ch-sa authored Apr 30, 2022
1 parent 4bc200e commit f5b1181
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions labelCloud/view/gui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import os
import re
from pathlib import Path
from typing import TYPE_CHECKING, Set
Expand Down Expand Up @@ -434,16 +435,17 @@ def show_2d_image(self):
image_folder = config.getpath("FILE", "image_folder")

# Look for image files with the name of the point cloud
files_in_image_folder = sorted(image_folder.iterdir())
pcd_name = self.controller.pcd_manager.pcd_path.stem
image_file_pattern = re.compile(f"{pcd_name}+(\.(?i:(jpe?g|png|gif|bmp|tiff)))")

try:
image_name = next(filter(image_file_pattern.search, files_in_image_folder))
image_name = next(
filter(image_file_pattern.search, os.listdir(image_folder))
)
except StopIteration:
QMessageBox.information(
self,
"No 2d image File",
"No 2D Image File",
(
f"Could not find a related image in the image folder ({image_folder}).\n"
"Check your path to the folder or if an image for this point cloud exists."
Expand Down

0 comments on commit f5b1181

Please sign in to comment.