If you save a snapshot as file.pdf it does so without complaint but the file is a PNG image. Would be nice if it warned about an unsupported image type.
Does .pdf appear in the list of supported types?
(In reply to comment #1) > Does .pdf appear in the list of supported types? No.
I am puzzled how this should be solved. Since ".pdf" is not listed as a supported file type, the file dialog does not know that .pdf is the extension of a different file type. Let's say you try to save an image as "my.new.test". What should it do? Reject the file name, because it ends in ".test", which is not known as a file type?
I think it is up to your code to check that the file type returned by the save dialog is still valid. It looks like you can use KFileDialog::currentMimeFilter() (http://api.kde.org/4.x-api/kdelibs-apidocs/kio/html/classKFileDialog.html#a2eeee39828dbff80b7bbe8c9ec9d112e) as one way to check. It appears to be empty in I set .pdf as the exention, and "image/png" if I set .png. digikam has it's own internal check: m_savingContext.format = selectValidSavingFormat(imageFileSaveDialog->currentFilter(), newURL, autoFilter); and puts up an error if invalied. Windows (microsoft office at least) simply tacks the appropriate extension back on so you would end up with filename.pdf.png. I suppose it might be a nice enhancement to KFileDialog to handle this internally as almost every program will encounter this issue.
KSnapshot is an obsolete and unsupported product; please file a new bug if the same issue happens with Spectacle (KSnapshot's replacement).