Export as Image gives no error when image save fails (original) (raw)

Describe the bug

When using File → Export as Image, if the image file cannot be saved (due to file permissions, an invalid path, or an unsupported file extension), the dialog closes without showing any error. The user gets no indication that the export failed. This is inconsistent with map and tileset export paths, which do show error dialogs on failure.

The root cause is in exportasimagedialog.cpp — the return value of QImage::save() is not checked.

Steps to reproduce

  1. Open any map in Tiled
  2. Go to File → Export as Image...
  3. Choose a read-only directory as the save location (or use an unsupported file extension like .xyz)
  4. Click Save
  5. The dialog closes silently — no image file is created and no error is shown

Expected behavior

An error dialog should appear informing the user that the image could not be saved, similar to how other export operations (map export, tileset export) report errors when writing fails.

OS version

Windows 10

Tiled version

Latest