Commit Graph

20 Commits

Author SHA1 Message Date
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 01be120349 Bug 731390 - XCF files have a max size of 4G
Change the xcf_read_foo() functions to take the XcfInfo* instead of
a GInputStream*, and make them advance the info->cp offset by
themselves. Makes xcf-load.c a lot more readable.
2017-03-23 12:26:09 +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 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
Martin Nordholts 130885e903 app/xcf: Simplify MAX_XCF_STRING_LEN
Simplify MAX_XCF_STRING_LEN and align sentences in warning message.
2010-10-17 21:25:46 +02:00
Mukund Sivaraman 4855d433b0 Validate XCF string length
This patch limits the string length to 16 MB. If problems occur in the
future because 16 MB is small, increase the limit by modifying
MAX_XCF_STRING_LEN.
2010-10-16 04:13:27 +05:30
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 4512af8de1 return the number of bytes that have been read from the file.
2007-07-05  Sven Neumann  <sven@gimp.org>

	* app/xcf/xcf-read.c (xcf_read_int32) (xcf_read_int8): return the
	number of bytes that have been read from the file.

	* app/xcf/xcf-load.c (xcf_load_prop): return FALSE when reading fails.

svn path=/trunk/; revision=22873
2007-07-05 15:12:43 +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 ce1352cf7f use a signed variable when attempting to skip over unknown properties and
2006-07-10  Sven Neumann  <sven@gimp.org>

	* app/xcf/xcf-load.c: use a signed variable when attempting to
	skip over unknown properties and check for EOF.  Fixes bug #345802.

	* app/xcf/xcf-read.c: cleanup, nothing really changed
2006-07-10 16:40:26 +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
Sven Neumann bd427b2e4d libgimpbase/Makefile.am libgimpbase/gimpbase.h libgimpbase/gimpbase.def
2004-07-27  Sven Neumann  <sven@gimp.org>

	* libgimpbase/Makefile.am
	* libgimpbase/gimpbase.h
	* libgimpbase/gimpbase.def
	* libgimpbase/gimpmemsize.[ch]: added new files with memsize
	related functions (moved here from gimputil.c) and
	GIMP_TYPE_MEMSIZE (moved here from app/config/gimpconfig-types.[ch]).

	* libgimpbase/gimputils.[ch]: removed gimp_memsize_to_string() here.

	* libgimpbase/gimpunit.[ch]: added GIMP_TYPE_UNIT (moved here from
	app/config/gimpconfig-types.[ch]).

	* libgimpbase/gimpbase-private.c
	* libgimp/gimptile.c
	* libgimp/gimpunitcache.c
	* plug-ins/help/domain.c
	* app/xcf/xcf-read.c: need to include glib-object.h.

	* plug-ins/common/uniteditor.c: use GIMP_TYPE_UNIT.

	* app/config/gimpconfig-types.[ch]: removed code that lives in
	libgimpbase now.

	* app/config/gimpconfig-deserialize.c: changed accordingly.

	* app/config/gimpbaseconfig.c
	* app/config/gimpdisplayconfig.c
	* app/core/gimpcontext.c
	* app/gui/grid-dialog.c
	* app/tools/gimpcolortool.c
	* app/widgets/gimpaction.c
	* app/widgets/gimpunitstore.c: no need to include gimpconfig-types.h
	any longer.
2004-07-27 16:39:00 +00:00
Michael Natterer e18793056f new function which takes any string and returns UTF-8 (it returns
2003-10-16  Michael Natterer  <mitch@gimp.org>

	* libgimpbase/gimputils.[ch]: new function which takes any string
	and returns UTF-8 (it returns "(invalid UTF-8 string)" if all
	conversion attempts fail).

	* app/core/gimpbrush.c
	* app/core/gimpgradient.c
	* app/core/gimppalette.c
	* app/core/gimppattern.c
	* app/xcf/xcf-read.c: use it. Fixes bug #79897.
2003-10-16 12:24:58 +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
Michael Natterer 98849323f3 UTF-8 validate all strings and try g_locale_to_utf8() as fallback if it
2002-05-30  Michael Natterer  <mitch@gimp.org>

	* app/xcf/xcf-read.c (xcf_read_string): UTF-8 validate all strings
	and try g_locale_to_utf8() as fallback if it fails.

2002-05-30  Michael Natterer  <mitch@gimp.org>

	* POTFILES.in: added app/xcf/xcf-read.c
2002-05-30 14:37:35 +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