gegl r2225 - in trunk: . gegl/buffer
- From: ok svn gnome org
- To: svn-commits-list gnome org
- Subject: gegl r2225 - in trunk: . gegl/buffer
- Date: Wed, 23 Apr 2008 23:17:25 +0100 (BST)
Author: ok
Date: Wed Apr 23 22:17:25 2008
New Revision: 2225
URL: http://svn.gnome.org/viewvc/gegl?rev=2225&view=rev
Log:
* gegl/buffer/gegl-buffer-index.h: removed padding from tile struct,
since the loader is fault tolerant and only loads the available of
expected data from disk.
* gegl/buffer/gegl-buffer-load.c: (read_block): log block size
discrepancies.
Modified:
trunk/ChangeLog
trunk/gegl/buffer/gegl-buffer-index.h
trunk/gegl/buffer/gegl-buffer-load.c
Modified: trunk/gegl/buffer/gegl-buffer-index.h
==============================================================================
--- trunk/gegl/buffer/gegl-buffer-index.h (original)
+++ trunk/gegl/buffer/gegl-buffer-index.h Wed Apr 23 22:17:25 2008
@@ -86,7 +86,6 @@
gint32 y;
gint32 z; /* mipmap subdivision level of tile (0=100%) */
- guint32 padding[7];
} GeglBufferTile;
/* A convenience union to allow quick and simple casting */
@@ -127,8 +126,7 @@
}
#define GEGL_BUFFER_STRUCT_CHECK_PADDING \
{struct_check_padding (GeglBufferBlock, 16);\
- struct_check_padding (GeglBufferHeader, 256);\
- struct_check_padding (GeglBufferTile, 64);}
+ struct_check_padding (GeglBufferHeader, 256);}
#define GEGL_BUFFER_SANITY {static gboolean done=FALSE;if(!done){GEGL_BUFFER_STRUCT_CHECK_PADDING;done=TRUE;}}
#endif
Modified: trunk/gegl/buffer/gegl-buffer-load.c
==============================================================================
--- trunk/gegl/buffer/gegl-buffer-load.c (original)
+++ trunk/gegl/buffer/gegl-buffer-load.c Wed Apr 23 22:17:25 2008
@@ -151,7 +151,6 @@
if(!g_seekable_seek (G_SEEKABLE (i), *offset, G_SEEK_SET, NULL, NULL))
g_warning ("failed seeking to %i", (gint)*offset);
- g_print ("offset: %i\n", (gint)*offset);
read += g_input_stream_read (i, &block, sizeof (GeglBufferBlock), NULL, NULL);
GEGL_NOTE (BUFFER_LOAD, "read block: length:%i next:%i",
block.length, (guint)block.next);
@@ -167,6 +166,12 @@
break;
}
+ if (block.length != own_size)
+ {
+ GEGL_NOTE(BUFFER_LOAD, "read block of size %i which is different from expected %i only using available expected",
+ block.length, own_size);
+ }
+
if (block.length == own_size ||
block.length > own_size )
{
@@ -178,6 +183,7 @@
read += g_input_stream_read (i, ((gchar*)ret) + sizeof(GeglBufferBlock),
own_size - sizeof(GeglBufferBlock),
NULL, NULL);
+ ret->block.length = own_size;
}
else if (block.length < own_size)
{
@@ -186,6 +192,7 @@
read += g_input_stream_read (i, ((gchar*)ret) + sizeof(GeglBufferBlock),
block.length - sizeof (GeglBufferBlock),
NULL, NULL);
+ ret->block.length = own_size;
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]