-
Notifications
You must be signed in to change notification settings - Fork 11
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
Build VIPSDISP on windows #21
Comments
Hi @euzada, I would start with the libvips build system: https://github.com/libvips/build-win64-mxe And add the various gtk4 binaries. |
The To build locally, you can use:
|
Woah, that's fantastic Kleis! Nice job! What's performance like? Can you zoom smoothly on large images? |
I suppose that's a problem with the icon theme? What if you hold down |
Yeah, it looks like a theme issue. Here's a screencast while holding down i. vipsdisp_lK2Jv9nTom.mp4 |
So ... hot. I'll try a build here. |
I noticed a tiny thing on ubuntu 23.04 -- I see:
I had to disable podman by editing |
What a good news. Thank you @kleisauke and @jcupitt for sharing. I will try to build it tomorrow on my windows and leave you feedback after building and testing. |
Hi @kleisauke , is that branch on the top of 8.15.0 rc1 or 8.14? |
It's based on top of v8.15.0-rc1, as required by vipsdisp v2.6.1. Lines 40 to 41 in 3549634
|
I think this patch would also fix that: --- a/build.sh
+++ b/build.sh
@@ -186,7 +186,7 @@ fi
mkdir -p $tmpdir
# Ensure latest Debian stable base image
-$oci_runtime pull buildpack-deps:bullseye
+$oci_runtime pull docker.io/library/buildpack-deps:bullseye
# Create a machine image with all the required build tools pre-installed
$oci_runtime build -t libvips-build-win-mxe container
--- a/container/Dockerfile
+++ b/container/Dockerfile
@@ -1,4 +1,4 @@
-FROM buildpack-deps:bullseye
+FROM docker.io/library/buildpack-deps:bullseye
RUN apt-get update \
&& apt-get install -y \ But indeed, perhaps I should disable that Podman in favor of Docker if-else statement, since Fedora/RHEL also have an RPM called |
The build was successful. It builds V8.15.0 rc1 and vipsdisp.exe (V2.6.0). Loaded a very large image (7.5GB ) with no issues. The previous and next page icons are missing as mentioned previously. |
We should make a list of small issues with the win build, since we're all looking at it. I noticed:
Are there any others? |
When I first open the executable I see terminal with: Than when I tried to save an image in another tiff format, I got:
|
I also noticed:
I've tentatively "fixed" this with commit libvips/build-win64-mxe@6ad6917. I'm not sure if D-Bus integration can be disabled, it looks like a required thing.
I'm not sure about those gsignal errors, but the Line 377 in 02b5250
(adding support for flags as save option would also make VipsForeignPngFilter work)
|
Ah you're right, the save-as dialog is missing some stuff, and doesn't resize too well. I have to make a long train journey today, I'll have a poke at it. |
I fixed up sizing and added flags support, so that resolved the |
Save as TIFF seems to work fine on linux, perhaps there's a win issue here? |
I build the latest update.
|
That's great! Is app startup faster? It was quite slow before. It ought to pop up a window almost instantly. I don't know what's causing the signal errors, I don't see them here :( Some gtk/glib compat issue, perhaps? i/o not being smooth can happen with some file formats. Are files that were smooth before hitching now? |
I check the previous version, the i/o where not smooth. So maybe it is my file size. Will generate smaller file and test again. |
Windows We just need to set a compiler flag when linking |
Ah, setting |
It looks like specifying I'll try a patch and also investigate those signal errors. |
I did some test using the following command in bash for windows and did not see any difference in the latest version. I don't know if I should run a different command. The output was something like that for both versions:
|
Oh, clever idea. Perhaps it's just slow to load all those DLLs? There are a lot of them. A static build might be faster. |
I build it with the following command:
Do I try static build? |
Yes, try static. I tried this in static void
vipsdisp_app_activate( GApplication *app )
{
ImageWindow *win;
win = image_window_new( VIPSDISP_APP( app ) );
gtk_window_present( GTK_WINDOW( win ) );
process_events();
exit(0);
} ie. on startup, show the main window, process a few events, then quit. On ubuntu I see:
which feels fast. |
I am getting this error trying to build it with static flag like that:
|
You need to build libvips static, then vipsdisp dynamic. |
The |
Oh nice find, I added that to |
Great! I can confirm that commit ff7b8cb removes the stray terminal window. To avoid having to spend any extra CPU time building these binaries, I've uploaded the 64-bit libvips 8.15.0-rc1 Windows binaries with vipsdisp here: |
I can confirm no Terminal at the start. and Save windows use Windows explorer. I will do some test for the speed later today. Thank you. |
I tried out "loupe", the new gtk4 image viewer that gnome have made: https://gitlab.gnome.org/GNOME/loupe With
The version in ubuntu 23.10 loads the image in 13.5s and needs 7.5gb of memory. Panning needs maybe 8% of CPU on my PC. It's nice and smooth. The Gnome nightly build of Loupe loads in 13.5s again, but only needs 2.3gb of memory, so they've made some good improvements there. CPU use seems about the same. On this ubuntu 23.10 PC, a release build of vipsdisp loads the image in 8s and needs 1.3gb of memory. Panning is about 15% of CPU. We're a little less smooth. So we win on load speed and memory use, as you'd hope heh. We could probably get CPU use down --- at the moment, vipsdisp culls tiles to the viewport every frame, but we only really need to cull on tile boundaries. It might improve the frame rate too. They have much slower mousewheel zoom, so we could maybe tune that. |
... I tuned the zoom speed and initial window size to match loupe. |
I don't know if on windows it is the same. When I try to zoom on my PC, The GPU is the one how manage the zoom and increased to almost 10% while zooming (I believe it is good things) . Do you see any GPU increase on Linux? |
Yes, it uses the GPU on linux too. |
I start a fresh build. I am not sure it will apply to the loupe integration. It will take time to build llvm.
Do you know if this will apply to loupe integration? |
There's no loupe integration, I was just benchmarking it for comparison. |
Oh, you mean the changes to vipsdisp to match loupe? You'd need to change |
Yes, this is what I meant. I test the last build and it takes 70ms for the GUI to start. I used |
In Full screen with F11, the menu will be hidden behind the GUI in the background. If you do "Windows + d" to see the desktop than do it again "Win + d" the menu will appear on the front. I believe the solution is to force the right-click menu to always be on the top. We should probably add something like that for the menu: |
Ah, interesting! gtk4 doesn't have https://docs.gtk.org/gtk4/class.Window.html vipsdisp uses the same menu for the burger button on the header bar, and right-click on the image. Maybe this is the cause? Perhaps we ought to use separate menus, or remove the right-click menu? |
I think this is all done now. |
Hi @jcupitt, is there any way I can build vipsdip on Windows? I successfully built it from source on ubuntu, and I tried to install everything I needed on MINGW64. The problem I faced is in meson.build find_library 'm', so I bypass it using
cc.find_library('m', required: false)
. But when I try to run ninja I got a lot of errors.here a copy of part of errors:
FAILED: src/vipsdisp.exe.p/meson-generated_.._vipsdispmarshal.c.obj "cl" "-Isrc/vipsdisp.exe.p" "-Isrc" "-I../src" "-IC:/msys64/mingw64/include/libgsf-1" "-IC:/msys64/m ingw64/include/libxml2" "-IC:/msys64/mingw64/include/" "-IC:/msys64/mingw64/include/pango-1.0" "-IC: /msys64/mingw64/include/harfbuzz" "-IC:/msys64/mingw64/include/fribidi" "-IC:/msys64/mingw64/include /librsvg-2.0" "-IC:/msys64/mingw64/include/gdk-pixbuf-2.0" "-IC:/msys64/mingw64/include/webp" "-IC:/ msys64/mingw64/include/cairo" "-IC:/msys64/mingw64/include/freetype2" "-IC:/msys64/mingw64/include/l ibpng16" "-IC:/msys64/mingw64/include/pixman-1" "-IC:/msys64/mingw64/include/OpenEXR" "-IC:/msys64/m ingw64/include/Imath" "-IC:/msys64/mingw64/include/openjpeg-2.5" "-IC:/msys64/mingw64/include/orc-0. 4" "-IC:/msys64/mingw64/include/glib-2.0" "-IC:/msys64/mingw64/lib/glib-2.0/include" "-IC:/msys64/mi ngw64/include/gtk-4.0" "-IC:/msys64/mingw64/include/graphene-1.0" "-IC:/msys64/mingw64/lib/graphene- 1.0/include" "-I." "/MDd" "/nologo" "/showIncludes" "/utf-8" "/W2" "/std:c11" "/Od" "/Zi" "-DHAVE_CO NFIG_H" "-mfpmath=sse" "-msse" "-msse2" "-DLIBDEFLATE_DLL" "/Fdsrc/vipsdisp.exe.p/meson-generated_.. _vipsdispmarshal.c.pdb" /Fosrc/vipsdisp.exe.p/meson-generated_.._vipsdispmarshal.c.obj "/c" src/vips dispmarshal.c CreateProcess failed: The system cannot find the file specified.
Any suggestions?
The text was updated successfully, but these errors were encountered: