-
Notifications
You must be signed in to change notification settings - Fork 25
have a go at libraw #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Of course there's an upstream It still fails to link though. I tried 0.21.4 and 0.21.1 (the upstream version of libraw). I'll try without jasper. |
The subdirectory inside the tarball lacks the test release suffix.
|
Ah, the Commit fbfe0f0 should fix that. |
|
So cool! Did you try viewing a zone plate? Are the tile borders fixed? I'll build here too. |
|
... I thought of another question, is there any way to get openmp under mingw? Though I don't know how much libraw benefits, if at all. |
The tile borders were no longer visible on the zone plate image the last time I checked.
The last time I looked into OpenMP, it didn't seem worth the effort. It was also a bit tricky to cross-compile since a MASM-compatible assembler was required. In the 'web' group dependencies, OpenMP is only used in Pixman for blue noise generation. In the 'all' group, aside from LibRaw, only FFTW and IM would benefit from it. |
|
Great! I built here too and uploaded the binaries to the 4.1.0 release on github. Thank you very much for doing all this work, Kleis! |
|
Which GSK renderer are you using? You can check that with Control + Shift + I and then clicking the "Global"-tab. I was able to reproduce this by setting the |
|
Yes, cairo since I'm on software render. I didn't realise the gtk patch was hardware render only, that's good to know. |
|
A friend is seeing tile borders with the GL GSK renderer :( I'll try on another PC here. |
That's odd. I'm not entirely sure if the renderer shown in the GTK Inspector reflects the actual backend in use, it might(?) silently fallback to Cairo. You can debug this by setting the On my Windows machine using $ chcp 65001
Active code page: 65001
$ set G_WIN32_ATTACH_CONSOLE=stdout,stderr
$ set GDK_DEBUG=opengl
$ vipsdisp
requesting pixel format...
requested and set pixel format: 18
Creating core WGL context (version:3.3, debug:no, forward:no)
Created WGL context[0000000000010001], pixel_format=18
OpenGL version: 4.6 (core)
GLSL version: 4.60 NVIDIA
Max texture size: 32768
Enabled features (use GDK_GL_DISABLE env var to disable):
debug: ✓
base-instance: ✓
buffer-storage: ✓
WGL API version 4.6 found
- Vendor: NVIDIA Corporation
- Renderer: NVIDIA GeForce GTX 1070/PCIe/SSE2
- Quirks / disallow swap exchange: enabled
- Checked extensions:
* WGL_ARB_pixel_format: yes
* WGL_ARB_create_context: yes
* WGL_EXT_swap_control: yes
* WGL_OML_sync_control: no
* GL_WIN_swap_hint: yes
Using OpenGL backend Windows WGL |
|
I tried on another PC here (an old Dell with a nv 1060) and it's working fine. It also shows GL as the GSK backend. I'll ask my friend to try with |
|
Does the image in question have transparency? I just noticed that the backdrop tiles are added using Commit a43a0b6 ensures that textures added using |
|
I think he was viewing RGB, not RGBA. But I changed the tilecache -- it's always RGBA now, and always 256 * 256. That's so you can be showing an RGB image, then flip to an RGBA image and it won't need to throw the whole tree away, so you can prevent the display flashing black for a moment. |
|
Could it be related to high DPI? I think he saw the lines on a 4k display with 200% scaling. |
|
I was able to reproduce this issue on both GL and Cairo renderers by setting the |
|
Ah, I was able to set the scaling to 200% through Windows' advanced scaling settings and can confirm it causes thin white lines. Commit f35126c updates GTK to 4.19.2, but unfortunately, that didn't fix it. |
|
I also noticed this interesting merge request: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/8503. |
This reverts commit f35126c due to https://gitlab.gnome.org/GNOME/gtk/-/issues/7567.
|
How frustrating! Perhaps we should add a "snap rectangle to nearest hardware pixel boundary" function to vipsdisp instead? It should be simpler than patching gtk. I think I can see what to do, I'll try a quick PR. |
|
I had a quick hack, what do you think? It seems to work OK on linux, including fractional desktop scaling, but I've not tested elsewhere yet. |
|
Since I could also reproduce this issue on Fedora, perhaps we should provide early feedback on the upstream merge request? Here's a standalone reproducer: Details$ gtk4-rendernode-tool show ~/Downloads/zone-plate.node
|
|
To reproduce the high-DPI problem, build this PR libvips/vipsdisp#51 without gtk snapping, then load the checkerboard image, select 1:1, and scroll to the top-left of the image. I see: So 114 high paint rect (gtk coordinates) fetches 228 lines of pixels from the image, ie. the 256x256 pixel tiles are drawn at 128x128 in gtk coordinates. You can use "d" to see the tiles are nice and small now. But the image is wrong:
EVen with NN the 0/255 pixels have become a flat 127. |
|
Ooof I changed my mind, sorry, this branch now has the high-DPI experiment https://github.com/jcupitt/vipsdisp/tree/add-high-dpi https://github.com/jcupitt/vipsdisp/tree/add-tile-snap now just has tile snapping in vipsdisp and no attempt at high-DPI. |
|
... I merged the tilesnapping code to vipsdisp master. It has some issues, but the white lines are gone for everything except the checkerboard image on linux and win, even with fractional desktop scaling. |
|
Great! I just added comment https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/8494#note_2507714 to the upstream MR. I'll look into that high-DPI issue later today. |
|
... according to upstream, we should probably be doing this first: /* Snap the textures to a physical pixel.
*/
gtk_snapshot_scale(snapshot, pixel_size, pixel_size);(I also noticed that this was done in MR https://gitlab.gnome.org/GNOME/papers/-/merge_requests/505) I had a very quick go with commit kleisauke/vipsdisp@1cd9844, which seems to work, but some further work is needed to get the positioning right. |
|
I hadn't seen that API! Yes, that seems to fix high-DPI! It fixes the jelly effect too. I'll try a PR to fix the sizing and coordinate issues. |
|
This seems to add high-dpi correctly: We now have no white lines, even with fractional display scaling, and 1:1 image pixel == hardware display pixel! No jelly effect on scroll either. (tested on ubuntu 25.04 with various desktop display densities) |
|
Great! I'll test this on Windows later today. |
|
Ah fantastic! Then I think we're done here. |
kleisauke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I just created the 8.17 branch, which will serve as the base for future v8.17.x updates.
|
https://github.com/libvips/build-win64-mxe/releases/tag/v8.18.0-test1 🎉 I also commented on the upstream merge request, noting that this was indeed the issue we ran into. |








It's almost there, it fails with:
Perhaps because it's building (or linking?) with g++ and not clang?
I pointed vips-all.mk at 8.18.0-test1 just for testing, using
--nightlywould probably be better.