Error when opening Godot project

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By JulioYagami

When I open my Godot project I see the following error in the output:

Godot Engine v3.1.1.stable.official (c) 2007-2019 Juan Linietsky, Ariel Manzur & Godot Contributors.
 scene/resources/bit_map.cpp:37 - Condition ' p_size.width < 1 ' is true.

How to fix that?

What did you change since you previously opened your project?
(Compare with a backup copy)

Did you add resources?

The error message seems to indicate that there’s a file with invalid contents. (An image resouce with width or height = 0).

Open the project with:

<godot executable> -v <path to project.godot file>

To get a more verbose output.

wombatstampede | 2019-11-12 08:15

Here’s the output:

Loading resource: res://assets/sprites/controls/move_pressed.png
Loading resource: res://assets/sprites/controls/shoot.png
Loading resource: res://assets/sprites/controls/shoot_pressed.png
ERROR: create: Condition ' p_size.width < 1 ' is true.
   At: scene/resources/bit_map.cpp:37.
Loading resource: res://scenes/LifeCounter.tscn
Loading resource: res://scripts/LifeCounter.gd
Loading resource: res://assets/sprites/heart.png
EditorSettings: Save OK!

JulioYagami | 2019-11-12 17:36

Obviously, it seems that shoot_pressed.png has a problem. Either the file itself or its corresponding imported asset in the .imports folder maybe corrupt.

Did you check shoot_pressed.png (i.e. load it with an image editor) ? Is it actually in the *.png format?

wombatstampede | 2019-11-13 07:12

Yes, it’s a .png file and it opens normally. I renamed it and the problem occurs yet.

JulioYagami | 2019-11-13 10:52

Does godot fail to open? (Does not seem so as messages continue)

What did you change before the error occured?

Maybe the imported file of shoot_pressed.png in the .import folder is corrupt. Delete the corresponding files (in the .imports folder only!) and it should be recreated automatically next time. The names of these files should be shoot_pressed.png-.
(if you didn’t do a backup of your project already, then do it before deleting any files.)

The error indicates that the size of a bitmap is 0 or less than 0. This indicates some wrong file or maybe unsupported file format. (An exotic example would be a PNG with floating point values.)

wombatstampede | 2019-11-13 11:40

:bust_in_silhouette: Reply From: JulioYagami

I just removed .import folder and it worked!