[Kde-imaging] RFC: how to identify an action from some KIPI plugin

Jan Kundrát jkt at gentoo.org
Tue Aug 7 20:34:53 CEST 2007


(Re-send of an earlier message that was sent to wrong address, apologies
if it makes it twice to the list.)

Hi list,
this message is a result of KPhotoAlbum bugreport [1] and an ugly patch [2].

There's a KIPI plugin that, based on EXIF information, physically
rotates the JPEG image and resets the ImageOrientation EXIF field back
to "normal". As a design choice, KPhotoAlbum doesn't rely on this EXIF
field, but rotates images according to a record in its own database
(which is typically initialized with correct data when KPA sees the
image for the first time), so users can freely "rotate" their images
without any risk to their images. This rotation can be written back to
the photos by an explicit request, but this isn't done by default for
safety reasons.

When we invoke this plugin from KPA, the real image data are rotated,
but KPA's "orientation" record in its database isn't updated.
Unfortunately we can't just re-read the respective EXIF field after each
plugin invocation for obvious reasons (this would overwrite user's changes).

What I'm looking for is how to find out that the KAction that user just
invoked is "EXIF auto rotate" from the "JPEG lossless transformations"
plugin. Right now, my ugly patch abuses C++ RTTI for that, but this is
highly unportable, ugly and suboptimal. What I propose is that each
KAction from each KIPI plugin should have an unique name (in this case,
probably "JPEGLossless/rotate_exif"). That way, KPA can find out what
the invoked plugin actually did and update its database.

Alternative is to support an equivalent of name() for each KIPI plugin,
but I'm afraid that this would require a change in the plugin ABI.

Note that we can't use regular C++'s
dynamic_cast<KIPIJPEGLossLessPlugin::Plugin_JPEGLossless> because
headers for that plugin need not be available while we build the
application.

[1] https://bugs.kde.org/show_bug.cgi?id=146927
[2] https://bugs.kde.org/attachment.cgi?id=20893&action=view

Cheers,
-jkt

-- 
cd /local/pub && more beer > /dev/mouth



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://mail.kde.org/pipermail/kde-imaging/attachments/20070807/364619b7/attachment.pgp 


More information about the Kde-imaging mailing list