diff --git a/src/Plugins/TGAImporter/TGAImporter.cpp b/src/Plugins/TGAImporter/TGAImporter.cpp index f02d7c803..f2547164e 100644 --- a/src/Plugins/TGAImporter/TGAImporter.cpp +++ b/src/Plugins/TGAImporter/TGAImporter.cpp @@ -15,6 +15,7 @@ #include "TGAImporter.h" +#include "Utility/Endianness.h" #include "Math/Vector2.h" #include "Image.h" @@ -32,8 +33,11 @@ bool TGAImporter::open(std::istream& in) { Header header; in.read(reinterpret_cast(&header), sizeof(Header)); - ColorFormat colorFormat; + /* Convert to machine endian */ + header.width = Endianness::littleEndian(header.width); + header.height = Endianness::littleEndian(header.height); + ColorFormat colorFormat; switch(header.bpp) { case 24: colorFormat = ColorFormat::BGR;