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
- Open Tiled 1.10.
- Create a new TMX map of big dimensions (e.g. 300x300 tiles of 64x64 pixels).
- Add an image layer.
- 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