Return-Path: <tiff-bounces@lists.maptools.org>
Received: from mailgate001.isp.belgacom.be (mailgate001.isp.belgacom.be [195.238.6.100])
        by inmx016.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-2.32) with ESMTP id l4H97XNa016643
        for <joris.at.lebbeke@skynet.be>; Thu, 17 May 2007 11:07:35 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 17 May 2007 11:06:28 +0200
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l4H8rP7L007386;
	Thu, 17 May 2007 04:54:21 -0400
Received: from mail183.messagelabs.com (mail183.messagelabs.com
	[62.231.131.67])
	by duke.maptools.org (8.12.11/8.12.10) with SMTP id l4H8rMs4007383
	for <tiff@lists.maptools.org>; Thu, 17 May 2007 04:53:23 -0400
X-VirusChecked: Checked
X-Env-Sender: a.allen@campden.co.uk
X-Msg-Ref: server-9.tower-183.messagelabs.com!1179392001!1737719!1
X-StarScan-Version: 5.5.10.7.1; banners=campden.co.uk,-,-
X-Originating-IP: [212.125.75.76]
Received: (qmail 18471 invoked from network); 17 May 2007 08:53:21 -0000
Received: from smtp-7.star.net.uk (HELO smtp-7.star.net.uk) (212.125.75.76)
	by server-9.tower-183.messagelabs.com with SMTP;
	17 May 2007 08:53:21 -0000
Received: (qmail 28045 invoked from network); 17 May 2007 08:53:20 -0000
Received: from unknown (HELO ntmailsweeper.campden.co.uk) (212.125.64.198)
	by smtp-7.star.net.uk with SMTP; 17 May 2007 08:53:20 -0000
Received: from server00.campden.co.uk (unverified) by
	ntmailsweeper.campden.co.uk
	(Content Technologies SMTPRS 4.1.5) with ESMTP id
	<T020102966a7fa5df7f0d@ntmailsweeper.campden.co.uk> for
	<tiff@lists.maptools.org>; Thu, 17 May 2007 09:55:34 +0100
Received: by server00 with Internet Mail Service (5.5.2657.72)
	id <KXVPNHP3>; Thu, 17 May 2007 09:53:05 +0100
Message-ID: <81DAC74B9CDFD711962F000802BF127F0831D39C@server00>
From: a.allen@campden.co.uk
To: tiff@lists.maptools.org
Date: Thu, 17 May 2007 09:53:05 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2657.72)
Content-Type: text/plain;
	charset="iso-8859-1"
Subject: [Tiff] Using LibTIFF from C#
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.00002398
X-MSP-STORE: Thu, 17 May 2007 11:07:41 +0200
Status:   

Hi,

I am trying to load a tif file (LaB 16 bit, but 8bit LaB and 8bit RGB don't
work either) from within C#.

I can load the file using TIFFOpen:
IntPtr tiffFile;
tiffFile = TIFF.TIFFOpen(new StringBuilder("C:\\test8rgb.tif"), new
StringBuilder("r"));

That seems to work, but then calling the TIFFRead... functions closes the
program without any warning.

int scanLineSize = TIFF.TIFFScanlineSize(tiffFile);
byte[] tempTest = new byte[stripSize];

TIFF.TIFFReadScanline(tiffFile, ref tempTest, 1, 1);

The only thing I can think, is that the function is trying to access memory
outside of its bounds, and .NET doesn't like it doing that and exits,
although I am not at all certain that is what is happening.

Hopefully I am just missing something fairly simple.

Thanks for any help anyone can give me.

Alex


_____________________________________________________________________
The information in this document and attachments is given after the exercise of all reasonable care and skill in its compilation, preparation and issue, but is provided without liability in its application or use.  It may contain privileged information that is exempt from disclosure by law and may be confidential.  If you are not the intended recipient you must not copy, distribute or take any action in reliance on it.  If you have received this document in error please notify us and delete this message from your system immediately.

The CCFRA Group includes Campden & Chorleywood Food Research Association (Reg. No. 510618), CCFRA Group Services Ltd. (3841905) and CCFRA Technology Ltd. (3836922) all registered in England with the registered office at Chipping Campden, Gloucestershire, GL55 6LD.

The Group reserves the right to monitor e-mail communications passing through its network.  Any advice given is subject to our normal terms and conditions of trading, a copy of which is available on request.

________________________________________________________________________
This e-mail has been scanned for all viruses by MessageLabs.
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
