[Insight-users] [Insight-developers] Visual Studio and std::streampos

Julien Michel julien.michel at c-s.fr
Fri Jan 22 03:42:36 EST 2010


Bradley Lowekamp a écrit :
> Hello Julien,
>
> What version of VS are you using? What file format are you trying to use?
>
> Just to double check how did you check the size of std::streamoff? 
> Most systems seems to have a 64-bit number for this value, even bcc does. 
>
> If it really is the case that std::streamoff is only 32-bits, there 
> are other problems the just the return value of 
> ImageIO::GetImageSizeInBytes. Essentially it means that your C++ std 
> iostreams can not deal with files greater the 2GB. As the 
> std::streamoff values are needed to seek around and search files for 
> random access. IO of large files just will not work in C++. It's a 
> show stopper.
>
> The other possibility is that streamoff is actually larger and that 
> you are only getting a negative value does due to an internal overflow 
> of a 32-bit integer. This could be solve.
>
> Brad
>
> On Jan 21, 2010, at 2:29 PM, Luis Ibanez wrote:
>
>> Hi Julien,
>>
>> Thanks for letting me know about your tests.
>>
>> Just for the history of this code, the use of std::streampos
>> is something that we adopted in 2007 in response to a
>> suggestion from the group at CNES:
>> http://www.itk.org/mailman/private/insight-developers/2007-September/009576.html
>>
>> since the previous type was restricting the size of images
>> we could manage with ITK.
>>
>> I see the point that it would be desirable to be
>> able to get the real size of the image, even when
>> working on a 32-bits system.
>>
>> I'm not sure what could be a good way of implementing
>> this in a portable and safe way.
>>
>>
>>      Any suggestions ?
Luis, Bradley,

After searching for a while, I finally had to rely on the online 
documentation for my visual studion (8.0 2005):
http://msdn.microsoft.com/en-us/library/484tzsxy%28VS.80%29.aspx
http://msdn.microsoft.com/en-us/library/484tzsxy.aspx

Luis, I did not remember that we suggested this type in september 2007 
... And it has done well until we were provided with recent radar images 
(which are really huge).

I understand Bradley point, if the type is really only 2 bytes, I reckon 
that lots of stuff should not work either ... but the documentation 
seems to suppor the 2 bytes hypothesis.

Julien
-- 
<www.c-s.fr> 	*Julien MICHEL*
Ingénieur d'études - Traitement d'images

*CS Systèmes d'Information - Division Espace & Renseignement*
Département Information Géographique & Image
Parc de la Grande Plaine - 5, Rue Brindejonc des Moulinais - BP 15872
31506 Toulouse Cedex 05 - FRANCE
Tel : +33 561 17 64 27 / Fax : +33 561 34 84 15
Email : julien.michel at c-s.fr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100122/fadc1c34/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo_cs.png
Type: image/png
Size: 19066 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100122/fadc1c34/attachment-0001.png>


More information about the Insight-users mailing list