Skip to content

Commit

Permalink
Merge pull request #8503 from mcmonkey4eva/filename-length-limit-fix
Browse files Browse the repository at this point in the history
Add correction file filename length limits on *nix systems
  • Loading branch information
AUTOMATIC1111 authored Mar 14, 2023
2 parents 6a04a7f + af9158a commit a9fed7c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,11 @@ def _atomically_save_image(image_to_save, filename_without_extension, extension)
os.replace(temp_file_path, filename_without_extension + extension)

fullfn_without_extension, extension = os.path.splitext(params.filename)
if hasattr(os, 'statvfs'):
max_name_len = os.statvfs(path).f_namemax
fullfn_without_extension = fullfn_without_extension[:max_name_len - max(4, len(extension))]
params.filename = fullfn_without_extension + extension
fullfn = params.filename
_atomically_save_image(image, fullfn_without_extension, extension)

image.already_saved_as = fullfn
Expand Down

6 comments on commit a9fed7c

@ma-kun2017
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cute seaside girl

@ma-kun2017
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cute seaside girl

@githubUser01946
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cute seaside girl

It's not how github works.

@Flamma7103
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i need help i have this problem ImportError: DLL load failed while importing cv2:The specified module can not be found

@LorenzoMattiussi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cute seaside girl

bruh

@Barnplaid
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cute seaside girl

It's not how github works.

For now.

Please sign in to comment.