Read tiff from memory(从内存流读取TIFF)

本文介绍如何使用libtiff库从内存缓冲区而非文件中读取TIFF格式的图像数据。文中提供了通过TIFFClientOpen函数实现这一操作的方法,并附有相关资源链接。

 

libtiff提供的TIFFOpen函数值能够从文件打开TIFF,如果想从内存流,或者数据库中的BLOB字段读取则不是很方便,或者我们会把流存为临时的TIFF文件再打开,那显然不很经济。关于如何从内存留读取TIFF格式图像数据,在libtiff的用户共享包里有个例子,参考:

http://www.libtiff.org/contrib.html

contrib/mfs
code from Mike Johnson to read+write images in memory without modifying the library

 

该问题的一些提问请参考如下两条回复:

1、http://www.asmail.be/msg0055488938.html

Thread

2004.04.14 20:01 "Read tiff from memory", by Ann Wang

2004.04.14 21:03 "Re: Read tiff from memory", by Andrey Kiselev

2004.04.14 21:06 "Re: Read tiff from memory", by Frank Warmerdam

2004.04.14 21:03 "Re: Read tiff from memory", by Andrey Kiselev

On Wed, Apr 14, 2004 at 03:01:22PM -0500, Ann Wang wrote:
> Hi, I am a newbie and want to know if there is a way to read tiff from
> memory buffer instead of from file. Looking at the documentation, I
> only see examples reading the tiff using TIFFOpen(tiff filename,
> mode). Is there a TIFFOpen function that will read from memory buffer
> instead?
You need TIFFClientOpen() function. And contrib/mfs directory even
contains the code for working with the memory buffer.
Regards,
Andrey
--
Andrey V. Kiselev
Home phone:  +7 812 5274898  ICQ# 26871517

 

2、http://www.asmail.be/msg0055488682.html

Thread

2004.04.14 20:01 "Read tiff from memory", by Ann Wang

2004.04.14 21:03 "Re: Read tiff from memory", by Andrey Kiselev

2004.04.14 21:06 "Re: Read tiff from memory", by Frank Warmerdam

2004.04.14 21:06 "Re: Read tiff from memory", by Frank Warmerdam

Ann Wang wrote:
> Hi, I am a newbie and want to know if there is a way to read tiff from
> memory buffer instead of from file. Looking at the documentation, I only
> see examples reading the tiff using TIFFOpen(tiff filename, mode). Is
> there a TIFFOpen function that will read from memory buffer instead?
Ann,
The TIFFClientOpen() function allows you to pass in functions to be used
for seeking, reading, writing and so forth.  This can be used to access
in memory datasets.  The contrib/mfs directory contains one example of an
"in memory" access implementation using this mechanism.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

3、另:IBM网站的资料

Graphics programming with libtiff, Part 2
http://www-128.ibm.com/developerworks/linux/librar...

转载于:https://www.cnblogs.com/flyingfish/archive/2007/04/15/713896.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值