added workaround for strange tmpnam() output from VS2010. turned off optimization for DCT & DFT on Win64 for VS200x (VS2010 builds it fine)
This commit is contained in:
@@ -44,8 +44,8 @@
|
||||
namespace cv
|
||||
{
|
||||
|
||||
// On Win64 (IA64) optimized versions of DFT and DCT fail the tests
|
||||
#if defined WIN64 && !defined EM64T
|
||||
// On Win64 optimized versions of DFT and DCT fail the tests (fixed in VS2010)
|
||||
#if (defined WIN64 || defined _WIN64) && defined _MSC_VER && _MSC_VER < 1600
|
||||
#pragma optimize("", off)
|
||||
#endif
|
||||
|
||||
|
@@ -318,6 +318,8 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
|
||||
if( !decoder->setSource(buf) )
|
||||
{
|
||||
filename = tmpnam(fnamebuf);
|
||||
if(filename[0] == '\\')
|
||||
filename++;
|
||||
FILE* f = fopen( filename, "wb" );
|
||||
if( !f )
|
||||
return 0;
|
||||
@@ -425,6 +427,8 @@ bool imencode( const string& ext, const Mat& image,
|
||||
{
|
||||
char fnamebuf[L_tmpnam];
|
||||
const char* filename = tmpnam(fnamebuf);
|
||||
if(filename[0] == '\\')
|
||||
filename++;
|
||||
code = encoder->setDestination(filename);
|
||||
CV_Assert( code );
|
||||
code = encoder->write(image, params);
|
||||
|
Reference in New Issue
Block a user