X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Freaders%2Fimage.c;h=a9f96e8363bee3be3a14144eab1d9d7292e5f93e;hp=3650568f95b0fa50fc6116c9d7ded8c150e49670;hb=6f78b0ef3998e959ce09c5ef11d46149756b682b;hpb=93ca43858bf1db047717e47388917d1a29562419 diff --git a/lib/readers/image.c b/lib/readers/image.c index 3650568..a9f96e8 100644 --- a/lib/readers/image.c +++ b/lib/readers/image.c @@ -81,13 +81,13 @@ void image_doc_destroy(gfxdocument_t*gfx) { image_doc_internal_t*i= (image_doc_internal_t*)gfx->internal; - free(i->img.data);i->image.data = 0; + free(i->img.data);i->img.data = 0; free(gfx->internal);gfx->internal=0; free(gfx);gfx=0; } -void image_doc_set_parameter(gfxdocument_t*gfx, const char*name, const char*value) +void image_doc_setparameter(gfxdocument_t*gfx, const char*name, const char*value) { image_doc_internal_t*i= (image_doc_internal_t*)gfx->internal; } @@ -113,7 +113,7 @@ gfxpage_t* image_doc_getpage(gfxdocument_t*doc, int page) return image_page; } -static void image_set_parameter(gfxsource_t*src, const char*name, const char*value) +static void image_setparameter(gfxsource_t*src, const char*name, const char*value) { msg(" (gfxsource_image) setting parameter %s to \"%s\"", name, value); } @@ -126,10 +126,10 @@ static gfxdocument_t*image_open(gfxsource_t*src, const char*filename) memset(i, 0, sizeof(image_doc_internal_t)); gfxcolor_t*data = 0; - int width = 0; - int height = 0; + unsigned width = 0; + unsigned height = 0; - if(!getPNG(filename, &width, &height, (unsigned char**)&data)) { + if(!png_load(filename, &width, &height, (unsigned char**)&data)) { if(!jpeg_load(filename, (unsigned char**)&data, &width, &height)) { msg(" Couldn't load image %s", filename); return 0; @@ -143,7 +143,7 @@ static gfxdocument_t*image_open(gfxsource_t*src, const char*filename) image_doc->internal = i; image_doc->get = 0; image_doc->destroy = image_doc_destroy; - image_doc->set_parameter = image_doc_set_parameter; + image_doc->setparameter = image_doc_setparameter; image_doc->getpage = image_doc_getpage; return image_doc; @@ -153,7 +153,8 @@ gfxsource_t*gfxsource_image_create() { gfxsource_t*src = (gfxsource_t*)malloc(sizeof(gfxsource_t)); memset(src, 0, sizeof(gfxsource_t)); - src->set_parameter = image_set_parameter; + src->setparameter = image_setparameter; src->open = image_open; return src; } +