[vtkusers] Reading standard image types

Sean McBride sean at rogue-research.com
Sat Oct 16 13:41:44 EDT 2010


On Sat, 16 Oct 2010 13:09:33 -0400, David Doria said:

>Is there a filter that will read png, jpg, etc images based on their
>file extension (that is, without having to explicitly declare a
>vtkJPEGReader or vtkPNGReader, etc)? If not, would you use it if it
>existed?

I don't know if there is one, but it would certainly be handy.  However,
I'd caution against relying solely on the filename (extension) to
determine the format.  Extensions can be wrong (accidentally or
maliciously); better to introspect the file's data also, for a magic
number of other marker.

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtkusers mailing list