Skip to content

TGA "CanReadFile" is too lax and should be improved #2927

@mwestphal

Description

@mwestphal

Describe the bug
vtkTGAReader has a "CanReadFile" method to determine if a stream is a potential TGA file, but any random file can a false positive

To Reproduce
Steps to reproduce the behavior:

  1. Download this file autzen.zip
  2. Open the file using cat autzen.pts | f3d - --no-config --no-render --verbose
  3. TGA reader is used, it should not even considered the file readable

Expected behavior
PTS reader being used, because TGA should reject the file

System Information:

  • OS: Any (but linux for piping)
  • GPU and GPU driver: Any

F3D Information
Paste the content of f3d --version or f3d-console.exe --version on Windows: master

Additional context
http://www.paulbourke.net/dataformats/tga/

A mentionned by @Meakk , it should be possible to check bitsperpixel. Should be 24 if we support RGB only, or at least a multiple of 8.

Fix must be in VTK.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions