Skip to content

File error reporting#3103

Open
Prospect138 wants to merge 12 commits into
f3d-app:masterfrom
Prospect138:feature/file_error_reporting
Open

File error reporting#3103
Prospect138 wants to merge 12 commits into
f3d-app:masterfrom
Prospect138:feature/file_error_reporting

Conversation

@Prospect138

@Prospect138 Prospect138 commented May 3, 2026

Copy link
Copy Markdown
Contributor

Describe your changes

Add distinguish between a file of unsupported extension and a file of unsupported content on f3d load.
WIP

Issue ticket number and link if any

#3000

Checklist for finalizing the PR

  • I have performed a self-review of my code
  • I have added tests for new features and bugfixes
  • I have added documentation for new features
  • If it is a modifying the libf3d API, I have updated bindings
  • If it is a modifying the .github/workflows/versions.json, I have updated docker_timestamp

AI Disclosure

  • I did not use AI to generate any of the content of that pull request
  • I used AI to generate code in that pull request, if yes please disclose which part of the code was generated and with which model.
  • ...

Continuous integration

Please write a comment to run CI, eg: \ci fast.
See here for more info.

@mwestphal mwestphal self-requested a review May 3, 2026 12:44

@mwestphal mwestphal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to request a review whenever needed, top right :)

Comment thread application/F3DOptionsTools.h
@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown

You are modifying libf3d public API! ⚠️Please update bindings accordingly⚠️!
You can find them in their respective directories: c, python, java, webassembly.

@mwestphal

Copy link
Copy Markdown
Member

@Prospect138 need help moving forward ?

@Prospect138 Prospect138 force-pushed the feature/file_error_reporting branch from b4e350c to acc5d29 Compare May 28, 2026 19:59
@Prospect138 Prospect138 marked this pull request as ready for review May 28, 2026 20:31
@Prospect138 Prospect138 requested a review from a team as a code owner May 28, 2026 20:31
Comment thread library/public/reader_types.h Outdated
Comment thread library/public/reader_types.h Outdated
Comment thread library/public/reader_types.h Outdated
Comment thread library/public/scene.h Outdated
Comment thread doc/libf3d/03-OPTIONS.md Outdated

@mwestphal mwestphal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at first glance lookss good, lets settle on the API first. @Meakk @snoyer please take a look at the public changes

@mwestphal mwestphal requested review from Meakk and snoyer May 29, 2026 06:03
@Meakk

Meakk commented May 29, 2026

Copy link
Copy Markdown
Member

Looks ok to me. I agree with your suggestion of moving the enum to the scene scope.

Comment thread library/plugin/reader.h Outdated

@mwestphal mwestphal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on quick look, one change needed

@mwestphal mwestphal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

starting to look good, let me know when you need a proper review by requesting a review top right.

@Prospect138 Prospect138 requested a review from mwestphal June 5, 2026 09:51

@mwestphal mwestphal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes needed

Comment thread library/public/scene.h
virtual scene& removeAllLights() = 0;

/**
* Return true if provided file in path uses a supported extension, exists and its content

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update the documentation

Comment thread library/plugin/reader.h Outdated
#include <vtkImporter.h>
#include <vtkSmartPointer.h>


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment thread library/src/reader.cxx Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be in the header, no need for a cxx here.

Comment thread library/plugin/reader.h Outdated
* @warning This file is used internally by the plugin SDK, it is not intended to be included
* directly by libf3d users.
*/
enum class file_availability;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not include scene.h ?

Comment on lines +282 to +284
" is not a file of a supported 3D scene file format, use force reader to force a "
"specific "
"reader");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
" is not a file of a supported 3D scene file format, use force reader to force a "
"specific "
"reader");
" does not have an extension corresponding to a supported file format, use force reader to force a specific reader");

Comment thread library/src/scene_impl.cxx Outdated

const f3d::reader* reader = f3d::factory::instance()->getReader(buffer, size, forceReader);
const f3d::reader* reader =
f3d::factory::instance()->getReader(buffer, size, forceReader, skipContentCheck);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f3d::factory::instance()->getReader(buffer, size, forceReader, skipContentCheck);
f3d::factory::instance()->getReader(buffer, size, forceReader, this->Internals->Options.scene.skip_content_check);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but how can this ever work ? How is the reader selected when there is no extension and no content check ?

Comment thread webassembly/F3DEmscriptenBindings.cxx Outdated
.function(
"supports",
+[](f3d::scene& scene, const std::string& path) -> bool { return scene.supports(path); })
+[](f3d::scene& scene, const std::string& path) -> bool { return scene.supports(std::filesystem(path)) == f3d::file_availability::SUPPORTED; })

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would std::filesystem be needed ?

Comment thread doc/libf3d/03-OPTIONS.md

### `scene.skip_content_check` (_bool_, default: `false`)

Make attempt to read file without checking it's header.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Make attempt to read file without checking it's header.
Select reader to read file without checking its header content but only based on the file extension.

Comment thread doc/user/03-OPTIONS.md

### `--skip-content-check` (_bool_, default: `false`)

Make attempt to read file without checking it's header.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Make attempt to read file without checking it's header.
Select reader to read file without checking its header content, but only based on the file extension.

Comment thread library/src/reader.cxx Outdated
}
return false;
}
} // namespace f3d No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eol

@mwestphal

Copy link
Copy Markdown
Member

@snoyer fyi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add distinction between unsupported extension / unsupported content

3 participants