Bug 168583 - Digikam fails to save images in home directory
Summary: Digikam fails to save images in home directory
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: ImageEditor-Save (show other bugs)
Version: 0.10.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-07 10:12 UTC by Gandalf Lechner
Modified: 2022-02-02 16:34 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 7.5.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gandalf Lechner 2008-08-07 10:12:49 UTC
Version:           0.10.0-beta2 (rev.: 830788) (using 4.1.00 (KDE 4.1.0), Kubuntu packages)
Compiler:          gcc
OS:                Linux (x86_64) release 2.6.24-20-generic

In the image editor, "save as ..." does not always work correctly. When trying to save a picture in my home directory, a window pops up with the error message "Failed to save file X to /home/gandalf/X"; also in the console it says "digikam(12887): error saving image".
I tried saving to various other directories, and it always worked fine, the problem seems only to occur when saving to the home directory.
Comment 1 Andi Clemens 2008-08-15 21:53:26 UTC
This is strange... but I can confirm this, too. Saving to my home folder always fails.
Comment 2 caulier.gilles 2008-08-19 11:16:31 UTC
Andi,

There is no reason for that...

Are you any errors messages form the console.

Gilles
Comment 3 Andi Clemens 2008-08-19 11:40:55 UTC
This is what I get when saving to home, and it really only happens when saving to home folder, ~/somefolder will work, but ~ will never...

igikam(7212)/kio (KIOJob) KIO::stat: stat KUrl("file:///home/andi/1999_Alleyras_002.tiff")
digikam(7212)/kio (KIOJob) KIO::SlaveInterface::dispatch: error  111   "/home/andi/1999_Alleyras_002.tiff"
digikam(7212)/kio (KDirLister) KDirLister::stop:
QFSFileEngine::open: No file name specified
QFSFileEngine::open: No file name specified
digikam(7212): Saving to :   ( "tiff" )
JPEG image preview size: (1280 x 853) pixels - 231897 bytes
Thumbnail temp file: /tmp/kde-andi/digikamoc7212KExiv2ExifThumbnail
digikam(7212): Cannot open target image file.
digikam(7212)/kio (KDirLister) KDirLister::stop:
digikam(7212)/kio (KDirListerCache) KDirListerCache::forgetDirs: KDirLister(0xa118108)  item moved into cache:  KUrl("file:///home/andi")
digikam(7212)/kio (KDirLister) KDirLister::stop:
digikam(7212)/kio (KDirListerCache) KDirListerCache::forgetDirs: KDirLister(0xa053c60)  item moved into cache:  KUrl("trash:/")
digikam(7212): error saving image '

digikam(7212)/kdeui (KNotification) KNotification::slotReceivedId: 0
digikam(7212)/kdeui (KNotification) KNotification::close: 0
digikam(7212)/kdeui (KNotification) KNotification::~KNotification: -2
Comment 4 caulier.gilles 2008-08-19 12:05:48 UTC
Andi,

Look in editorwindow.cpp::startingSaveAs()

    // Now do the actual saving 

    // use magic file extension which tells the digikamalbums ioslave to ignore the file

    m_savingContext->destinationURL = newURL;
    m_savingContext->originalFormat = m_canvas->currentImageFileFormat();
    m_savingContext->savingState    = SavingContextContainer::SavingStateSaveAs;
    m_savingContext->abortingSaving = false;
    m_savingContext->saveTempFile   = new KTemporaryFile();
    m_savingContext->saveTempFile->setPrefix(newURL.directory());
    m_savingContext->saveTempFile->setSuffix(".digikamtempfile.tmp");
    m_savingContext->saveTempFile->setAutoRemove(true);
    m_savingContext->saveTempFile->open();

    m_canvas->saveAs(m_savingContext->saveTempFile->fileName(), m_IOFileSettings,
                     m_setExifOrientationTag && (m_rotatedOrFlipped || m_canvas->exifRotated()),
                     m_savingContext->format.toLower());

Sound like KTemporaryFile() is not able to open a temp file into home directory.

Gilles
Comment 5 caulier.gilles 2008-12-03 13:00:48 UTC
Andi,

This is always true with KDE 4.1.3 and digiKam from svn ?

Gilles
Comment 6 Andi Clemens 2008-12-03 13:27:58 UTC
Yes, still the same.
Saving an image from the editor into the home folder is not working.

Andi
Comment 7 Marcel Wiesweg 2008-12-23 00:12:25 UTC
SVN commit 900480 by mwiesweg:

Properly check that a temp file could be opened and display error message if not.

CCBUG: 168583

 M  +31 -11    editorwindow.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=900480
Comment 8 Marcel Wiesweg 2008-12-23 00:12:36 UTC
SVN commit 900481 by mwiesweg:

The file dialog would gives us /home/user, so the temp file would be created in /home/
with a name starting with user, instead of /home/user/.
Make sure there is a trailing slash.

CCBUG: 168583

 M  +2 -1      NEWS  
 M  +2 -2      utilities/imageeditor/editor/editorwindow.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=900481