Merge pull request #1212 from manongjohn/fix_svg_sequence_loading

Fix SVG sequence file loading
This commit is contained in:
manongjohn 2023-09-19 07:54:38 -04:00 committed by GitHub
commit 580fc67bdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 1 deletions

View file

@ -75,7 +75,7 @@ void initImageIo(bool lightVersion) {
TFileType::declare("pli", TFileType::VECTOR_LEVEL);
TLevelReader::define("svg", 0, TLevelReaderSvg::create);
TFileType::declare("svg", TFileType::VECTOR_LEVEL);
TFileType::declare("svg", TFileType::VECTOR_IMAGE);
TLevelWriter::define("svg", TLevelWriterSvg::create, false);
Tiio::defineWriterProperties("svg", new Tiio::SvgWriterProperties());

View file

@ -293,6 +293,10 @@ inline bool isMultipleFrameType(const TFilePath &fp) {
inline bool doesSupportRandomAccess(const TFilePath &fp,
bool isToonzOutput = false) {
const std::string &type = fp.getType();
if (type == "pli") return false;
return (fp.getDots() == "..");
}

View file

@ -25,6 +25,9 @@ namespace {
inline bool supportsRandomAccess(const TFilePath &fp) {
const std::string &type = fp.getType();
if (type == "pli") return false;
return type == "tlv" || // TLVs do support random access
fp.getDots() == ".."; // Multi-file levels of course do
}

View file

@ -1002,6 +1002,7 @@ static LevelType getLevelType(const TFilePath &fp) {
ret.m_ltype = OVL_XSHLEVEL;
break;
case TFileType::VECTOR_IMAGE:
case TFileType::VECTOR_LEVEL:
if (format == "svg") {
ret.m_vectorNotPli = true;