X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Fmod_png%2Ftrgt_png.cpp;h=bc38548939dd8862c301f896113450fd4f739e7f;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=1b84eee43afba97021cd5c5c7d2edc2b8cae2198;hpb=5ddcf36f04cfbd10fabda4e3c5633cb27cdd4c0a;p=synfig.git diff --git a/synfig-core/trunk/src/modules/mod_png/trgt_png.cpp b/synfig-core/trunk/src/modules/mod_png/trgt_png.cpp index 1b84eee..bc38548 100644 --- a/synfig-core/trunk/src/modules/mod_png/trgt_png.cpp +++ b/synfig-core/trunk/src/modules/mod_png/trgt_png.cpp @@ -1,9 +1,12 @@ -/*! ======================================================================== -** Synfig -** png_trgt Target Module -** $Id: trgt_png.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $ +/* === S Y N F I G ========================================================= */ +/*! \file trgt_png.cpp +** \brief png_trgt Target Module ** +** $Id$ +** +** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -14,6 +17,7 @@ ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** General Public License for more details. +** \endlegal ** ** === N O T E S =========================================================== ** @@ -52,7 +56,7 @@ SYNFIG_TARGET_INIT(png_trgt); SYNFIG_TARGET_SET_NAME(png_trgt,"png"); SYNFIG_TARGET_SET_EXT(png_trgt,"png"); SYNFIG_TARGET_SET_VERSION(png_trgt,"0.1"); -SYNFIG_TARGET_SET_CVS_ID(png_trgt,"$Id: trgt_png.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $"); +SYNFIG_TARGET_SET_CVS_ID(png_trgt,"$Id$"); /* === M E T H O D S ======================================================= */ @@ -136,18 +140,15 @@ png_trgt::start_frame(synfig::ProgressCallback *callback) } else if(multi_image) { - String - newfilename(filename), - ext(find(filename.begin(),filename.end(),'.'),filename.end()); - newfilename.erase(find(newfilename.begin(),newfilename.end(),'.'),newfilename.end()); - - newfilename+=etl::strprintf("%04d",imagecount)+ext; - file=fopen(newfilename.c_str(),"wb"); + String newfilename(filename_sans_extension(filename) + + etl::strprintf(".%04d",imagecount) + + filename_extension(filename)); + 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); } @@ -197,13 +198,22 @@ png_trgt::start_frame(synfig::ProgressCallback *callback) // Write the physical size png_set_pHYs(png_ptr,info_ptr,round_to_int(desc.get_x_res()),round_to_int(desc.get_y_res()),PNG_RESOLUTION_METER); + char title [] = "Title"; + char description[] = "Description"; + char software [] = "Software"; + char synfig [] = "SYNFIG"; +// char copyright [] = "Copyright"; +// char voria [] = "(c) 2004 Voria Studios, LLC"; + // Output any text info along with the file png_text comments[]= { - { PNG_TEXT_COMPRESSION_NONE, "Title", const_cast(get_canvas()->get_name().c_str()) }, - { PNG_TEXT_COMPRESSION_NONE, "Description", const_cast(get_canvas()->get_description().c_str()) }, -// { PNG_TEXT_COMPRESSION_NONE, "Copyright", "(c) 2004 Voria Studios, LLC" }, - { PNG_TEXT_COMPRESSION_NONE, "Software", "SYNFIG" }, + { PNG_TEXT_COMPRESSION_NONE, title, const_cast(get_canvas()->get_name().c_str()), + strlen(get_canvas()->get_name().c_str()) }, + { PNG_TEXT_COMPRESSION_NONE, description, const_cast(get_canvas()->get_description().c_str()), + strlen(get_canvas()->get_description().c_str()) }, +// { PNG_TEXT_COMPRESSION_NONE, copyright, voria, strlen(voria) }, + { PNG_TEXT_COMPRESSION_NONE, software, synfig, strlen(synfig) }, }; png_set_text(png_ptr,info_ptr,comments,sizeof(comments)/sizeof(png_text)); @@ -214,7 +224,7 @@ png_trgt::start_frame(synfig::ProgressCallback *callback) } Color * -png_trgt::start_scanline(int scanline) +png_trgt::start_scanline(int /*scanline*/) { return color_buffer; }