diff options
author | Manuel Reimer <manuel.reimer@gmx.de> | 2014-10-28 22:15:22 +0100 |
---|---|---|
committer | Manuel Reimer <manuel.reimer@gmx.de> | 2014-10-28 22:15:22 +0100 |
commit | 87aa10dc281627a06b588af79b1b32aa6b1ce8fb (patch) | |
tree | c190633b50274418f38fd3ae537868460dab987f /libcore/imagemagickwrapper.c | |
parent | 8bf7b33c1dd3e131af1826e64a1bc51d1b0ac29e (diff) | |
download | vdr-plugin-skindesigner-87aa10dc281627a06b588af79b1b32aa6b1ce8fb.tar.gz vdr-plugin-skindesigner-87aa10dc281627a06b588af79b1b32aa6b1ce8fb.tar.bz2 |
Fixed calculation of scale factors, more debug messages
Diffstat (limited to 'libcore/imagemagickwrapper.c')
-rw-r--r-- | libcore/imagemagickwrapper.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libcore/imagemagickwrapper.c b/libcore/imagemagickwrapper.c index 9823fab..79e48e7 100644 --- a/libcore/imagemagickwrapper.c +++ b/libcore/imagemagickwrapper.c @@ -28,8 +28,8 @@ cImage *cImageMagickWrapper::CreateImage(int width, int height, bool preserveAsp cairo_t *cr; cr = cairo_create(surface); - double sx = width / w; - double sy = height / h; + double sx = width / (double)w; + double sy = height / (double)h; if (preserveAspect) { if (sx < sy) sy = sx; @@ -41,6 +41,10 @@ cImage *cImageMagickWrapper::CreateImage(int width, int height, bool preserveAsp cairo_set_source_surface(cr, image, 0, 0); cairo_paint(cr); + cairo_status_t status = cairo_status (cr); + if (status) + dsyslog("skindesigner: Cairo CreateImage Error %s", cairo_status_to_string(status)); + unsigned char *data = cairo_image_surface_get_data(surface); cImage *cimage = new cImage(cSize(width, height), (tColor*)data); @@ -57,11 +61,15 @@ bool cImageMagickWrapper::LoadImage(const char *fullpath) { if (image != NULL) cairo_surface_destroy(image); + if (config.debugImageLoading) + dsyslog("skindesigner: trying to load: %s", fullpath); + image = cairo_image_surface_create_from_png(fullpath); if (cairo_surface_status(image)) { if (config.debugImageLoading) - dsyslog("skindesigner: Cairo Error: %s", cairo_status_to_string(cairo_surface_status(image))); + dsyslog("skindesigner: Cairo LoadImage Error: %s", cairo_status_to_string(cairo_surface_status(image))); + image = NULL; return false; } |