Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
- Supported image file types: PNG, JPEG, bitmaps, WebP, and [more](https://docs.opencv.org/4.8.0/d4/da8/group__imgcodecs.html#imread).
- Images can be any size and ratio.
- Images are matched in alphanumerical order.
- Note that this can lead to discrepancies between the order of file as seen in your file browser and the order of Split Images in AutoSplit.
- Windows Explorer displays files in [Natural sort order](https://en.wikipedia.org/wiki/Natural_sort_order).
- On UNIX-based systems, it depends on your file browser.
- Recommended filenaming convention: `001_SplitName.png, 002_SplitName.png, 003_SplitName.png`...
- Custom split image settings are handled in the filename. See how [here](#custom-split-image-settings).
- To create split images, it is recommended to use AutoSplit's Take Screenshot button for accuracy. However, images can be created using any method including Print Screen and [Snipping Tool](https://support.microsoft.com/en-us/help/4027213/windows-10-open-snipping-tool-and-take-a-screenshot).
Expand Down
11 changes: 7 additions & 4 deletions src/split_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,18 @@ def __get_images_from_directory(directory: "StrPath"):
Returns a list of AutoSplitImage parsed from a directory.
Hidden files, system files and folders are silently ignored.
"""
file_paths = (
file_paths = [
os.path.join(directory, filename) # format: skip
for filename in os.listdir(directory)
)
filtered_image_paths = (
]
filtered_image_paths = [
image_path # format: skip
for image_path in file_paths
if is_user_file(image_path)
)
]
# On Linux, os.listdir doesn't list files in alphanumerical order.
# On Windows, os.listdir is already alphanumerical, but let's ensure consistency across OSes.
filtered_image_paths.sort()
return [AutoSplitImage(image_path) for image_path in filtered_image_paths]


Expand Down