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 bcd98a45393d9f7273c4d8c589580ff457f3bc1a (commit)
from 8da4803c71d9fba0fb5a70c8cc5feccbaf4fdac0 (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/bcd98a45393d9f7273c4d8c589580ff457f3…
commit bcd98a45393d9f7273c4d8c589580ff457f3bc1a
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat Jun 2 00:29:05 2012 +0200
loaders: A few Meta Data fixes.
diff --git a/libs/loaders/GP_MetaData.c b/libs/loaders/GP_MetaData.c
index 1403e01..1a7ad93 100644
--- a/libs/loaders/GP_MetaData.c
+++ b/libs/loaders/GP_MetaData.c
@@ -159,6 +159,7 @@ static GP_MetaRecord *record_create(GP_MetaData *self, const char *id,
strcpy(rec->id, id);
rec->hash = hash;
+ rec->next = NULL;
if (self->root == NULL) {
self->root = rec;
@@ -166,7 +167,6 @@ static GP_MetaRecord *record_create(GP_MetaData *self, const char *id,
} else {
self->last->next = rec;
self->last = rec;
- rec->next = NULL;
}
self->rec_count++;
@@ -335,9 +335,9 @@ GP_MetaRecord *GP_MetaDataCreateString(GP_MetaData *self, const char *id,
char *s;
if (len == 0)
- size = strlen(str) + 1;
- else
- size = len + 1;
+ len = strlen(str);
+
+ size = len + 1;
/* Play safe with aligment */
if (size % 8)
@@ -345,8 +345,8 @@ GP_MetaRecord *GP_MetaDataCreateString(GP_MetaData *self, const char *id,
//TODO: allocation error
s = do_alloc(self, size);
- strncpy(s, str, size - 1);
- s[size - 1] = '0';
+ memcpy(s, str, len);
+ s[len] = '0';
str = s;
}
-----------------------------------------------------------------------
Summary of changes:
libs/loaders/GP_MetaData.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
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 cca1a95d0c61b096110045f796c86ab02703362f (commit)
from ed03e7bc0d0825a97e73887be30e768cc0f8aeec (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/cca1a95d0c61b096110045f796c86ab02703…
commit cca1a95d0c61b096110045f796c86ab02703362f
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon May 28 00:35:19 2012 +0200
loaders: PNG More work on metadata.
diff --git a/libs/loaders/GP_PNG.c b/libs/loaders/GP_PNG.c
index 2cef50d..7602fe7 100644
--- a/libs/loaders/GP_PNG.c
+++ b/libs/loaders/GP_PNG.c
@@ -270,6 +270,17 @@ static void load_meta_data(png_structp png, png_infop png_info, GP_MetaData *dat
GP_MetaDataCreateString(data, "res_unit", unit_name, 0);
}
+ png_timep mod_time;
+
+ if (png_get_tIME(png, png_info, &mod_time)) {
+ GP_MetaDataCreateInt(data, "mod_sec", mod_time->second);
+ GP_MetaDataCreateInt(data, "mod_min", mod_time->minute);
+ GP_MetaDataCreateInt(data, "mod_hour", mod_time->hour);
+ GP_MetaDataCreateInt(data, "mod_day", mod_time->day);
+ GP_MetaDataCreateInt(data, "mod_mon", mod_time->month);
+ GP_MetaDataCreateInt(data, "mod_year", mod_time->year);
+ }
+
double width, height;
if (png_get_sCAL(png, png_info, &unit, &width, &height)) {
@@ -277,6 +288,23 @@ static void load_meta_data(png_structp png, png_infop png_info, GP_MetaData *dat
GP_MetaDataCreateInt(data, "height", height * 1000);
GP_MetaDataCreateInt(data, "unit", unit);
}
+
+ png_textp text_ptr;
+ int text_cnt;
+
+ if (png_get_text(png, png_info, &text_ptr, &text_cnt)) {
+ int i;
+
+ for (i = 0; i < text_cnt; i++) {
+
+ if (text_ptr[i].compression != PNG_TEXT_COMPRESSION_NONE)
+ continue;
+
+ char buf[GP_META_RECORD_ID_MAX];
+ snprintf(buf, GP_META_RECORD_ID_MAX, "text:%s", text_ptr[i].key);
+ GP_MetaDataCreateString(data, buf, text_ptr[i].text, 1);
+ }
+ }
}
int GP_ReadPNGMetaData(FILE *f, GP_MetaData *data)
-----------------------------------------------------------------------
Summary of changes:
libs/loaders/GP_PNG.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
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 8aab7a816e45ba2fcfd256ab48bb36aa350c98f9 (commit)
from 965a9237db419f83183eb4a59fc9bc741782093e (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/8aab7a816e45ba2fcfd256ab48bb36aa350c…
commit 8aab7a816e45ba2fcfd256ab48bb36aa350c98f9
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun May 27 15:34:52 2012 +0200
spiv: Resize backend to fit image on pressing 1.
diff --git a/demos/spiv/spiv.c b/demos/spiv/spiv.c
index 91b9f35..9862049 100644
--- a/demos/spiv/spiv.c
+++ b/demos/spiv/spiv.c
@@ -171,9 +171,10 @@ int load_image(struct loader_params *params)
* This function tries to resize spiv window
* and if succedes blits the image directly to the screen.
*/
-static int resize_backend_and_blit(GP_Context *img,
- struct loader_params *params)
+static int resize_backend_and_blit(struct loader_params *params)
{
+ GP_Context *img = params->img;
+
if (GP_BackendResize(backend, img->w, img->h))
return 1;
@@ -236,6 +237,7 @@ static void *image_loader(void *ptr)
if (rat < 1) {
cpu_timer_start(&timer, "Blur");
callback.priv = "Blurring Image";
+ //TODO: We can't blur saved image!
if (GP_FilterGaussianBlur(img, img, 0.4/rat, 0.4/rat,
&callback) == NULL)
return NULL;
@@ -587,6 +589,9 @@ int main(int argc, char *argv[])
params.show_progress_once = 1;
show_image(¶ms, argv[argn]);
break;
+ case GP_KEY_1:
+ resize_backend_and_blit(¶ms);
+ break;
}
break;
case GP_EV_SYS:
-----------------------------------------------------------------------
Summary of changes:
demos/spiv/spiv.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")