| 1020 | |
| 1021 | |
| 1022 | int LuaCallOuts::ReadImageData(lua_State* L) { |
| 1023 | size_t inLen; |
| 1024 | const char* inData = luaL_checklstring(L, 1, &inLen); |
| 1025 | const bool infoOnly = lua_isboolean(L, 2) && lua_tobool(L, 2); |
| 1026 | |
| 1027 | std::istringstream iss(std::string(inData, inLen)); |
| 1028 | PNGImageFile image(&iss); |
| 1029 | |
| 1030 | if (infoOnly) { |
| 1031 | return PushImageInfo(L, image); |
| 1032 | } |
| 1033 | return PushImageData(L, image); |
| 1034 | } |
| 1035 | |
| 1036 | |
| 1037 | int LuaCallOuts::ReadImageFile(lua_State* L) { |
nothing calls this directly
no test coverage detected