Commit Graph

20 Commits

Author SHA1 Message Date
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Ell 8e798e9cf2 app: avoid CRITICAL when writing 0-length data to XCF
In xcf_write_int8(), avoid calling g_output_stream_write_all() with
data == NULL and count == 0, in which case it raises a CRITICAL and
doesn't set bytes_written, which we proceed to use uninitialized.
This can happen, e.g., when writing an empty parasite.
2018-07-05 22:47:45 -04:00
Jehan 47a036f750 Bug 795814 - Error saving VERY large file.
g_alloca() is not very advisable, especially when it might be used to
allocate a big chunk of memory at once. It is better to allocate dynamic
memory with malloc(), or in particular with g_try_malloc() which won't
abort the program on failure.
This might be slightly slower (one of the advantages of memory on the
stack, though not even an absolute truth) but probably not by much, if
at all, and it's better to be safe anyway.
2018-05-05 20:13:27 +02:00
Michael Natterer 54ac0feb5a app: "bpc" is bytes not bits per pixel in the new XCF endian code 2017-09-16 22:34:44 +02:00
Michael Natterer a735ba0daa app: add code to read/write XCF tile data as big-endian
It was always supposed to be like that, but simply forgotten.
Fortunately, big-endian machines are almost extinct...

The new code is triggered with XCF version >= 12, but we will start
using that only after code review.
2017-09-16 19:03:20 +02:00
Michael Natterer 4ff911f84d app: add xcf_read_component() and xcf_write_component()
which dispatch to endian-aware xcf_read/write_int8/int16/int32/int64()
2017-09-16 17:58:30 +02:00
Michael Natterer 829bad4063 Bug 731390 - XCF files have a max size of 4G
Add support for 64 bit offsets to xcf_read_offset() and
xcf_write_offset(), but don't use the feature yet.
2017-03-23 13:16:13 +01:00
Michael Natterer 0c58dcd5cd Bug 731390 - XCF files have a max size of 4G
Change the xcf_write_foo() functions to take the XcfInfo* instead of
a GOutputStream*, and make them advance the info->cp offset by
themselves.
2017-03-23 12:42:38 +01:00
Michael Natterer a0a5f714bb Bug 731390 - XCF files have a max size of 4G
Step one, without changing anything in the saved XCFs yet:

Abstract reading and writing of file offsets away into their own
xcf_read_offset() and xcf_write_offset() functions, which take
"goffset" instead of "guint32". Also change xcf_seek_pos() to take a
goffset argument.

Change all file offset variables in xcf-load.c, xcf-write.c and struct
XcfInfo to goffset, and add new member "bytes_per_offset" to XcfInfo,
which is currently always 4.
2017-03-23 11:44:41 +01:00
Michael Natterer 5a4d865358 Bug 738329 - xcf_seek_pos() can cause unexpected OS behavior
Change XCF saving to never seek past the end of the partially written
file. The only places where we still did this was when skipping the
offset tables for layers, channels, levels and tiles.

Now we write an all-zero offset table first, and then only seek around
in areas of the file that already exist. This also simplifies the code
a bit. Changed comments to make it clear what happens.
2014-10-17 19:12:05 +02:00
Michael Natterer cd7322fd87 app: port XCF loading/saving to GIO
but for now restrict it to local files (see bug #709432).
Thanks to Jehan and Sven for testing.
2013-10-08 21:22:14 +02:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Sven Neumann 41237259c9 In all files, changed the standard copyright notice to say "GIMP - The GNU
2006-12-09  Sven Neumann  <sven@gimp.org>

        * In all files, changed the standard copyright notice to say
        "GIMP - The GNU Image Manipulation Program".
2006-12-09 21:33:38 +00:00
Sven Neumann b9ca864080 added const qualifiers.
2006-07-11  Sven Neumann  <sven@gimp.org>

	* app/xcf/xcf-write.[ch]: added const qualifiers.
2006-07-11 20:38:32 +00:00
Sven Neumann 049872b361 app/*.[ch] converted tabs to spaces.
2006-04-12  Sven Neumann  <sven@gimp.org>

	* app/*.[ch]
	* app/*/*.[ch]: converted tabs to spaces.
2006-04-12 12:49:29 +00:00
Michael Natterer 17bce42486 app/xcf/xcf-load.c app/xcf/xcf-read.c app/xcf/xcf-save.c
2003-09-10  Michael Natterer  <mitch@gimp.org>

	* app/xcf/xcf-load.c
	* app/xcf/xcf-read.c
	* app/xcf/xcf-save.c
	* app/xcf/xcf-seek.c
	* app/xcf/xcf-write.c
	* app/xcf/xcf.c: whitespace cleanup.
2003-09-10 10:40:57 +00:00
Sven Neumann 28fddfd554 Makefile.am removed this header file.
2003-03-25  Sven Neumann  <sven@gimp.org>

	* Makefile.am
	* gimpintl.h: removed this header file.

	* gimpmiscui.c: include libgimp-intl.h.

	* gimp.c (gimp_main): call setlocale() and bind to the libgimp
	textdomain so that plug-ins don't need to do that explicitely.

	* libgimp/stdplugins-intl.h: added the functionality that used to
	live in gimpintl.h and removed the libgimp related stuff. Got rid
	of the INIT_I18N_UI() macro.

	* plug-ins/*/*.c: removed all occurances of INIT_I18N_UI().
	Plug-ins simply call INIT_I18N() once in their run() function.

	* plug-ins/script-fu/script-fu-intl.h: added the functionality
	that used to live in gimpintl.h and removed the libgimp related
	stuff.

	* app/Makefile.am
	* app/gimp-intl.h: new file that defines the gettext macros for
	the GIMP core.

	* app/*/*.c: include gimp-intl.h instead of libgimp/gimpintl.h.

	* plug-ins/script-fu/scripts/test-sphere.scm: fixed typos.
2003-03-25 16:38:19 +00:00
Nathan Summers 8127ee74aa app/xcf/xcf-write.[ch] app/xcf/xcf-save.c ported the fix for bug #101340
2002-12-20  Nathan Summers  <rock@gimp.org>

        * app/xcf/xcf-write.[ch]
        * app/xcf/xcf-save.c
        * app/xcf/xcf.c: ported the fix for bug #101340 over from the stable
        branch.  Uses GError to report errors, unlike the stable version, which
        uses a pointer to gboolean.

        * app/xcf/xcf-seek.[ch]: check the return value of fseek and ftell for
        errors.  Return FALSE and set GError if an error is detected.

        * app/xcf/xcf-load.c: since the xcf-seek functions use GError now,
        added a NULL for the error parameter.  Added basic error checking
        on the return value of the xcf-seek functions.  In the future,
        changing xcf-load.c to use GError more completely should be
        considered.

        * POTFILES.in: mark the error messages added for translation
2002-12-20 06:26:34 +00:00
Hans Breuer 5469bc4bac updated
2001-07-22  Hans Breuer  <hans@breuer.org>

	* app/*/makefile.msc :
	* plug-ins/makefile.msc	:
	* libgimp/gimp.def :
	* libgimpwidgets/gimpwidgets.def : updated

	* makefile.msc :
	* app/xcf/makefile.msc :
	* regexrepl/makefile.msc : new files

	* app/base/base-config.c : a work-around for a gccism with
	structure initialization

	* app/core/gimp.c :
	* app/core/gimpimage-new.c :
	* app/gui/color-area.c
	* app/widgets/gimpdialogfactory.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* app/xcf/xcf-write.c
	* plug-ins/common/plasma.c :
	* plug-ins/flame/libifs.c : added <string.h> for strlen(), strcpy(),
	memcpy(), memcmp() and friends

	* plug-ins/imagemap/imap_rectangle.c :
	* plug-ins/ifscompose/ifscompose_storage.c : added <stdlib.h> for abs()

	* plug-ins/common/spheredesigner.c : reflect renaming of drawable.id
	drawable.drawable_id

	* plug-ins/script-fu/siod-wrapper.c : <string.h> and conditional use
	of script_fu_server_quit () cause there is not yet script-fu server
	on win32.
2001-07-22 22:18:01 +00:00
Michael Natterer 3e36b8f54b new directory app/xcf/
2001-07-03  Michael Natterer  <mitch@gimp.org>

	* configure.in: new directory app/xcf/

	* app/Makefile.am
	* app/global_edit.[ch]
	* app/xcf.[ch]: removed.

	* app/core/Makefile.am
	* app/core/gimpedit.[ch]: added here...

	* app/xcf/.cvsignore
	* app/xcf/Makefile.am
	* app/xcf/xcf-load.[ch]
	* app/xcf/xcf-private.h
	* app/xcf/xcf-read.[ch]
	* app/xcf/xcf-save.[ch]
	* app/xcf/xcf-seek.[ch]
	* app/xcf/xcf-write.[ch]
	* app/xcf/xcf.[ch]: ...and here (chopped up).

	* app/app_procs.c
	* app/disp_callbacks.c
	* app/floating_sel.c
	* app/gui/edit-commands.c
	* app/gui/toolbox.c
	* app/pdb/edit_cmds.c
	* app/widgets/gimpbufferview.c
	* tools/pdbgen/pdb/edit.pdb: changed accordingly.
2001-07-03 18:38:56 +00:00