274
274
// The #? is to identify file type, the programtype is optional
275
275
sprintf(buffer, "#?%s\n", programtype);
276
if(io->write_proc(buffer, 1, strlen(buffer), handle) < 1)
276
if(io->write_proc(buffer, 1, (unsigned int)strlen(buffer), handle) < 1)
277
277
return rgbe_Error(rgbe_write_error, NULL);
278
278
sprintf(buffer, "%s\n", info->comment);
279
if(io->write_proc(buffer, 1, strlen(buffer), handle) < 1)
279
if(io->write_proc(buffer, 1, (unsigned int)strlen(buffer), handle) < 1)
280
280
return rgbe_Error(rgbe_write_error, NULL);
281
281
sprintf(buffer, "FORMAT=32-bit_rle_rgbe\n");
282
if(io->write_proc(buffer, 1, strlen(buffer), handle) < 1)
282
if(io->write_proc(buffer, 1, (unsigned int)strlen(buffer), handle) < 1)
283
283
return rgbe_Error(rgbe_write_error, NULL);
284
284
if(info && (info->valid & RGBE_VALID_GAMMA)) {
285
285
sprintf(buffer, "GAMMA=%g\n", info->gamma);
286
if(io->write_proc(buffer, 1, strlen(buffer), handle) < 1)
286
if(io->write_proc(buffer, 1, (unsigned int)strlen(buffer), handle) < 1)
287
287
return rgbe_Error(rgbe_write_error, NULL);
289
289
if(info && (info->valid & RGBE_VALID_EXPOSURE)) {
290
290
sprintf(buffer,"EXPOSURE=%g\n", info->exposure);
291
if(io->write_proc(buffer, 1, strlen(buffer), handle) < 1)
291
if(io->write_proc(buffer, 1, (unsigned int)strlen(buffer), handle) < 1)
292
292
return rgbe_Error(rgbe_write_error, NULL);
294
294
sprintf(buffer, "\n-Y %d +X %d\n", height, width);
295
if(io->write_proc(buffer, 1, strlen(buffer), handle) < 1)
295
if(io->write_proc(buffer, 1, (unsigned int)strlen(buffer), handle) < 1)
296
296
return rgbe_Error(rgbe_write_error, NULL);