[Bug 179548] New: additional guide for aspect ratio crop

classic Classic list List threaded Threaded
38 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] New: additional guide for aspect ratio crop

Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548

           Summary: additional guide for aspect ratio crop
           Product: digikam
           Version: 0.9.5-svn
          Platform: Compiled Sources
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: wishlist
          Priority: NOR
         Component: Image Editor
        AssignedTo: [hidden email]
        ReportedBy: [hidden email]


Version:           0.9.5-svn (using KDE 3.5.10)
OS:                Linux
Installed from:    Compiled From Sources

I'd like to use diagonal guidelines in the aspect ration cropping tool to
assist in selecting according to the diagonal method concept as described here:
http://www.diagonalmethod.info/
The "Harmonious Triangles" guidelines only implements half of this method, the
full DM uses 45 degree lines from all corners...

Apparently this has been requested/implemented earlier for the Gimp, but it
wasn't accepted into trunk for some reason:
http://www.mail-archive.com/gimp-developer@.../msg14463.html

It seems the feature is currently implemented in Photoshop/lightroom
(apparently without informing the author(s) of the original article, I suppose
it would be nice to send them an e-mail if it is implemented in Digikam's
Editor)

Thanks in advance,

Simon

PS, I also requested this feature on the gimp's bugzilla, since I also use that
a lot to edit images...


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Gilles Caulier-4
http://bugs.kde.org/show_bug.cgi?id=179548


Gilles Caulier caulier gilles gmail com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Image Editor                |Core Plugin
            Product|digikam                     |digikamimageplugins
            Version|0.9.5-svn                   |0.9.5




--- Comment #1 from Gilles Caulier <caulier gilles gmail com>  2009-01-03 21:55:28 ---
I cannot see any problem to implement it in digiKam

More viewpoints are welcome.

Note : link to composition guide web article is very nice to read.

Gilles Caulier


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Bugzilla from mikmach@wp.pl
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #2 from Mikolaj Machowski <mikmach wp pl>  2009-01-04 00:34:23 ---
To paraphrase old saying:
"The nice thing about methods is that there are so many to choose from" :)

I ran this simple script (bash, ImageMagick, cut):
------------------------------------------------------------
#!/bin/bash
SIZE=`identify -format "%w %h" $1`
W=`echo $SIZE | cut -d' ' -f1`
H=`echo $SIZE | cut -d' ' -f2`
if [ $H -gt $W ]; then
convert $1 -stroke black \
                   -draw "line 0,0 $W,$W" \
                   -draw "line 0,$W $W,0" \
                   -draw "line 0,$(($H-$W)) $W,$H" \
                   -draw "line 0,$H $W,$(($H-$W))" $1-dm.jpg
else
convert $1 -stroke black \
                   -draw "line 0,0 $H,$H" \
                   -draw "line 0,$H $H,0" \
                   -draw "line $(($W-$H)),0 $W,$H" \
                   -draw "line $(($W-$H)),$H $W,0" $1-dm.jpg
fi
--------------------------------------------------------------------
Over my collection of few thousands of drawings and etchings, from 16th to 20th
century. Results aren't very convincing, but: percentage of images where this
theory is more often correct (although not always) are from beginning of 20th
century onwards. Maybe some new, still existing school of composition? On
Monday I will be able to test it on more examples.


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Bugzilla from simon@margo.student.utwente.nl
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #3 from simon margo student utwente nl  2009-01-04 10:47:17 ---
As can be interpreted from the site, it doesn't apply to all pictures, since
not all of them are primarily about a few details. It is interesting as a
method to put emphasis on a few important details, or to check in an image
where the focus would be according to the diagonal method.

BTW, on a second look, the harmonious triangles don't even do half of the DM,
since the corner/side diagonals are perpendicular to the corner/corner
diagonal, which is not 45 degrees from the corners in almost all cases.

Cheers

Simon


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Bugzilla from simon@margo.student.utwente.nl
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #4 from simon margo student utwente nl  2009-01-04 13:12:54 ---
Ok, here's a picture I had found on photosight.ru a while ago (I'd forgotten
I'd stored it somewhere), but it's a really catching portrait:

http://margo.student.utwente.nl/simon/temp/2241460.jpg

using Mikolaj's script:

http://margo.student.utwente.nl/simon/temp/2241460.jpg-dm.jpg

Look at the line crossing the eye, which is also parallel to the line of the
face. And the other diagonal line carrying the chin. I'd say this is a perfect
example for the diagonal method....

BTW, I don't have copyrights to this picture, so I won't leave it up on my site
for long, however it can also be found here:
http://www.photosight.ru/photos/2241460/


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Bugzilla from mikmach@wp.pl
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548


Mikolaj Machowski mikmach wp pl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1




--- Comment #5 from Mikolaj Machowski <mikmach wp pl>  2009-01-05 11:44:36 ---
OK, tested it on paintings (where artists were more concerned with composition)
and idea has more merit.


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Bugzilla from simon@margo.student.utwente.nl
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #6 from simon margo student utwente nl  2009-01-05 20:45:50 ---
I don't know how to make all the right changes in the code, but the drawing
section in imageselectionwidget.cpp should be somewhat like this I presume?

case DiagonalMethod:
{
// Move coordinates to top, left
        p.translate(d->localRegionSelection.topLeft().x(),
                d->localRegionSelection.topLeft().y());

// Flip horizontal.
// Flip verical.
        // noop; DiagonalMethod is symmetrical

        float w = (float)d->localRegionSelection.width();
        float h = (float)d->localRegionSelection.height();
        p.setPen(QPen(Qt::white, d->guideSize, Qt::SolidLine));

        if (w > h) {
                p.drawLine( 0, 0, h, h);
                p.drawLine( 0, h, h, 0);
                p.drawLine( w-h, 0, w, h);
                p.drawLine( w-h, h, w, 0);

        } else {
                p.drawLine( 0, 0, w, w);
                p.drawLine( 0, w, w, 0);
                p.drawLine( 0, h-w, w, h);
                p.drawLine( 0, h, w, w-h);
        }
        break;
}


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Gilles Caulier-4
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #7 from Gilles Caulier <caulier gilles gmail com>  2009-01-06 08:03:05 ---
Simon,

If you want to experiment some code it's easy. Look here :

http://lxr.kde.org/source/extragear/graphics/digikam/imageplugins/coreplugin/ratiocrop/imageselectionwidget.cpp#708

Composition guide are draw in ImageSelectionWidget::updatePixmap() method. If
you want to test your changes, you just need to recompile parent folder and
install it (it's a plugin for image editor):

http://lxr.kde.org/source/extragear/graphics/digikam/imageplugins/coreplugin/

Just enter this command:

#make
#su
#make install

... and rerun digiKam to test

Best

Gilles Caulier


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Gilles Caulier-4
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #8 from Gilles Caulier <caulier gilles gmail com>  2009-01-06 08:06:49 ---
Simon,

Warning. I see that you play with 0.9.5 code. It's KDE3 version where no new
features is added now. We play with KDE4 code now.

But like your wish sound simple to code and will be not very intrusive, it will
be easy to backport patch from KDE3 to KDE4.

To contrib, look here :

http://www.digikam.org/drupal/contrib

To checkout code from svn :

http://www.digikam.org/drupal/download/svn

Gilles Caulier


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Bugzilla from simon@margo.student.utwente.nl
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #9 from simon margo student utwente nl  2009-01-06 21:36:12 ---
Gilles,

I'm afraid I don't have a good system available to play with 4.x code, so this
will have to do for now :-(

I hi-jacked the HarmoniousTriangles option to test my code and found a bug ;-)
The last w-h, should be h-w, but it worked fine otherwise...

Working it into the ratiocrop code as a proper option will take me some more
effort (time and understanding where to make modifications)

Mainly I'm glad I got it to work for myself now, if someone beats me to
integrating it, great!

/Simon


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Bugzilla from simon@margo.student.utwente.nl
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #10 from simon margo student utwente nl  2009-01-06 22:01:37 ---
Created an attachment (id=29983)
 --> (http://bugs.kde.org/attachment.cgi?id=29983)
patch with my (not compiling) changes

Well, I tried to add the whole thing, but I get stuck when I get the error:

...
make[3]: Entering directory
`/home/simon/src/kde3/graphics/digikam/imageplugins/coreplugin/ratiocrop'
/bin/bash ../../../../libtool --silent --tag=CXX   --mode=compile g++
-DHAVE_CONFIG_H -I. -I../../../..
-I../../../../digikam/utilities/imageeditor/editor
-I../../../../digikam/utilities/imageeditor/canvas
-I../../../../digikam/libs/histogram -I../../../../digikam/libs/levels
-I../../../../digikam/libs/curves -I../../../../digikam/libs/whitebalance
-I../../../../digikam/libs/widgets/common
-I../../../../digikam/libs/widgets/iccprofiles
-I../../../../digikam/libs/widgets/imageplugins
-I../../../../digikam/libs/dialogs -I../../../../digikam/libs/dimg
-I../../../../digikam/libs/dmetadata -I../../../../digikam/libs/dimg/filters
-I../../../../digikam/digikam  -I/usr/include/kde -I/usr/share/qt3/include -I.
  -DQT_THREAD_SUPPORT  -D_REENTRANT  -fno-tree-pre -Wno-long-long -Wundef -ansi
-D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts -Wall -W
-Wpointer-arith -O2 -Wformat-security -Wmissing-format-attribute
-Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common
-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT
-DQT_NO_TRANSLATION -DQT_CLEAN_NAMESPACE  -MT ratiocroptool.lo -MD -MP -MF
.deps/ratiocroptool.Tpo -c -o ratiocroptool.lo ratiocroptool.cpp
ratiocroptool.cpp: In member function 'void
DigikamImagesPluginCore::RatioCropTool::slotGuideTypeChanged(int)':
ratiocroptool.cpp:752: error: 'DiagonalMethod' is not a member of
'DigikamImagesPluginCore::ImageSelectionWidget'
ratiocroptool.cpp:784: error: no matching function for call to
'DigikamImagesPluginCore::ImageSelectionWidget::setGoldenGuideTypes(bool, bool,
bool, bool, bool, bool, bool)'
imageselectionwidget.h:109: note: candidates are: void
DigikamImagesPluginCore::ImageSelectionWidget::setGoldenGuideTypes(bool, bool,
bool, bool, bool, bool)
make[3]: *** [ratiocroptool.lo] Error 1
make[3]: Leaving directory
`/home/simon/src/kde3/graphics/digikam/imageplugins/coreplugin/ratiocrop'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
`/home/simon/src/kde3/graphics/digikam/imageplugins/coreplugin'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/simon/src/kde3/graphics/digikam/imageplugins'
make: *** [all-recursive] Error 1


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Bugzilla from simon@margo.student.utwente.nl
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548


simon margo student utwente nl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #29983|0                           |1
        is obsolete|                            |




--- Comment #11 from simon margo student utwente nl  2009-01-07 22:35:23 ---
Created an attachment (id=30020)
 --> (http://bugs.kde.org/attachment.cgi?id=30020)
this patch should work

This one should work, I'd forgotten to change some names in the previous
patch...

At least it worked for me, the patch is run in the ratiocrop directory relative
to the svn version

Cheers

Simon

PS, feel free to incorporate it, if you want a license term (though it's a
small patch, I doubt it's necessary), consider it "GPLv2 or later"....


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Gilles Caulier-4
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #12 from Gilles Caulier <caulier gilles gmail com>  2009-01-07 23:01:01 ---
Mik,

Can you test this patch and give me a feedback. I will review it later.

Thanks in advance

Gilles


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Bugzilla from mikmach@wp.pl
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #13 from Mikolaj Machowski <mikmach wp pl>  2009-01-07 23:53:34 ---
Against which svn version is this patch? With 907203 it is not applicable.


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Bugzilla from simon@margo.student.utwente.nl
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #14 from simon margo student utwente nl  2009-01-08 08:27:46 ---
This is against the kde3 version in svn...


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Bugzilla from andi.clemens@gmx.net
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #15 from Andi Clemens <andi clemens gmx net>  2009-01-08 10:25:33 ---
It compiles fine (and seems to work correct) under KDE3...

Andi


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Bugzilla from mikmach@wp.pl
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #16 from Mikolaj Machowski <mikmach wp pl>  2009-01-08 21:22:25 ---
Truly weird, it patches, it compiles, but I don't see it in interface...


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Bugzilla from andi.clemens@gmx.net
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #17 from Andi Clemens <andi clemens gmx net>  2009-01-08 21:59:05 ---
Mik,

you need to install digiKam, since it is a imageplugin that has been patched
and it needs to be present in the plugin folder, it will not work if you start
it from your build path (the same as with kipi-plugins).

Andi


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Bugzilla from mikmach@wp.pl
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #18 from Mikolaj Machowski <mikmach wp pl>  2009-01-08 22:16:02 ---
I installed digiKam. Still nothing. Never mind. From code looks like changes in
interface looks in line with the rest of plugin, you wrote it works. Now only
Gilles have to review it :)


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 179548] additional guide for aspect ratio crop

Bugzilla from andi.clemens@gmx.net
In reply to this post by Bugzilla from simon@margo.student.utwente.nl
http://bugs.kde.org/show_bug.cgi?id=179548





--- Comment #19 from Andi Clemens <andi clemens gmx net>  2009-01-08 22:30:23 ---
This is weird. You are looking at the correct plugin? :-)
Aspect Ratio Crop?

I can see it... maybe it has been cached somehow (but I couldn't think of how
this would happen). Maybe running "kdeinit4" fixes it?

Andi


--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
12