[Digikam-users] Aspect Ratio Crop bug?

Mark Ovens marko at freebsd.org
Fri Jan 5 22:11:17 GMT 2007


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.

Regards,

Mark



More information about the Digikam-users mailing list