Skip to content
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

[HELP] Pictures not Rendering on WIndows #1998

Open
snoweuph opened this issue Mar 9, 2025 · 7 comments
Open

[HELP] Pictures not Rendering on WIndows #1998

snoweuph opened this issue Mar 9, 2025 · 7 comments

Comments

@snoweuph
Copy link

snoweuph commented Mar 9, 2025

Image

I'm loading the picture like this:

let logo_image = gtk::Picture::builder()
            .file(&gtk::gio::File::for_path(
                path::icons_dir().join(APP_ID.to_owned() + ".svg"),
            ))
            .vexpand(true)
            .hexpand(true)
            .valign(gtk::Align::Fill)
            .halign(gtk::Align::Fill)
            .build();

The Path and files are existing, there's also no warning about any missing dependencies on Windows.

Image

It is build in Msys2 (Quasi-Msys2)
Here is the full build peipeline:

variables:
    ZIP_DIR: "$CI_PROJECT_DIR/zip"
  script:
    - source /quasi-msys2/env/all.src || true
    - cargo build --release
    - mkdir $ZIP_DIR
    - cp target/x86_64-pc-windows-gnu/release/report-book-generator.exe $ZIP_DIR
    - for exe in "gdbus.exe" "gdk-pixbuf-pixdata.exe" "gettext.exe" "gio.exe" "gresource.exe" "gsettings.exe" "gtk4-encode-symbolic-svg.exe"; do cp "/mingw64/bin/$exe" "$ZIP_DIR"; done
    - export dlls=($(find "$ZIP_DIR" -type f -iname "*.exe" -exec win-ldd {} \; | grep "=>" | grep -v "wine" | sed -E 's/.*=>\s*(.*)\s*\(.*\)/\1/' | sort -u))
    - for dll in "${dlls[@]}"; do [ -f "$dll" ] && cp -f "$dll" "$ZIP_DIR"; done
    - find res/locale -name "*.po" -exec sh -c 'msgfmt --no-convert "$1" -o "${1%.po}.mo"' _ {} \;
    - glib-compile-schemas /mingw64/share/glib-2.0/schemas/
    - cp -r /mingw64/share/ $ZIP_DIR
    - cp -r res $ZIP_DIR
    - cd $ZIP_DIR
    - zip -r report-book-generator.zip . -i "*.exe" "*.dll" "res/*" "share/*"
    - |
      /usr/bin/curl \
        --location \
        --header "JOB-TOKEN: $CI_JOB_TOKEN" \
        --upload-file ./report-book-generator.zip \
        "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/release/${CI_COMMIT_TAG}/ReportBookGenerator.zip"

The Libadwaita Icons are also installed as well in the build Container:

RUN cd /quasi-msys2 \
  && make install \
    _ntldd \
    mingw-w64-x86_64-adwaita-icon-theme \
    mingw-w64-x86_64-libadwaita \
    mingw-w64-x86_64-gettext \
    mingw-w64-x86_64-gsettings-desktop-schemas

And the whole share folder is included in the final distribution.

I think that the problem of not loading/rendering the SVG on Windows is related to the icons also partially not being loaded.

Anything That I specifically should have in my final zip as well, that I'm missing?

@bilelmoussaoui
Copy link
Member

I am assuming the icons are SVG and you lack librsvg and it gdkpixbuf loader

@snoweuph
Copy link
Author

snoweuph commented Mar 11, 2025

okay, gonna try including them as well

@snoweuph
Copy link
Author

snoweuph commented Mar 11, 2025

Are we talking about gdk-pixbuf-querry-loaders.exe ?

@snoweuph
Copy link
Author

Image

I copied Over the whole Mingw structure into the folder (lib, share, etc ....)
As we can see now, the problem seems to be that "/" is used instead of "" outside the environment.

@bilelmoussaoui
Copy link
Member

No clue why is that happening. Do you have librsvg installed there as well?

@snoweuph
Copy link
Author

It's one of the dlls I copied over.

I guess I should try doing a gvsbuild outside msys2 and linking to that instead

@Arian8j2
Copy link

I have the same issue also in msys2 but PNG files and also the close and minimize icons are fixed and shown but the gtk::Picture with SVG picture is not shown, I don't know if it's related or not but there are only jp2 and webp pixbuf loaders available in msys2:

ucrt64/mingw-w64-ucrt-x86_64-jp2-pixbuf-loader 0.0.2-2 [installed]
    JPEG2000 GDK Pixbuf Loader library (mingw-w64)
ucrt64/mingw-w64-ucrt-x86_64-webp-pixbuf-loader 0.2.7-1 [installed]
    WebP GDK Pixbuf Loader library (mingw-w64)

also i have librsvg and these loaders installed but the issue is not gone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants