Why can't I import my JPEG file?

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

When I try to import my 1x1 JPEG file, it gives me back this error on import:

- core/io/image_loader.cpp:69 - Error loading image: res://Graphics/main.jpg
- editor/editor_file_system.cpp:1800 - Error importing 'res://Graphics/main.jpg'

Why is this happening?

UPDATE: I just use PNG.

:bust_in_silhouette: Reply From: jgodfrey

Not sure. Using Godot 3.2.1 stable (Win 10) I was able to import a single-pixel JPG file created in Aseprite. Is it possible your JPG file is invalid? Can you load / view it in a typical image viewer app? Maybe post the file if you can’t find the problem, but it does work here as described above.

Additionally, I’ll say that you’re probably better off with a lossless format like PNG rather than JPG. Any file size reductions you get from JPG (if that’s why you’re using JPG) will be completely negated with such a small file. In fact I’d guess that a lossless, 1-pixel PNG file will be much smaller in file size than its JPG counterpart.

jgodfrey | 2020-06-12 18:48