Aspect Ratio Crop bug?

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

Aspect Ratio Crop bug?

Mark Ovens
Hi,

This problem existed in 0.8.1 and is also in 0.9.0.

When using Aspect Ratio Crop, it doesn't get the correct dimensions for
1024x768 and 1152x864 when the ratio is set to 3:4

If you enter 1024 in the Width box then the height appears as 766.
Trying to change either value to the correct one causes one or both
values to be wrong.

If you set the ratio to None, enter 1024 and 768 in the Width and Height
boxes and click OK, the resized image is the correct size *some* times,
but wrong, e.g. 1022x765, other times.

Similar problems happen with 1152x864

Both these sizes are standard PC screen sizes and are exact 3:4 ratios.

Aspect Ratio Crop works correctly for 640x480, 800x600, 1200x900, and
1280x960 so it appears to only work correctly if both of the dimensions
are round numbers (i.e. a multiple of 10).

I'm running digikam on FreeBSD 6.1. Is this only a problem on this
platform, or does it happen on Linux too?

Thanks.

Regards,

Mark
_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Aspect Ratio Crop bug?

Milan Zamazal
>>>>> "MO" == Mark Ovens <[hidden email]> 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. :-)

Regards,

Milan Zamazal

--
http://www.zamazal.org

_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Aspect Ratio Crop bug?

Mark Ovens
Milan Zamazal wrote:

>>>>>> "MO" == Mark Ovens <[hidden email]> 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.

Regards,

Mark
_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Aspect Ratio Crop bug?

Gilles Caulier-2
Le vendredi 5 janvier 2007 23:11, Mark Ovens a écrit :

> Milan Zamazal wrote:
> >>>>>> "MO" == Mark Ovens <[hidden email]> 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
_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users