Darktable: Crop & Rotate: Bottom border moves when resizing

Created on 19 Jun 2020  路  22Comments  路  Source: darktable-org/darktable

When resizing a crop by dragging on any of the top handles (top, top-left, top-right) the bottom border of the image also moves up fractionally. This doesn't happen when dragging on the left, right, bottom, bottom-left or bottom-right handles. Edit: this only happens when I have an aspect ratio set (not when using freehand).

Also, perhaps related (?), very occasionally the crop and rotate module seems to get into a state where merely moving the mouse over the box (without holding any buttons down) causes the crop box to slowly move upwards. The set of circumstances required to reproduce this are seemingly random though.

3.1.0+2325~gd10cb25c3 on ArchLinux with and without openCL

Most helpful comment

Ooh, look at that... lol. Ok, will go have a look.
Can I just say in advance "What a fcckn nightmare" to save me saying it later?
Ta.

All 22 comments

Magic crop-box movement when moving the mouse is illustrated in the attached video. It seems that once I've found the right crop size it happens consistently (even after restarting darktable). Could it be some sort of rounding error?

issue5558.zip

The only time I'm pressing a mouse button here is to drag the crop box back to the bottom of the screen. Otherwise, if I keep my mouse still nothing happens; if I move my mouse the crop box rises.

I reproduce, see Screencast, attached
dt_spooky-Magic_20200619-2020-06-19_17.00.37.mp4.zip

I bisected the bottom-line move up thingie...

aac258ae28db0b8b9bc14a29d206186b7133be96 is the first bad commit
commit aac258ae28db0b8b9bc14a29d206186b7133be96
Author: GrahamByrnes <[email protected]>
Date:   Tue Jun 9 22:33:39 2020 +0200

    Allows more precise aspect ratios in crop & rotate

 src/iop/clipping.c | 33 +++++++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 8 deletions(-)

@GrahamByrnes could you do us a favour to also look into this? :)

Ooh, look at that... lol. Ok, will go have a look.
Can I just say in advance "What a fcckn nightmare" to save me saying it later?
Ta.

Can I just say in advance "What a fcckn nightmare"

I feel your pain. Crop & rotate is a nightmare.

I'm running something else at the moment, so could you tell me: does this happen when "original image" is set? Or does it have to be one of the other ratios?

Yes. Also happens with original image as the aspect ratio.

I can definitely reproduce the 'bottom moving when cropping the top' issue on original image but the 'magic movement' issue only seems to happen with other ratios

Could be... but I don't understand why it should be different. Which doesn't mean a lot :-)

For the moment I haven't found the magic choice of numbers and hand waving, so this could be complicated.

According to GLib,

an integer less than, equal to, or greater than zero, if str1 is <, == or > than str2 .

So the only real issue would be if it was comparing two NULL pointers... which is impossible since one is an explicit string.

Sorry I deleted my previous comment as on reflection I think your code for that comparison is fine.

It's kind of weird, since the only part of the code I thought to have modified was for the exact image case. That's where the exact aspect ratio is imported. For the others it should behave like the old code... except it doesn't :-(

I also get some odd crop ratios in the combobox occasionally

Screenshot_2020-06-19_17-16-49

Don't forget this code has been tweaked a couple of times since that PR so the effects might be subtly different now (when I was testing I had to tweak the image size to reproduce the 'magic' bug after your subsequent correction PR)

There certainly could be an issue with rounding: the whole point was to fix an issue where the rounded ratio of the downsampled preview image was at least a pixel or two off from the image to be pasted in. So the idea was that for "original image" you should be able to select the original image.

Oh, just saw your latest... hmmm.

PS what preview_downsampling are you using?

PS what preview_downsampling are you using?

"original"

I can get the "bottom edge moving" thing... although you can just pull it back down.

Got shut out :-(

I'm wondering about those MAX(ceiling(....) ,0) changes, which were really aimed at fixing a preceding problem... since the guts of my changes don't apply when a ratio other than "original" is selected...

Yes that's about all that's left really isn't it.

That's it.

Thanks I'll test it soon

can be closed, I guess?

Yes. Thanks all.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

schwerdf picture schwerdf  路  4Comments

pphotography picture pphotography  路  3Comments

GrahamByrnes picture GrahamByrnes  路  3Comments

denever picture denever  路  4Comments

lapineige picture lapineige  路  4Comments