Viewer fails to save a JPEG with non-JPEG filename extension
Submitted by Jani Uusitalo
== Steps to reproduce ==
- Download https://upload.wikimedia.org/wikipedia/commons/thumb/e/e1/Car_crash_1.jpg/193px-Car_crash_1.jpg?download
- Open the image in Shotwell Viewer: $ shotwell 193px-Car_crash_1.jpg
- Select File > Save As...
- Keep/set Format as "Current", don't change any other parameters
- Enter "193px-Car_crash_1.png" (without quotes) as the filename, select OK
== What happens == The viewer now displays a black screen, with the text "Photo source file missing:" followed by the (.png-ending) image path entered in the dialog. The file has not been saved.
== What I expect to happen == For the (now misnamed) .png-ending file to have been saved, and be opened in the Viewer.
== Other notes ==
- If an image file with the .png ending already exists, and I choose to overwrite it with the JPEG, the black error screen does not appear; instead the previously-existing PNG image file is then opened in the viewer.
- I'm (intentionally) not doing an actual Format change in the first Save As dialog here. If I do select PNG as the format, then saving the file does work as expected (using any filename extension).
- I used .png just as an example here. Using any variant of /jpe?g/i as the extension seems to work as expected (i.e. the file is saved under the new name), whereas anything else (.gif, .foo etc.) results in the same "file missing" error as above.
- If the original file is a PNG file, saving it with .jpg (or any other extension for that matter) seems to work as expected (i.e the file is saved under the new name, with the now-incorrect extension).
(My original report at Launchpad: https://bugs.launchpad.net/ubuntu/+source/shotwell/+bug/1710641#. I tweaked some details for the report above, with Shotwell 0.27.4 currently in Bionic.)