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

Error loading webp format. Version 1.10.1. #3661

Closed
akawana opened this issue Apr 16, 2023 · 16 comments
Closed

Error loading webp format. Version 1.10.1. #3661

akawana opened this issue Apr 16, 2023 · 16 comments
Labels
bug Broken behavior. qt issue Qt related issue.

Comments

@akawana
Copy link

akawana commented Apr 16, 2023

Good afternoon,

I have already written in the forum, but I want to repeat it here. Both new versions (1.10 and 1.10.1) refuse to load images in webp format. All the tilesets look broken.

Webp worked fine in version 1.9 and since I don't think the format library has changed, maybe it's just that the loader started to ignore this format?

I really ask you to look at the problem, as we are talking about a project with hundreds of tilesets and thousands of pictures.

This is what the error looks like in version 1.10.1 now:
https://pasteboard.co/5W7j1EZ5Ffdh.png

Thank you.

@akawana akawana added the bug Broken behavior. label Apr 16, 2023
@syrokomskyi
Copy link

I confirm the problem. Even if you rename (not convert) the files *.webp to *.png and make the same changes to the text *.tmx, the images will not load into TiledMap (error Unsupported format).

For @akawana.
In XnView you can convert thousands images in any format with preserve its paths: Tools/Batch processing or Ctrl+U.

@eishiya
Copy link
Contributor

eishiya commented Apr 17, 2023

I suspect the problem is that the WebP reading library that used to be included with Tiled either somehow got left out of the new builds, or is not compatible with Qt6 (perhaps it just needs to be updated). The correct fix would be to bring back support for WebP, converting images to what may be a less suitable format is not ideal.

A workaround for now would be to keep using Tiled 1.9.2 until this can be resolved.

@akawana nitpick on your wording: "upload" usually means putting files to another machine over a connection. Tiled runs locally on your machine, so there's no uploading. It's simply "opening" files, or importing them. Tiled isn't ignoring your files, it's trying and failing to open them - the library it needs to open these files is missing.

@bjorn
Copy link
Member

bjorn commented Apr 19, 2023

Hmm, it seems that with Qt 6.4.2, the qwebp.dll image format plugin is no longer linked statically to libwebp, but now requires DLL files LIBWEBP-7__.DLL, LIBWEBPDEMUX-2__.DLL and LIBWEBPMUX-3__.DLL to be shipped. However, right now I'm not sure where to get these files. I could not find them among the distributed Qt binaries so far, and the binaries I found at http://downloads.webmproject.org/releases/webp/ only contained static builds.

The only workaround I can suggest at the moment, apart from switching back to Tiled 1.9.2, is to use the 32-bit "Windows 7-8" release of Tiled, which is available at https://github.com/mapeditor/tiled/releases, since this build is using Qt 5.

I noticed that Qt Creator itself is still able to load WebP images, even though it's using Qt 6.4.2. But it appears to be using a custom build of Qt where the qwebp.dll is still linked statically to libwebp. Unfortunately, replacing the qwebp.dll of Tiled with the one from Qt Creator also does not appear to work, likely due to do incompatibilities since it uses a different C runtime (built using Visual Studio rather than MinGW).

@akawana
Copy link
Author

akawana commented Apr 19, 2023

@signmotion It is not a problem to write a simple script to convert format and change all the file names in Tiled files. The problem is server traffic. WebP is quite good in many cases. Gives twice smaller filesizes even if we compare with highly optimized png. Not everywhere, but in most cases. This all is important if we talk about 1000+ sprites project.

@eishiya Noted )

@bjorn Thank you for explanation. I don't mind to continue using the 1.9 version but please don't forget to check the updates of Qt library in the future and maybe contact the developer.

We use webp for a long time. The format is quite good in many cases especially if we require transparent objects. Even optimized PNG gives bigger files in many cases.

Thank you for your attention guys.

@bjorn bjorn added the qt issue Qt related issue. label Apr 19, 2023
@eishiya
Copy link
Contributor

eishiya commented Apr 19, 2023

@bjorn SDL_image (https://github.com/libsdl-org/SDL_image) seems to build its own DLLs via submodules (see the "external" directory), perhaps that can be an option for Tiled? They only build one of the DLLs, but I believe libwebp can build all three.

I tried downloading the DLLs myself just to see if maybe that would be a possible workaround for OP, but no matter where I put them (next to tiled.exe, path, next to qwebp.dll) and what I named them (with __ or without), Qt6 Tiled still did not read webp ): Looks like there's something else that's required, or there's a binary compatibility issue.

@akawana
Copy link
Author

akawana commented Aug 8, 2023

@bjorn

Which version of QT is included in to the new release (1.10.2)? Because looks like they fixed this in 6.5.2 6.6 6.7

https://bugreports.qt.io/browse/QTBUG-113726

@eishiya
Copy link
Contributor

eishiya commented Aug 8, 2023

1.10.2 uses Qt 6.5.2, but the signed Windows releases on are built with 6.4.3 because they're built with AppVeyor, which doesn't have that yet.

