Skip to content

RuntimeError when saving image with filename missing or not expected an extension #9

@FRiMN

Description

@FRiMN

When saving an image via the menu, if a filename is specified without an expected extension (e.g., .jpg, .png, etc.), the application raises a RuntimeError stating it cannot open the file.

Traceback (most recent call last):
  File "/home/frimn/genui/src/genui/ui_widgets/photo_viewer.py", line 183, in save_image_manual
    self.save_image(file_name)
  File "/home/frimn/genui/src/genui/ui_widgets/photo_viewer.py", line 191, in save_image
    self._save_metadata_to_image(file_path)
  File "/home/frimn/genui/src/genui/ui_widgets/photo_viewer.py", line 197, in _save_metadata_to_image
    with pyexiv2.Image(str(file_path)) as img:
  File "/home/frimn/genui/.venv/lib/python3.10/site-packages/pyexiv2/core.py", line 14, in __init__
    self._exiv2api_image = exiv2api.Image(filename.encode(encoding))
RuntimeError: /home/frimn/test: Failed to open the data source: Нет такого файла или каталога (errno = 2)

Steps to Reproduce:

  1. Open an image in the application.
  2. Select "Save Image" from the right-click menu.
  3. In the save dialog, enter a filename with unexpected or without an extension (e.g., test or test.gif instead of test.jpg).
  4. Click "Save."

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions