dont load svg
This commit is contained in:
@@ -31,13 +31,13 @@ if (TOMATO_ASAN)
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||
if (NOT WIN32) # exclude mingw
|
||||
add_compile_options(-fno-omit-frame-pointer)
|
||||
add_compile_options(-fsanitize=address,undefined)
|
||||
add_compile_options(-fsanitize=address,undefined,nullability)
|
||||
#add_compile_options(-fsanitize=address,undefined,pointer-compare,pointer-subtract)
|
||||
#add_compile_options(-fhardened)
|
||||
#add_compile_options(-D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -ftrivial-auto-var-init=zero -fPIE -pie -Wl,-z,relro,-z,now -fstack-protector-strong -fstack-clash-protection -fcf-protection=full)
|
||||
|
||||
add_link_options(-fno-omit-frame-pointer)
|
||||
add_link_options(-fsanitize=address,undefined)
|
||||
add_link_options(-fsanitize=address,undefined,nullability)
|
||||
#add_link_options(-fsanitize=address,undefined,pointer-compare,pointer-subtract)
|
||||
#add_link_options(-fhardened)
|
||||
#add_link_options(-D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -ftrivial-auto-var-init=zero -fPIE -pie -Wl,-z,relro,-z,now -fstack-protector-strong -fstack-clash-protection -fcf-protection=full)
|
||||
@@ -99,34 +99,34 @@ set(TOMATO_GIT_COMMIT "UNK")
|
||||
|
||||
find_package(Git QUIET)
|
||||
if(NOT Git_FOUND)
|
||||
find_program(GIT_EXECUTABLE NAMES git git.exe)
|
||||
if(GIT_EXECUTABLE)
|
||||
set(Git_FOUND TRUE)
|
||||
message(STATUS "Found Git: ${GIT_EXECUTABLE}")
|
||||
endif()
|
||||
find_program(GIT_EXECUTABLE NAMES git git.exe)
|
||||
if(GIT_EXECUTABLE)
|
||||
set(Git_FOUND TRUE)
|
||||
message(STATUS "Found Git: ${GIT_EXECUTABLE}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(Git_FOUND)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_HEAD
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE RES
|
||||
)
|
||||
if (RES EQUAL 0)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE RES
|
||||
)
|
||||
if (RES EQUAL 0)
|
||||
set(TOMATO_GIT_COMMIT ${GIT_HEAD})
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-list --count HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-list --count HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_DEPTH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE RES
|
||||
)
|
||||
if (RES EQUAL 0)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE RES
|
||||
)
|
||||
if (RES EQUAL 0)
|
||||
set(TOMATO_GIT_DEPTH ${GIT_DEPTH})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message(STATUS "tomato version: ")
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
static std::optional<const char*> getExt(SDL_IOStream* ios) {
|
||||
// blacklist:
|
||||
// - svg
|
||||
// - tga
|
||||
// - tiff
|
||||
// - xcf
|
||||
@@ -33,8 +34,6 @@ static std::optional<const char*> getExt(SDL_IOStream* ios) {
|
||||
return "png";
|
||||
} else if (IMG_isPNM(ios)) {
|
||||
return "pnm";
|
||||
} else if (IMG_isSVG(ios)) {
|
||||
return "svg";
|
||||
} else if (IMG_isXPM(ios)) {
|
||||
return "xpm";
|
||||
} else if (IMG_isXV(ios)) {
|
||||
|
||||
@@ -50,11 +50,19 @@ void MediaMetaInfoLoader::handleMessage(const Message3Handle& m) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!o.all_of<ObjComp::F::TagLocalHaveAll>()) {
|
||||
// not ready yet
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: handle collections
|
||||
const auto file_size = o.get<ObjComp::F::SingleInfo>().file_size;
|
||||
|
||||
if (file_size > 50*1024*1024) {
|
||||
std::cerr << "MMIL error: image file too large\n";
|
||||
// not an error
|
||||
//std::cerr << "MMIL error: image file too large\n";
|
||||
// this is unlikely to change, so we tag as not image
|
||||
m.emplace<Message::Components::TagNotImage>();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -63,18 +71,12 @@ void MediaMetaInfoLoader::handleMessage(const Message3Handle& m) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!o.all_of<ObjComp::F::TagLocalHaveAll>()) {
|
||||
// not ready yet
|
||||
return;
|
||||
}
|
||||
|
||||
auto* file_backend = o.get<ObjComp::Ephemeral::BackendFile2>().ptr;
|
||||
if (file_backend == nullptr) {
|
||||
std::cerr << "MMIL error: object backend nullptr\n";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
auto file2 = file_backend->file2(o, StorageBackendIFile2::FILE2_READ);
|
||||
if (!file2 || !file2->isGood() || !file2->can_read) {
|
||||
std::cerr << "MMIL error: creating file2 from object via backendI\n";
|
||||
|
||||
Reference in New Issue
Block a user