By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,778 Members | 1,957 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,778 IT Pros & Developers. It's quick & easy.

problem with opening tiff file

P: n/a
Hi,

I'm using same code for opening a TIFF file in VC++ works just fine but
under linux it says unable to open the tiff file!
Any comment on this?
if (argc < 2)
{
cout << "Not enough parameter" << endl;
cout << "Usage: rst Tiff-Filename" << endl;
cout << endl;

return -1;
}

TIFF* pTifFile = TIFFOpen( argv[1], "r");
if (!pTifFile)
cout << "Unable to open " << argv[1] << " file." << endl;
else
{
cout << argv[1] << " opened sucessfully ..." << endl;

int dirCount = 0;

do
{
dirCount++;

} while(TIFFReadDirectory(pTifFile));

cout << argv[1] << "has " << dirCount << "directories insde" <<
endl;

TIFFClose(pTifFile);
}

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Wed, 06 Apr 2005 13:53:03 -0700, ramsin.savra wrote:
Hi,

I'm using same code for opening a TIFF file in VC++ works just fine but
under linux it says unable to open the tiff file!
Any comment on this?
if (argc < 2)
{
cout << "Not enough parameter" << endl;
cout << "Usage: rst Tiff-Filename" << endl;
cout << endl;

return -1;
}

TIFF* pTifFile = TIFFOpen( argv[1], "r");
if (!pTifFile)
cout << "Unable to open " << argv[1] << " file." << endl;
else
{


Based on your description and the code provided, I would guess that
TIFFOpen is returning 0.

Without seeing more code (e.g. the implementation of TIFFOpen),
it's impossible to say any more.

(Keep in mind that Linux is case-sensitive for filenames.)

- Jay

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.