Jpeg: Allow loading on big endian

This commit is contained in:
Zach DeCook 2025-02-01 11:36:24 -05:00
parent 12cd7034e4
commit dc5a6ce409

View file

@ -9,9 +9,6 @@ std::expected<cairo_surface_t*, std::string> JPEG::createSurfaceFromJPEG(const s
if (!std::filesystem::exists(path))
return std::unexpected("loading jpeg: file doesn't exist");
if (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__)
return std::unexpected("loading jpeg: cannot load on big endian");
std::ifstream file(path, std::ios::binary | std::ios::ate);
file.exceptions(std::ifstream::failbit | std::ifstream::badbit | std::ifstream::eofbit);
std::vector<uint8_t> bytes(file.tellg());