mapeditor/tiled

Error when opening tmx file with large image file: Failed to read metatile map xyz.jpg. Not a map file. #3631

filiph posted onGitHub

Describe the bug

When opening a map that I saved in Tiled 1.9.2, I get this error in the Tiled interface:

Failed to read metatile map /Users/myusername/path/to/image.jpg: Not a map file.

Line 1, column 1

The path refers to a file that exists, and that is used as the image of an Image Layer. I'm not sure why it's considered a "metatile map" or a "map file".

This is the layer in the TMX file:

 <imagelayer id="2" name="background">
  <image source="santacruz.jpg"/>
 </imagelayer>

And this was the XML code before version 1.10 (note the width/height, which got deleted by version 1.10):

 <imagelayer id="2" name="background">
  <image source="santacruz.jpg" width="19200" height="19200"/>
 </imagelayer>

(Yes, the image is that large. 19200x19200 pixels. This works well with my game, and it worked fine with Tiled 1.9, too.)

I tried adding a more reasonably sized image (1920x1920) and it showed up correctly, even in 1.10. On the other hand, my whole workflow is about having a big background image behind the whole map, and the 1920x1920 image only fills the top-left one-hundredth of the map.

To Reproduce

  1. Open Tiled 1.10.
  2. Create a new TMX map of big dimensions (e.g. 300x300 tiles of 64x64 pixels).
  3. Add an image layer.
  4. Select a very big file (e.g. 19200x19200 pixels).

Expected behavior The big image fills the map.

Media

Map opened in 1.9 <img width="1552" alt="Screenshot 2023-03-22 at 19 38 24" src="https://user-images.githubusercontent.com/919717/227004889-79808439-e9d6-4946-95d4-5d4b17d5eb09.png">

Same map opened in 1.10 <img width="1552" alt="Screenshot 2023-03-22 at 19 37 02" src="https://user-images.githubusercontent.com/919717/227004940-baaffa76-33d5-4a93-8997-802348a136c9.png">

Specifications:

  • OS: macOS 13.2.1 (22D68)
  • Tiled Version: 1.10.0

This is a known issue, and will be resolved in the next release. You can find more details in #3616, and there is also a workaround you can use in that thread until the next version. The "not a map" warning comes up because Tiled fails to load the image due to the allocation size limit, and tries to load it as a map, which also fails.

posted by eishiya almost 2 years ago

Closing as duplicate of #3616. In addition to the workaround, you can install a newer build with the fix from https://github.com/mapeditor/tiled/actions/workflows/packages.yml?query=branch%3Amaster+event%3Apush (click a build, scroll down to Artifacts.

posted by bjorn almost 2 years ago

Fund this Issue

$0.00
Funded

Pull requests