Edit: The auto builds are not signed, so if you need a Windows build, you could try one of the recent auto builds, which should also be 6.5.2 AFAIK.

@akawana
Copy link
Author

akawana commented Aug 8, 2023

@eishiya

Tried one from here: https://github.com/mapeditor/tiled/actions/runs/5762461406

ZIP archive.

What's interesting is that all the "Based on tileset image" tilesets loaded fine. But all "Collection of images" tilesets did not load "Image not found".

Both of these tilesets use only webp images.

@bjorn
Copy link
Member

bjorn commented Aug 10, 2023

@akawana I haven't tested this yet, but the "fix version" on https://bugreports.qt.io/browse/QTBUG-113726 actually says Qt 6.5.3, which isn't out yet. But it's good to know a fix is coming on the Qt side!

@akawana
Copy link
Author

akawana commented Oct 11, 2023

@bjorn Looks like the bug you mentioned is already closed. Does it mean that last tiled builds which I can doenload as ZIP archives should include the last QT builds? Because the webp loading bug still exist in the last build.

@akawana
Copy link
Author

akawana commented Oct 12, 2023

FYI: Last build of Tiled win32 works fine with webp. Win64 doesn't work. Win64 version also gives an qt error on start, but I don't think it's important:

qt.qpa.window: SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) failed: COM error 0x5: Access is denied. ↑
Qt's default DPI awareness context is DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2. If you know what you are doing you can overwrite this default using qt.conf (https://doc.qt.io/qt-6/highdpi.html#configuring-windows)

bjorn added a commit to bjorn/tiled-dev that referenced this issue Oct 16, 2023
This should hopefully fix the WebP image plugin.

Issue mapeditor#3661
@bjorn
Copy link
Member

bjorn commented Oct 16, 2023

@akawana It would be great if you could test the 64-bit builds resulting from #3829 (will be available at https://github.com/mapeditor/tiled/actions/runs/6531541423?pr=3829). That the 32-bit builds do not have this problem is known, since this issue only affected Qt 6 and the 32-bit build uses Qt 5 in order to support older systems.

Win64 version also gives an qt error on start, but I don't think it's important:

You mean it does not stop Tiled from running? Please let me know if you still see this issue on the new Qt 6.5.3 build as well.

@akawana
Copy link
Author

akawana commented Oct 16, 2023

@bjorn

The win64 build you gave me works fine with webp, however it still gives same error on start, which is more like warning and doesn't effect on tiled work:

qt.qpa.window: SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) failed: COM error 0x5: Access is denied. ↑
Qt's default DPI awareness context is DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2. If you know what you are doing you can overwrite this default using qt.conf (https://doc.qt.io/qt-6/highdpi.html#configuring-windows)

There is a way to hide this error by putting

[Platforms]
WindowsArguments = dpiawareness=2

in to the qt.conf file.

@bjorn bjorn closed this as completed in 51195f6 Oct 31, 2023
@bjorn
Copy link
Member

bjorn commented Oct 31, 2023

@akawana Regarding the DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 related error, I can't reproduce this on Windows 11. I guess it may only happen on Windows 10 versions before the Creators Update. Are you using such an old Windows 10 version?

According to QTBUG-103733 though, that warning was addressed in Qt 6.4.0 Beta1 and Qt 6.5.0 Beta1, so it should be included in Qt 6.5.3. However, I see that likely the patch has not actually hidden the message, even though it should be completely harmless. In any case I don't think it is a good idea for me to work it around by changing platform settings, and I have instead left a comment on the patch such that it might get addressed in a future Qt release. In the meantime I think you can just ignore the message.

@akawana
Copy link
Author

akawana commented Dec 29, 2023

@bjorn

Just installed version 1.10.2

  1. I don't see the "DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2" error (Windows 11)

  2. WEBP does not work again, but not everywhere. The format do not work only in "Based on collection of images" tilesets. The "Based on Tileset image" tilesets work fine. Attached is the screenshot. The terrain you see is composed using "Based on Tileset image" tileset, But all the bushes and trees and building disappear. They are from "Based on collection of images" tilesets.

All paths are correct, of course. And the project can be opened in the last build win64 which I downloaded from the link you gave: https://github.com/mapeditor/tiled/actions/runs/6531541423?pr=3829

Could you make ZIP builds for all releases?

Untitled-1

@bjorn
Copy link
Member

bjorn commented Jan 12, 2024

@akawana Tiled 1.10.2 still has the issue because the WebP support was fixed after that release.

Could you make ZIP builds for all releases?

You can find .zip files for each build at https://github.com/mapeditor/tiled/actions/workflows/packages.yml?query=branch%3Amaster+event%3Apush:

  • Click the most recent successful build.
  • Scroll down to Artifacts.
  • Download "Tiled-win64" (not "Tiled-win64-msi", that's the installer).

I'll consider making .zip also available at https://github.com/mapeditor/tiled/releases (see also #366).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken behavior. qt issue Qt related issue.
Projects
None yet
Development

No branches or pull requests

4 participants