Bug 228524

Summary: Failed to rotate image [patch]
Product: [Applications] digikam Reporter: kdu
Component: Plugin-Bqm-RotateAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, meldavid
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 1.2.0
Sentry Crash Report:
Attachments: Patch fixing jpeglossless on Windows

Description kdu 2010-02-25 21:10:59 UTC
Version:            (using KDE 4.4.0)
OS:                MS Windows
Installed from:    MS Windows

When i rotate an image the file size is zero. 
Maybe it is a clone of Bug 167284 but it happens on a "normal" path "i:\kde\pictures\"
Comment 1 caulier.gilles 2010-02-26 10:30:34 UTC
How do you rotate images ? from icon view or image editor ?

Gilles Caulier
Comment 2 kdu 2010-02-26 18:50:42 UTC
I tried both.

kladde


Gilles Caulier schrieb:
> https://bugs.kde.org/show_bug.cgi?id=228524
>
>
>
>
>
> --- Comment #1 from Gilles Caulier <caulier gilles gmail com>  2010-02-26 10:30:34 ---
> How do you rotate images ? from icon view or image editor ?
>
> Gilles Caulier
>
>
Comment 3 David Eriksson 2010-03-01 18:47:13 UTC
I can confirm the problem on my Windows XP home. It look like one of these problems that NTFS don't allow to overwrite an open file. The image is in .kde/tmp with a kipiplugin-rotate-name. If I get time I will see if I can spot the problem and make a patch.
Comment 4 David Eriksson 2010-03-22 18:01:57 UTC
Created attachment 42186 [details]
Patch fixing jpeglossless on Windows

This patch fixes the problems with the jpeslossless plugin. 
The problem is that some file operations is not possible under Windows unless the file is properly closed. A KTemporaryFile with autoremove can not easily be closed so this patch uses a workaround by renaming the file into itself, since the renaming operation first closes the file properly. For the conversion to black and white I also had to change the way the files where opened for it to work.
Comment 5 caulier.gilles 2010-03-23 10:08:25 UTC
SVN commit 1106566 by cgilles:

apply patch #42186 from David Eriksson to fix jpeg files operation under windows
BUGS: 228524


 M  +3 -1      NEWS  
 M  +2 -2      jpeglossless/actions.h  
 M  +2 -2      jpeglossless/actionthread.cpp  
 M  +2 -2      jpeglossless/actionthread.h  
 M  +21 -16    jpeglossless/convert2grayscale.cpp  
 M  +2 -2      jpeglossless/convert2grayscale.h  
 M  +8 -2      jpeglossless/imageflip.cpp  
 M  +2 -2      jpeglossless/imageflip.h  
 M  +8 -2      jpeglossless/imagerotate.cpp  
 M  +2 -2      jpeglossless/imagerotate.h  
 M  +3 -3      jpeglossless/jpegtransform.cpp  
 M  +3 -3      jpeglossless/jpegtransform.h  
 M  +2 -2      jpeglossless/plugin_jpeglossless.cpp  
 M  +2 -2      jpeglossless/plugin_jpeglossless.h  
 M  +2 -2      jpeglossless/utils.cpp  
 M  +2 -2      jpeglossless/utils.h  


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