From 450b843126f9e9b687ce9895fb7df3d80ed82709 Mon Sep 17 00:00:00 2001 From: Andreas Sundquist Date: Fri, 6 Jun 2025 14:14:55 -0700 Subject: [PATCH] Remove requirement for SuperSplat comment in PLY "chunk" element in order to decode compressed PLY format. --- src/ply.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/ply.ts b/src/ply.ts index b29757a2..8cc8bf27 100644 --- a/src/ply.ts +++ b/src/ply.ts @@ -519,14 +519,12 @@ export class PlyReader { const elementCallback = (element: PlyElement) => { if (element.name === "chunk") { - if ( - this.comments.some((comment) => - comment.toLowerCase().includes("supersplat"), - ) - ) { - // SuperSplat compressed format detected - return initSuperSplat(element); - } + // "chunk" could conceivably be used for other formats, and we would + // ideally check for the comment: Generated by SuperSplat 2.* + // but gsplat also outputs this format without such a comment. + // In order to support both, let's assume a "chunk" element should + // be interpreted as this format. + return initSuperSplat(element); } if (isSuperSplat) { return decodeSuperSplat(element);