aboutsummaryrefslogtreecommitdiff
path: root/src/PNGImage.cpp
diff options
context:
space:
mode:
authorDylan <boss@tehbox.org>2026-03-18 16:28:27 +1300
committerDylan <boss@tehbox.org>2026-03-18 16:28:27 +1300
commit93a78ac64327b53f53952b625c7ce8a11bcc8651 (patch)
treedf2bcea7256df8acdab5cb51edb0b59291b5b89c /src/PNGImage.cpp
parent8ca054ab8cf04e514df1570617b6a32ed83b9ea4 (diff)
downloadtehimage-93a78ac64327b53f53952b625c7ce8a11bcc8651.tar.gz
tehimage-93a78ac64327b53f53952b625c7ce8a11bcc8651.zip
feat: Added endianness option to readerHEADmaster
The file reader class can now support either endianness to read in, and will convert to the native endianness
Diffstat (limited to 'src/PNGImage.cpp')
-rw-r--r--src/PNGImage.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/PNGImage.cpp b/src/PNGImage.cpp
index 9ba7404..9ab0751 100644
--- a/src/PNGImage.cpp
+++ b/src/PNGImage.cpp
@@ -1,4 +1,5 @@
#include "PNGImage.h"
+#include "reader.h"
#include "zlib.h"
#include "debug.h"
@@ -9,6 +10,7 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
+#include <endian.h>
#include <iostream>
#include <memory>
#include <stdexcept>
@@ -49,7 +51,7 @@ namespace TehImage
int PNGImage::readFromFile(std::string filename)
{
- std::unique_ptr<Reader> readerMem(new Reader(filename));
+ std::unique_ptr<Reader> readerMem(new Reader(filename, FileEndianness::BIG));
reader = readerMem.get();
char signature[8];