initial fix for filename length limits on *nix systems

parent 5cea278d
...@@ -512,6 +512,9 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i ...@@ -512,6 +512,9 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i
file_decoration = "-" + file_decoration file_decoration = "-" + file_decoration
file_decoration = namegen.apply(file_decoration) + suffix file_decoration = namegen.apply(file_decoration) + suffix
if hasattr(os, 'statvfs'):
max_name_len = os.statvfs(path).f_namemax
file_decoration = file_decoration[:max_name_len - 5]
if add_number: if add_number:
basecount = get_next_sequence_number(path, basename) basecount = get_next_sequence_number(path, basename)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment