[Digikam-users] Aspect Ratio Crop bug?

Caulier Gilles caulier.gilles at kdemail.net
Sat Jan 6 08:07:28 GMT 2007


Le vendredi 5 janvier 2007 23:11, Mark Ovens a écrit :
> Milan Zamazal wrote:
> >>>>>> "MO" == Mark Ovens <marko at freebsd.org> writes:
> >
> >     MO> I'm running digikam on FreeBSD 6.1. Is this only a problem on
> >     MO> this platform, or does it happen on Linux too?
> >
> > It happens on Linux too.  digiKam can't hold even 1:1 ratio correctly
> > and it often doesn't cover the whole picture area when using the
> > "Max. aspect" button.
> >
> > It's not enough important/annoying problem for me to bother filing a bug
> > report about that.  But it would be nice if someone did. :-)
>
> I've just been looking at the code and the problem appears to be in the
> ImageSelectionWidget. What seems to be happening is that it is taking
> the values you enter in the height and width input boxes and scaling the
> values (as floating point numbers) to draw the selection rectangle in
> the preview, then scaling the size back up to the actual size, and
> casting back to integers.
>
> Since the preview is not full size this causes rounding errors, hence
> the problem.
>
> If you maximize the Aspect Ratio Crop dialogue window (so the preview
> image is larger) then the errors are different and even 800x800,
> 1200x900, and 1280x960 have errors as well.
>
> I've only taken a quick look into this, but it certainly seems to be
> where the problem is - it is effectively doing things the wrong way
> round, by changing the crop size to match the approximation that is
> achieved in the preview window.
>
> I'll spend some more time on this and, if I can fix it I'll file a bug
> with a patch.

No problem Mark. Let's go. I'm currently working on Tags stuff. I'm too busy 
(:=))).

Marcel work on other important part too. All contributions are welcome.

If you is interressed by Ratio Crop tool, look here :

http://bugs.kde.org/buglist.cgi?product=digikamimageplugins&component=Core%20Plugin&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED

Your report sound like file #128293...

In file #128472, you can find a patch to improve this tool, but... The code 
patched come from 0.8.2, not svn trunk. An indeep parse of patch
 implementation is require to backport this code to 0.9.x. Not really 
difficult, but can be long.

Thanks in advance for your help. It's very appreciate.

Gilles



More information about the Digikam-users mailing list