#include "image.hpp" #include "stb_image.h" #include #include #include #include namespace bookmouse { #if 0 class JpegFile { public: ~JpegFile(); void decompress(fud::CBinaryFile& inFile); private: }; #endif ImageResult JpegImage::output() const { auto err = [](ImageError eid) { return ImageResult::error(eid); }; ImageOutput image{}; fud::CBinaryFile inFile{m_filename, fud::CFileMode::ReadOnly}; auto fileResult = inFile.open(); using fud::FudStatus; if (fileResult == FudStatus::Failure) { spdlog::error("can't open {}\n", m_filename.c_str()); return err(ImageError::FileError); } auto* filePtr = inFile.file(); if (filePtr == nullptr) { return err(ImageError::FileError); } // stbi_load_from_file(filePtr, // return ImageResult::okay(image); return err(ImageError::FileError); } } // namespace bookmouse