[vtkusers] vtkJPEGWriter error:"please specify an input"

Logan Buesching finalfantasy010 at hotmail.com
Wed Apr 5 18:46:54 EDT 2006


I am pretty new to VTK, and I have been trying to read an OBJ file, and 
write it as a JPEG file.

I feel a little lost, but I have looked at this page: 
http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/IO/Testing/Tcl/TestImageWriters.tcl

By the looks of it, it appears that to do as I wish, it would consist of 
code like:

#include "vtkOBJReader.h"
#include "vtkJPEGWriter.h"

int main()
{
  vtkOBJReader *objr = vtkOBJReader::New();


  vtkJPEGWriter *writer=vtkJPEGWriter::New();

  objr->SetFileName("C:\\DPA-E232W4110S01-AD-1.obj");
  objr->Update();

  writer->SetInputConnection(objr->GetOutputPort());
  writer->SetFileName("C:\\DPA-E232W4110S01-AD-1.jpeg");

  writer->Write();
  return 0;
}

Whenever I do that, it says:

ERROR: In ...
vtkJPEGWritter (0023E858): Write:Please specify an input!

Can someone enlighten me about what is wrong with the code above?  I have 
also tried SetInput(objr->GetOutput()), but that does not seem to work 
either.

I debugged objr and it looks as though it is getting data from that file, so 
I dont believe that it is a file problem.

Is this a known problem?

Thanks in advance.





More information about the vtkusers mailing list