mirror of
https://github.com/hyprwm/hyprgraphics.git
synced 2025-12-23 04:20:03 +01:00
Jpeg: Allow loading on big endian
This commit is contained in:
parent
12cd7034e4
commit
dc5a6ce409
1 changed files with 0 additions and 3 deletions
|
|
@ -9,9 +9,6 @@ std::expected<cairo_surface_t*, std::string> JPEG::createSurfaceFromJPEG(const s
|
||||||
if (!std::filesystem::exists(path))
|
if (!std::filesystem::exists(path))
|
||||||
return std::unexpected("loading jpeg: file doesn't exist");
|
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);
|
std::ifstream file(path, std::ios::binary | std::ios::ate);
|
||||||
file.exceptions(std::ifstream::failbit | std::ifstream::badbit | std::ifstream::eofbit);
|
file.exceptions(std::ifstream::failbit | std::ifstream::badbit | std::ifstream::eofbit);
|
||||||
std::vector<uint8_t> bytes(file.tellg());
|
std::vector<uint8_t> bytes(file.tellg());
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue