darktable-org / darktable

darktable is an open source photography workflow application and raw developer
https://www.darktable.org
GNU General Public License v3.0
8.91k stars 1.1k forks source link

Square crop after using perspective correction #16807

Closed brucewilliamsphotography closed 2 weeks ago

brucewilliamsphotography commented 2 weeks ago

Describe the bug

Hi devs, Not sure if this has ever been noticed or reported, but I just discovered that if you use the Rotate and Perspective tool to apply correction to the vertical and horizontal axes in an image, and THEN do a square crop, the images you export will not be square. I am working on a handful of images of a model inside a large wooden box. Images were shot handheld and therefore are not perfectly square. I used R&P to correct for this, cropped to square, and then exported what I THOUGHT would be a bunch of jpegs which would be 1000 px by 1000 px. But most are 1000 x 999, and one was even 1000 x 995. I can imagine WHY it's happening (skewing of original pixel data), but wondered if a fix was possible?

Steps to reproduce

See above Sample image attached _DSC5907

Expected behavior

I expected exported images to be perfectly square (equal pixel count on vertical and horizontal axes.

Logfile | Screenshot | Screencast

No response

Commit

No response

Where did you obtain darktable from?

GitHub nightly

darktable version

4.7.0+912~gcc9415aadc

What OS are you using?

Linux

What is the version of your OS?

mx linux 23.2, xfce v4.18.1

Describe your system?

[CODE]System: Kernel: 6.1.0-21-amd64 [6.1.90-1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0 parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-21-amd64 root=UUID= ro quiet splash init=/lib/systemd/systemd Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.36 info: xfce4-panel wm: xfwm v: 4.18.0 vt: 7 dm: LightDM v: 1.26.0 Distro: MX-23.2_x64 Libretto October 15 2023 base: Debian GNU/Linux 12 (bookworm) Machine: Type: Desktop System: Micro-Star product: MS-7B79 v: 2.0 serial: Mobo: Micro-Star model: X470 GAMING PLUS (MS-7B79) v: 2.0 serial: UEFI: American Megatrends v: A.B0 date: 07/04/2019 Battery: Device-1: hidpp_battery_0 model: Logitech Wireless Mouse M325 serial: charge: 100% (should be ignored) rechargeable: yes status: discharging CPU: Info: model: AMD Ryzen 7 2700X bits: 64 type: MT MCP arch: Zen+ gen: 2 level: v3 note: check built: 2018-21 process: GF 12nm family: 0x17 (23) model-id: 8 stepping: 2 microcode: 0x800820D Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache: L1: 768 KiB desc: d-8x32 KiB; i-8x64 KiB L2: 4 MiB desc: 8x512 KiB L3: 16 MiB desc: 2x8 MiB Speed (MHz): avg: 2190 high: 2204 min/max: 2200/3700 boost: enabled scaling: driver: acpi-cpufreq governor: ondemand cores: 1: 2204 2: 2197 3: 2200 4: 2200 5: 2198 6: 2200 7: 2200 8: 2200 9: 2200 10: 2200 11: 2199 12: 2190 13: 2200 14: 2200 15: 2132 16: 2132 bogomips: 118388 Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm Vulnerabilities: Type: gather_data_sampling status: Not affected Type: itlb_multihit status: Not affected Type: l1tf status: Not affected Type: mds status: Not affected Type: meltdown status: Not affected Type: mmio_stale_data status: Not affected Type: reg_file_data_sampling status: Not affected Type: retbleed mitigation: untrained return thunk; SMT vulnerable Type: spec_rstack_overflow mitigation: safe RET Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization Type: spectre_v2 mitigation: Retpolines; IBPB: conditional; STIBP: disabled; RSB filling; PBRSB-eIBRS: Not affected; BHI: Not affected Type: srbds status: Not affected Type: tsx_async_abort status: Not affected Graphics: Device-1: NVIDIA GA104 [GeForce RTX 3070] vendor: ASUSTeK driver: nvidia v: 525.147.05 non-free: 530.xx+ status: current (as of 2023-03) arch: Ampere code: GAxxx process: TSMC n7 (7nm) built: 2020-22 pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/s bus-ID: 27:00.0 chip-ID: 10de:2484 class-ID: 0300 Display: x11 server: X.Org v: 1.21.1.7 compositor: xfwm v: 4.18.0 driver: X: loaded: nvidia unloaded: fbdev,modesetting,nouveau,vesa alternate: nv gpu: nvidia display-ID: :0.0 screens: 1 Screen-1: 0 s-res: 7680x2160 s-dpi: 96 s-size: 2032x572mm (80.00x22.52") s-diag: 2111mm (83.11") Monitor-1: HDMI-0 pos: primary,left res: 3840x2160 hz: 60 dpi: 163 size: 597x336mm (23.5x13.23") diag: 685mm (26.97") modes: N/A Monitor-2: HDMI-1 pos: right res: 3840x2160 hz: 60 dpi: 187 size: 521x293mm (20.51x11.54") diag: 598mm (23.53") modes: N/A API: OpenGL v: 4.6.0 NVIDIA 525.147.05 renderer: NVIDIA GeForce RTX 3070/PCIe/SSE2 direct-render: Yes Audio: Device-1: NVIDIA GA104 High Definition Audio vendor: ASUSTeK driver: snd_hda_intel bus-ID: 3-2:3 v: kernel chip-ID: 1235:8201 pcie: class-ID: 0103 gen: 3 serial: speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/s bus-ID: 27:00.1 chip-ID: 10de:228b class-ID: 0403 Device-2: Focusrite-Novation Scarlett 18i20 USB type: USB driver: snd-usb-audio API: ALSA v: k6.1.0-21-amd64 status: kernel-api tools: alsamixer,amixer Server-1: JACK v: 1.9.21 status: off tools: jack_control,jack_mixer Server-2: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl Network: Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Micro-Star MSI driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: f000 bus-ID: 22:00.0 chip-ID: 10ec:8168 class-ID: 0200 IF: eth0 state: up speed: 1000 Mbps duplex: full mac: Drives: Local Storage: total: 6.94 TiB used: 5.05 TiB (72.8%) SMART Message: Unable to run smartctl. Root privileges required. ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: MZVLW256HEHP-000H1 size: 238.47 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: rev: CXB73H1Q temp: 42.9 C scheme: GPT ID-2: /dev/sda maj-min: 8:0 vendor: Seagate model: ST4000DM004-2CV104 size: 3.64 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 5425 serial: rev: 0001 scheme: GPT ID-3: /dev/sdb maj-min: 8:16 vendor: Samsung model: SSD 840 EVO 120GB size: 111.79 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: rev: BB6Q scheme: GPT ID-4: /dev/sdc maj-min: 8:32 vendor: Seagate model: ST3000DM008-2DM166 size: 2.73 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 7200 serial: rev: CC26 scheme: GPT ID-5: /dev/sdd maj-min: 8:48 vendor: Samsung model: SSD 850 EVO 250GB size: 232.89 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: rev: 2B6Q scheme: GPT Partition: ID-1: / raw-size: 112.3 GiB size: 112.3 GiB (100.00%) used: 9.04 GiB (8.0%) fs: btrfs dev: /dev/nvme0n1p6 maj-min: 259:6 ID-2: /boot/efi raw-size: 473 MiB size: 472 MiB (99.80%) used: 592 KiB (0.1%) fs: vfat dev: /dev/sdd1 maj-min: 8:49 ID-3: /home raw-size: 232.42 GiB size: 232.42 GiB (100.00%) used: 61.3 GiB (26.4%) fs: btrfs dev: /dev/sdd2 maj-min: 8:50 Swap: Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default) ID-1: swap-1 type: partition size: 8 GiB used: 0 KiB (0.0%) priority: -2 dev: /dev/sda2 maj-min: 8:2 Sensors: System Temperatures: cpu: 55.2 C mobo: N/A gpu: nvidia temp: 51 C Fan Speeds (RPM): N/A gpu: nvidia fan: 53% Repos: Packages: 2382 pm: dpkg pkgs: 2375 libs: 1269 tools: apt,apt-get,aptitude,nala,synaptic pm: rpm pkgs: 0 pm: appimage pkgs: 0 pm: flatpak pkgs: 0 pm: snap pkgs: 7 No active apt repos in: /etc/apt/sources.list Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 1: deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware Active apt repos in: /etc/apt/sources.list.d/debian.list 1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware 2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware Active apt repos in: /etc/apt/sources.list.d/google-chrome.list 1: deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main Active apt repos in: /etc/apt/sources.list.d/mx.list 1: deb http://mx.debian.nz/mx/repo/ bookworm main non-free Info: Processes: 389 Uptime: 15h 34m wakeups: 11 Memory: 31.29 GiB used: 5.31 GiB (17.0%) Init: systemd v: 252 target: graphical (5) default: graphical tool: systemctl Compilers: gcc: 12.2.0 alt: 12 Client: shell wrapper v: 5.2.15-release inxi: 3.3.26 Boot Mode: UEFI[/CODE]

Are you using OpenCL GPU in darktable?

Yes

If yes, what is the GPU card and driver?

NVidia GeForce RTX3070, driver version 525.147.05

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

No response

grudgingly commented 2 weeks ago

There were recently (past ~week) some updates to help with this problem. It's not quite perfect, but very much improved. Try a current nightly - your build is over a month old.

victoryforce commented 2 weeks ago

@brucewilliamsphotography It would be great if you could check the current nightly and see if this issue is fixed. It should be, but an extra test never hurts.

brucewilliamsphotography commented 2 weeks ago

I will aim to do this, this weekend.

Cheers, Bruce Williams

@.*** twitter.com/audio2u linkedin.com/in/audio2u facebook.com/audio2u soundcloud.com/audio2u quora.com/profile/Bruce-Williams-5?share=1

On Sun, 19 May 2024, 03:04 Victor Forsiuk, @.***> wrote:

@brucewilliamsphotography https://github.com/brucewilliamsphotography It would be great if you could check the current nightly https://github.com/darktable-org/darktable/releases/tag/nightly and see if this issue is fixed. It should be, but an extra test never hurts.

— Reply to this email directly, view it on GitHub https://github.com/darktable-org/darktable/issues/16807#issuecomment-2118881544, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMB4ZDQK6KCC4QM2JQ3IZETZC6CZVAVCNFSM6AAAAABH3LAXV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJYHA4DCNJUGQ . You are receiving this because you were mentioned.Message ID: @.***>

brucewilliamsphotography commented 2 weeks ago

Yep, checked out the latest nightly build, and even after using Rotate & Perspective, exported images DO come out square! Thanks all. Close the issue.

On Sun, May 19, 2024 at 7:41 AM Bruce Williams < @.***> wrote:

I will aim to do this, this weekend.

Cheers, Bruce Williams

@.*** twitter.com/audio2u linkedin.com/in/audio2u facebook.com/audio2u soundcloud.com/audio2u quora.com/profile/Bruce-Williams-5?share=1

On Sun, 19 May 2024, 03:04 Victor Forsiuk, @.***> wrote:

@brucewilliamsphotography https://github.com/brucewilliamsphotography It would be great if you could check the current nightly https://github.com/darktable-org/darktable/releases/tag/nightly and see if this issue is fixed. It should be, but an extra test never hurts.

— Reply to this email directly, view it on GitHub https://github.com/darktable-org/darktable/issues/16807#issuecomment-2118881544, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMB4ZDQK6KCC4QM2JQ3IZETZC6CZVAVCNFSM6AAAAABH3LAXV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJYHA4DCNJUGQ . You are receiving this because you were mentioned.Message ID: @.***>