This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 7044b9ef7967a50a1f0b437ad5a0554325484296 (commit) via 004c0cb918280c3a03cd9f1b3b1e5d27476defcb (commit) via 11ff1196e509567cea23f3bf71653f75c23ac1e8 (commit) from e0193a071feaf04b54c65348bf11db0d8db6c4ac (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/7044b9ef7967a50a1f0b437ad5a0554325484...
commit 7044b9ef7967a50a1f0b437ad5a0554325484296 Author: Cyril Hrubis metan@ucw.cz Date: Sat Jun 14 01:13:06 2014 +0200
loaders: ZIP: Seek to the end of the Zlib IO.
We need to Seek to the end of the Zlib I/O because:
* Files that are not images are not read at all
* There may be bytes that are not consumed by the loader (known to happen)
and we have to get to the next ZIP header.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/loaders/GP_ZIP.c b/libs/loaders/GP_ZIP.c index 440aabbf..55d1cdaa 100644 --- a/libs/loaders/GP_ZIP.c +++ b/libs/loaders/GP_ZIP.c @@ -324,6 +324,7 @@ static GP_Context *zip_next_file(struct zip_priv *priv, GP_IOClose(io); goto out; */ + io = GP_IOZlib(priv->io, header.comp_size); if (!io) goto out; @@ -333,6 +334,15 @@ static GP_Context *zip_next_file(struct zip_priv *priv, if (errno == ECANCELED) err = errno;
+ /* + * We need to finish the Zlib IO for any of: + * + * - File is not image -> need to get to the end of the record + * - All image data were not consumed by loader (may happen) + */ + if (GP_IOSeek(io, 0, GP_IO_SEEK_END) == (off_t)-1) + GP_DEBUG(1, "Failed to seek Zlib IO"); + GP_IOClose(io);
if (header.flags & FLAG_DATA_DESC_HEADER) {
http://repo.or.cz/w/gfxprim.git/commit/004c0cb918280c3a03cd9f1b3b1e5d27476de...
commit 004c0cb918280c3a03cd9f1b3b1e5d27476defcb Author: Cyril Hrubis metan@ucw.cz Date: Sat Jun 14 01:12:30 2014 +0200
loaders; IOZlib: Add Seek to end with offset=0
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/loaders/GP_IOZlib.c b/libs/loaders/GP_IOZlib.c index f62c831e..21675d60 100644 --- a/libs/loaders/GP_IOZlib.c +++ b/libs/loaders/GP_IOZlib.c @@ -146,6 +146,20 @@ static int zlib_reset(struct priv *priv) return 0; }
+static off_t zlib_seek_end(GP_IO *io) +{ + struct priv *priv = GP_IO_PRIV(io); + char buf[BUFS]; + int ret; + + while ((ret = zlib_read(io, buf, sizeof(buf))) > 0); + + if (ret < 0) + return (off_t)-1; + + return priv->bytes_read; +} + static off_t zlib_seek(GP_IO *io, off_t offset, enum GP_IOWhence whence) { struct priv *priv = GP_IO_PRIV(io); @@ -175,6 +189,10 @@ static off_t zlib_seek(GP_IO *io, off_t offset, enum GP_IOWhence whence)
return 0; } + + if (whence == GP_IO_SEEK_END && offset == 0) + return zlib_seek_end(io); + out: errno = ENOSYS; return (off_t)-1;
http://repo.or.cz/w/gfxprim.git/commit/11ff1196e509567cea23f3bf71653f75c23ac...
commit 11ff1196e509567cea23f3bf71653f75c23ac1e8 Author: Cyril Hrubis metan@ucw.cz Date: Sat Jun 14 00:07:18 2014 +0200
doc: Updates for python core and loaders.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/doc/core_python.txt b/doc/core_python.txt index 6e488244..487b903c 100644 --- a/doc/core_python.txt +++ b/doc/core_python.txt @@ -3,12 +3,12 @@ Python Core module
The python binding maps mostly to the C API with the 'GP_' prefix stripped.
-Structures like 'GP_Context' are not created by the 'GP_ContextAlloc()' +However structures as 'GP_Context' are not created by the 'GP_ContextAlloc()' function but have proper constructor and destructor to keep the Python reference counting happy.
-There there are more complicated problems like 'GP_ProgressCallback' which -needs a proxy function to call the python callback from the C code. +Then there are a bit more tricky solutions, such as 'GP_ProgressCallback' +which needs a proxy function to call the python callback from the C code.
Context ~~~~~~~ @@ -29,7 +29,13 @@ Creates a context of a particular size and pixel type. First two parameters are 'width' and 'height' third is pixel type which is an enumeration
-May raise 'OSError' with 'ENOMEM' errno if allocation has failed. +|=============================================================================== +| May raise 'OSError' with errno set to 'ENOMEM' if allocation has failed. + +| May raise 'OSError' with errno set to 'EINVAL' for invalid pixel type and/or + zero width or height. + +|===============================================================================
[source,python] ------------------------------------------------------------------------------- @@ -88,18 +94,18 @@ import gfxprim.core as core
Copy a rectangle from self to target.
-The blits can do simple conversions same as the 'Convert' functions however -such blits are slower. +The blits can do naive conversions (same as 'Convert') however such blits are +a bit slower.
Blit is clipped.
-TIP: See link:example_py_showimage.html[example] Blit usage. +TIP: See link:example_py_showimage.html[example Blit usage].
[[Colors_and_Pixels]] Colors and Pixels ~~~~~~~~~~~~~~~~~
-Pixel in gfxprim is a number large enough to store a pixel value. Pixel is +Pixel in GFXprim is a number large enough to store a pixel value. Pixel is passed as a parameter to all drawing functions.
Color is a more abstract representation for example RGB triplet. @@ -139,9 +145,12 @@ The PixelTypes array stores all supported pixel types Progress Callback ~~~~~~~~~~~~~~~~~
-Progress callback is a last parameter of link:loaders_python.html[loaders] and -link:filters_python.html[filters]. It can be either a python function or a -touple with a function at the first position. +Progress callback is the last parameter of link:loaders_python.html[loaders] +and link:filters_python.html[filters]. It can be either a python function or a +touple with a function at first position. In the latter case the second touple +element is passed to the callback function as a second parameter. First +parameter of the callback is a floating point number with the current progress +in percents.
Progress callback must return an integer number. Returning non-zero will abort the operation and the function, called with the callback as a parameter, will @@ -164,8 +173,5 @@ import gfxprim.core as core Sets and gets the GFXprim debug level. See link:debug.html[debug messages] description for more details.
- - - These are basic 'Context' methods from core module. Importing other modules will add some other (for example gfx module adds all drawing functions). diff --git a/doc/loaders_python.txt b/doc/loaders_python.txt index a73d1f0e..5f230841 100644 --- a/doc/loaders_python.txt +++ b/doc/loaders_python.txt @@ -31,7 +31,7 @@ Loads an image from a file.
First one is general purpose loader function that automatically detects the file format. The format is detected from file extension first and if this -fails files signature is used. +fails link:signatures.html[file signature] is used.
|=============================================================================== | May raise 'OSError' with errno set to 'EPERM', 'EISDIR', 'ENOENT' or any other
-----------------------------------------------------------------------
Summary of changes: doc/core_python.txt | 34 ++++++++++++++++++++-------------- doc/loaders_python.txt | 2 +- libs/loaders/GP_IOZlib.c | 18 ++++++++++++++++++ libs/loaders/GP_ZIP.c | 10 ++++++++++ 4 files changed, 49 insertions(+), 15 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.