Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview is not shown when filename contains colons #189

Closed
nivit opened this issue Oct 1, 2024 · 8 comments
Closed

Preview is not shown when filename contains colons #189

nivit opened this issue Oct 1, 2024 · 8 comments
Assignees
Labels
bug Something isn't working Conversion

Comments

@nivit
Copy link

nivit commented Oct 1, 2024

Describe the bug

  1. the original image is not shown when the temporary directory contains a dot.
  2. the preview of the new/converted image is not shown when the filename contains colons

To Reproduce

Steps to reproduce the behavior:

  1. mkdir ~/.tmp
    env TMPDIR=~/.tmp fotokilof
    (load an image)
    In the log file ~/.fotokilof.log appears the message:
*** ERROR: preview_orig: Cannot load preview
  1. Try to load an image whose filename contains a colon; then the image is loaded, but when you execute a transformation the preview of the new image is not shown, and the app raises an exception:
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/tkinter/__init__.py", line 1967, in __call__
    return self.func(*args)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fotokilof/__main__.py", line 525, in convert_bw_button
    preview_new(path_to_file_out(0))
  File "/usr/local/lib/python3.11/site-packages/fotokilof/__main__.py", line 259, in preview_new
    gui.copy_to_clipboard(file_out, OS)
  File "/usr/local/lib/python3.11/site-packages/fotokilof/gui.py", line 51, in copy_to_clipboard
    image = Image.open(file_in)
            ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/PIL/Image.py", line 3431, in open
    fp = builtins.open(filename, "rb")
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: /usr/home/nivit/FotoKilof/20241001T105501:screenshot.jpeg

Desktop

  • OS: FreeBSD
  • Version 14.1-RELEASE
  • FotoKilof version: 5.0.5
@TeaM-TL TeaM-TL self-assigned this Oct 1, 2024
@TeaM-TL TeaM-TL added bug Something isn't working Conversion labels Oct 1, 2024
@TeaM-TL TeaM-TL added this to FotoKilof Oct 1, 2024
@github-project-automation github-project-automation bot moved this to To do in FotoKilof Oct 1, 2024
@TeaM-TL
Copy link
Owner

TeaM-TL commented Oct 1, 2024

Many thanks for this bug report, I will fix it asap

@TeaM-TL
Copy link
Owner

TeaM-TL commented Oct 2, 2024

fixed in 5.0.6. please test if really fixed

@TeaM-TL
Copy link
Owner

TeaM-TL commented Oct 2, 2024

Linux has no problem with colon in filename, but macos stiil has problem :-(
Under Windows is ok, because is imposible to add colon into filename

@nivit
Copy link
Author

nivit commented Oct 3, 2024

Hi, I can confirm that the issue with the dots has been fixed, but the problem with the colons is still there unfortunately. :-(

@nivit
Copy link
Author

nivit commented Oct 3, 2024

Maybe it is an issue of the Wand library, because if I force to use PILLOW all works fine. Besides if you try the first example at this page by replacing the output filename mona-lisa-{0}.png with mona:lisa-{0}.png, then the generated images have names lisa-1.png, lisa-2.png, etc. ; that is it discards the beginning part mona:.

EDIT: There is already a closed issue, and a possibile solution.

@TeaM-TL
Copy link
Owner

TeaM-TL commented Oct 3, 2024

Many thanks for deep tests and looking for solution. I will correct code as was adviced

@TeaM-TL
Copy link
Owner

TeaM-TL commented Oct 3, 2024

I think that this issue has been fixed in 5.0.7

@nivit
Copy link
Author

nivit commented Oct 3, 2024

I can confirm, thanks a lot!

@nivit nivit closed this as completed Oct 3, 2024
@github-project-automation github-project-automation bot moved this from To do to Done in FotoKilof Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Conversion
Projects
Status: Done
Development

No branches or pull requests

2 participants