Bug 290022 - Edit and Rotate in the Light Table open or change the wrong image
Summary: Edit and Rotate in the Light Table open or change the wrong image
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: LightTable-Workflow (show other bugs)
Version: 2.4.1
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-28 16:35 UTC by Andrew Coles
Modified: 2022-02-01 09:18 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Coles 2011-12-28 16:35:19 UTC
Version:           2.4.1 (using KDE 4.7.3) 
OS:                Linux

If an image is on the light-table and right-clicked on, then choosing Edit or Rotate does not edit/rotate the image that was right-clicked on - instead, it edits/rotates the image that is currently selected in the icon view in the main digiKam window.

If nothing is selected in the main window, then the edit and rotate options disappear in the light table.  Everything else seems fine, e.g. 'Open With' or 'Move to Trash' use the correct image.

(As far as I can tell, the problem is that the context menu is using globally defined actions, rather than being tailored to the image that has been right-clicked on.  For instance, clicking Edit triggers the global "image_edit" action.  This is connected to DigikamView::slotImageEdit(), which calls 'd->iconView->openCurrentInEditor();'.  I don't know the internals of digiKam well enough to be able to know the best way to fix it, hence no patch, sorry guys.)

Reproducible: Always

Steps to Reproduce:
Steps to reproduce - for edit:

1) Pick four images, add to light table
2) Drag one of the images into the left or right pane on the light table
3) Pick something else in the main window
4) Right-click the image on the light table, pick edit
5) The image editor will open the image chosen in step (3)

Or, for rotate:

1) Pick four images, add to light table
2) Drag one of the images into the left or right pane on the light table
3) Pick something else in the main window
4) Right-click the image on the light table, rotate it right by 90 degrees
5) The image selected at (3) will be rotated instead

Actual Results:  
The image selected at step (3) is edited/rotated.

Expected Results:  
The image that was right-clicked on is edited/rotated.

It happens on older versions of digiKam too - I've noticed it for a while but have never worked out exactly what it is, other than sometimes the wrong image appears in the editor.
Comment 1 caulier.gilles 2011-12-28 16:41:11 UTC
Andrew,

I confirm. This is due to use JPEGLossLess kipi-plugin into LT. This one must be only used into albumGUI.

Marcel,

In fact this plugin have serious problem into digiKam now. I think to drop it in the future, and use already existing delegate code from digiKam core instead. We will talking about in Genoa, if this goal is fine for you.

Gilles Caulier
Comment 2 Marcel Wiesweg 2011-12-29 19:33:16 UTC
My current opinion would be:
The kipi plugin uses either libjpeg for lossless rotate or ImageMagick.
We should think to move the relevant libjpeg code to a place where we can use it directly, either a library (libkexiv2?) or digikam itself.
Then for non-JPEGs, we should never use lossy ImageMagick rotation, but rotate either using the Exif flags, or, if impossible, the database.
Comment 3 caulier.gilles 2012-01-09 19:12:12 UTC
*** Bug 291070 has been marked as a duplicate of this bug. ***
Comment 4 caulier.gilles 2012-01-12 14:31:56 UTC
Marcel,

Look this patch:

http://digikam3rdparty.free.fr/misc.tarballs/transform4.patch

It patch to use core code from digiKam for rotate operation processed from all context menu... It's not yet complete of course...

Gilles Caulier
Comment 5 outlander2008 2012-01-12 22:13:51 UTC
Thank you Gilles,
but I dont know to apply this patch... I'm sorry, please help me to get it working...
Comment 6 caulier.gilles 2012-01-12 22:18:49 UTC
Warning. The patch is not complete. But you can start to test it... For me it fix all rotation actions from contextual menus.

To apply it against code from KDE git/master repostory :

1/ copy patch on root of digiKam source code dir.
2/ run "patch -p1 < transform4.patch"
3/ recompile and install digiKam.

To cancel patch applied on source code, run "git reset --hard HEAD"

Gilles Caulier
Comment 7 outlander2008 2012-01-12 22:28:51 UTC
ok Gilles, I think it's better for me to wait a new release... I'm not so "geek"... but I'll try it, anyway...
Thank you
Antonio
Comment 8 caulier.gilles 2012-01-13 09:32:37 UTC
Git commit 8ebc7c227c99dbf5da0b5c483baea94b1b901009 by Gilles Caulier.
Committed on 13/01/2012 at 10:30.
Pushed by cgilles into branch 'master'.

Start to use digiKam core method to rotate left/right image using JPEGLOssLess method for JPEG files and DImg class for others image type.
This commit do not replace yet kipi JPEGLOssLEss tool in main menu. It's planed later. Only all contextual menu are aptched.

M  +3    -5    digikam/items/digikamimageview.cpp
M  +0    -17   digikam/items/digikamimageview_p.cpp
M  +103  -9    digikam/metadata/fileactionmngr.cpp
M  +3    -1    digikam/metadata/fileactionmngr.h
M  +42   -19   digikam/metadata/fileactionmngr_p.h
M  +29   -35   digikam/utils/contextmenuhelper.cpp
M  +8    -11   digikam/utils/contextmenuhelper.h
M  +7    -16   digikam/views/digikamview.cpp
M  +2    -2    digikam/views/digikamview.h
M  +4    -28   digikam/views/imagepreviewview.cpp

http://commits.kde.org/digikam/8ebc7c227c99dbf5da0b5c483baea94b1b901009
Comment 9 caulier.gilles 2012-01-13 14:09:27 UTC
Git commit c737d5f631df4541751e9f6893e8bc1dbb208233 by Gilles Caulier.
Committed on 13/01/2012 at 15:07.
Pushed by cgilles into branch 'master'.

disable JPEGLossLess kipi-plugin from digiKam. We use now the dedicated code from core implementation instead.

M  +0    -5    digikam/items/digikamimageview.cpp
M  +0    -1    digikam/items/digikamimageview.h
M  +88   -18   digikam/main/digikamapp.cpp
M  +3    -1    digikam/main/digikamapp.h
M  +7    -2    digikam/main/digikamapp_p.h
M  +4    -2    digikam/main/digikamui.rc
M  +8    -1    digikam/metadata/fileactionmngr.cpp
M  +1    -0    digikam/metadata/fileactionmngr.h
M  +6    -0    digikam/metadata/fileactionmngr_p.h
M  +17   -6    digikam/views/digikamview.cpp
M  +1    -0    digikam/views/digikamview.h

http://commits.kde.org/digikam/c737d5f631df4541751e9f6893e8bc1dbb208233