Bug 190296 - Can not save images on Windows
Summary: Can not save images on Windows
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: DImg-FileIO (show other bugs)
Version: 1.0.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-21 21:10 UTC by David Eriksson
Modified: 2022-02-04 06:20 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 1.0.0


Attachments
Patch to make Save As work (3.90 KB, patch)
2009-05-10 23:09 UTC, David Eriksson
Details
Patch to make Save work (1.09 KB, application/octet-stream)
2009-05-11 22:02 UTC, David Eriksson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Eriksson 2009-04-21 21:10:18 UTC
Version:           0.11.0-svn (using 4.2.2 (KDE 4.2.2), MinGW 3.4.5)
Compiler:          gcc.exe
OS:                Microsoft Windows (i686) release 5.1 (XP Professional)

When I try to save an image in Image Editor I always get the message "Failed to overwrite original file". I have tried different files, both Save and Save As and different formats with the same result.
Comment 1 caulier.gilles 2009-04-21 21:17:53 UTC
If your image is in your user directory, it will have read only / archive flag, and it's a stupid stuff from M$... We need to patch digiKam to ignore this flag everywhere (under win32 only of course)

Do not ask me why files have this flag... I don't understand M$ policy...

Gilles Caulier
Comment 2 David Eriksson 2009-04-21 21:28:20 UTC
I tried using a directory on another partition (FAT32) with the same result. I also noticed that the file is actually saved but has a name like xd1124.digikamtempfile.tmp1124.
Comment 3 David Eriksson 2009-05-10 23:08:06 UTC
I think this is related to bug 189742 (Thumbnails not saved), since Windows don't like renaming open files. The attached patch (made along the lines of the solution to bug 189742) closes the KTemporaryFile directly after it is created since it didn't work just closing it before the final rename. I suspect there is some renaming done in the saving of the image to the temporary file. The patch enables me to do Save As, but not Save and I suspect this is due to the image still being open in the editor during a Save. Now when I can save an image I realized that it is always saved as png, independently of what I choose as a name or format.
Comment 4 David Eriksson 2009-05-10 23:09:00 UTC
Created attachment 33528 [details]
Patch to make Save As work
Comment 5 caulier.gilles 2009-05-11 08:52:34 UTC
SVN commit 966369 by cgilles:

apply patch #33528 from David Eriksson. Thanks for this patch and tests under Windows.
BUG: 190296
CCMAIL: meldavid@acc.umu.se



 M  +12 -6     editorwindow.cpp  
 M  +1 -0      savingcontextcontainer.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=966369
Comment 6 David Eriksson 2009-05-11 22:02:05 UTC
I have now got Save to work also. The new patch includes the parts I missed in for the rename of the file.
Comment 7 David Eriksson 2009-05-11 22:02:43 UTC
Created attachment 33560 [details]
Patch to make Save work
Comment 8 caulier.gilles 2009-05-11 23:00:43 UTC
SVN commit 966775 by cgilles:

apply patch #33560
CCBUGS: 190296


 M  +13 -1     editorwindow.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=966775
Comment 9 caulier.gilles 2009-05-11 23:05:24 UTC
Thanks David for your patches.

As you work under windows, do you know a solution about this entry :

https://bugs.kde.org/show_bug.cgi?id=189168

Gilles Caulier