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.
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.
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.
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
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