#define ETL_STRPRINTF_MAX_LENGTH (800)
#endif
+#ifdef WIN32
+#define POPEN_BINARY_WRITE_TYPE "wb"
+#else
+#define POPEN_BINARY_WRITE_TYPE "w"
+#endif
+
/* === T Y P E D E F S ===================================================== */
_ETL_BEGIN_CDECLS
String newfilename(filename_sans_extension(filename) +
etl::strprintf("%04d",imagecount) +
filename_extension(filename));
- file=fopen(newfilename.c_str(),"wb");
+ file=fopen(newfilename.c_str(),POPEN_BINARY_WRITE_TYPE);
if(callback)callback->task(newfilename+_(" (animated)"));
}
else
{
- file=fopen(filename.c_str(),"wb");
+ file=fopen(filename.c_str(),POPEN_BINARY_WRITE_TYPE);
if(callback)callback->task(filename);
}
command=strprintf("encodedv - > \"%s\"\n",filename.c_str());
// Open the pipe to encodedv
- file=popen(command.c_str(),"wb");
+ file=popen(command.c_str(),POPEN_BINARY_WRITE_TYPE);
if(!file)
{
command=strprintf("ffmpeg -f image2pipe -vcodec ppm -an -r %f -i pipe: -loop -hq -title \"%s\" -vcodec mpeg1video -y \"%s\"\n",desc.get_frame_rate(),get_canvas()->get_name().c_str(),filename.c_str());
- file=popen(command.c_str(),"wb");
+ file=popen(command.c_str(),POPEN_BINARY_WRITE_TYPE);
// etl::yield();
gif::gif(const char *filename_):
filename(filename_),
- file( (filename=="-")?stdout:fopen(filename_,"wb") ),
+ file( (filename=="-")?stdout:fopen(filename_,POPEN_BINARY_WRITE_TYPE) ),
imagecount(0),
lossy(true),
else
command=strprintf("convert -depth 8 -size %dx%d rgb:-[0] -density %dx%d \"%s\"\n",desc.get_w(),desc.get_h(),round_to_int(desc.get_x_res()/39.3700787402),round_to_int(desc.get_y_res()/39.3700787402),filename.c_str());
- file=popen(command.c_str(),"wb");
+ file=popen(command.c_str(),POPEN_BINARY_WRITE_TYPE);
if(!file)
{
String newfilename(filename_sans_extension(filename) +
etl::strprintf("%04d",imagecount) +
filename_extension(filename));
- file=fopen(newfilename.c_str(),"wb");
+ file=fopen(newfilename.c_str(),POPEN_BINARY_WRITE_TYPE);
if(callback)callback->task(newfilename);
}
else
{
- file=fopen(filename.c_str(),"wb");
+ file=fopen(filename.c_str(),POPEN_BINARY_WRITE_TYPE);
if(callback)callback->task(filename);
}
struct tm* gmt = gmtime(&t);
w=desc.get_w(); h=desc.get_h();
//synfig::error("mng_trgt: init %d %d",w,h);
- file = fopen(filename.c_str(), "wb");
+ file = fopen(filename.c_str(), POPEN_BINARY_WRITE_TYPE);
if( file == NULL ) goto cleanup_on_error;
mng = mng_initialize((mng_ptr)file, mng_alloc_proc, mng_free_proc, MNG_NULL);
if(mng == MNG_NULL) goto cleanup_on_error;
String newfilename(filename_sans_extension(filename) +
etl::strprintf("%04d",imagecount) +
filename_extension(filename));
- file=fopen(newfilename.c_str(),"wb");
+ file=fopen(newfilename.c_str(),POPEN_BINARY_WRITE_TYPE);
if(callback)callback->task(newfilename);
}
else
{
- file=fopen(filename.c_str(),"wb");
+ file=fopen(filename.c_str(),POPEN_BINARY_WRITE_TYPE);
if(callback)callback->task(filename);
}
String newfilename(filename_sans_extension(filename) +
etl::strprintf("%04d",imagecount) +
filename_extension(filename));
- file=SmartFILE(fopen(newfilename.c_str(),"wb"));
+ file=SmartFILE(fopen(newfilename.c_str(),POPEN_BINARY_WRITE_TYPE));
if(callback)callback->task(newfilename);
}
else
{
- file=SmartFILE(fopen(filename.c_str(),"wb"));
+ file=SmartFILE(fopen(filename.c_str(),POPEN_BINARY_WRITE_TYPE));
if(callback)callback->task(filename);
}
yuv::yuv(const char *FILENAME):
filename(FILENAME),
- file( (filename=="-")?stdout:fopen(filename.c_str(),"wb") ),
+ file( (filename=="-")?stdout:fopen(filename.c_str(),POPEN_BINARY_WRITE_TYPE) ),
dithering(true)
{
// YUV420P doesn't have an alpha channel