[Hdrflow-svn] SF.net SVN: hdrflow: [271] trunk/lib/openlibraries/src
Status: Pre-Alpha
Brought to you by:
glslang
From: <gl...@us...> - 2007-08-26 11:13:20
|
Revision: 271 http://hdrflow.svn.sourceforge.net/hdrflow/?rev=271&view=rev Author: glslang Date: 2007-08-25 14:14:22 -0700 (Sat, 25 Aug 2007) Log Message: ----------- + stream getline bug fixes and hdr plugin update to account for an unknown header setting Modified Paths: -------------- trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_plugin.cpp trunk/lib/openlibraries/src/openpluginlib/pl/stream.cpp Modified: trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_plugin.cpp =================================================================== --- trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_plugin.cpp 2007-08-25 15:15:53 UTC (rev 270) +++ trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_plugin.cpp 2007-08-25 21:14:22 UTC (rev 271) @@ -30,7 +30,7 @@ struct RgbeInfo { int valid; - char program_type[ 16 ]; + char program_type[ 8 ]; float gamma; float exposure; char format[ 16 ]; @@ -155,7 +155,7 @@ return false; info.valid = RGBE_VALID_PROGRAMTYPE; - for( size_t i = 0; i < sizeof( info.program_type ) - 1; ++i ) + for( size_t i = 0; i < sizeof( info.program_type ); ++i ) { if( buffer[ i + 2 ] == 0 || isspace( buffer[ i + 2 ] ) ) break; @@ -168,7 +168,9 @@ for( ;; ) { - if( !strcmp( buffer, "FORMAT=32-bit_rle_rgbe\n" ) ) + int dummy; + + if( !strcmp( buffer, "FORMAT=32-bit_rle_rgbe" ) ) { #if _MSC_VER >= 1400 strncpy_s( info.format, "32-bit_rle_rgbe", strlen( "32-bit_rle_rgbe" ) ); @@ -192,6 +194,13 @@ { info.valid |= RGBE_VALID_EXPOSURE; } +#if _MSC_VER >= 1400 + else if( sscanf_s( buffer, "pvalue -s %d -h -df -r -y %d +x %d", &dummy, &dummy, &dummy ) == 3 ) +#else + else if( sscanf( buffer, "pvalue -s %d -h -df -r -y %d +x %d", &dummy, &dummy, &dummy ) == 3 ) +#endif + { + } stream->getline( buffer, 128 ); if( !strlen( buffer ) ) Modified: trunk/lib/openlibraries/src/openpluginlib/pl/stream.cpp =================================================================== --- trunk/lib/openlibraries/src/openpluginlib/pl/stream.cpp 2007-08-25 15:15:53 UTC (rev 270) +++ trunk/lib/openlibraries/src/openpluginlib/pl/stream.cpp 2007-08-25 21:14:22 UTC (rev 271) @@ -79,14 +79,14 @@ { bytes = actual_bytes( bytes ); - std::size_t i = 0; - for( ; *( data_ + i ) != '\n' && i < bytes; ++i ) - *data++ = *( data_ + i ); + std::size_t i = offset_, j = 0; + for( ; *( data_ + i ) != '\n' && i < offset_ + bytes; ++i, ++j ) + *data++ = *( data_ + i ); if( *( data_ + i ) == '\n' ) - ++i; + *data++ = '\0', ++j; - offset_ += i; + offset_ += j; return bytes; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |