mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
Fixed calculation of scale factors, more debug messages
This commit is contained in:
parent
8bf7b33c1d
commit
87aa10dc28
@ -28,8 +28,8 @@ cImage *cImageMagickWrapper::CreateImage(int width, int height, bool preserveAsp
|
|||||||
cairo_t *cr;
|
cairo_t *cr;
|
||||||
cr = cairo_create(surface);
|
cr = cairo_create(surface);
|
||||||
|
|
||||||
double sx = width / w;
|
double sx = width / (double)w;
|
||||||
double sy = height / h;
|
double sy = height / (double)h;
|
||||||
if (preserveAspect) {
|
if (preserveAspect) {
|
||||||
if (sx < sy)
|
if (sx < sy)
|
||||||
sy = sx;
|
sy = sx;
|
||||||
@ -41,6 +41,10 @@ cImage *cImageMagickWrapper::CreateImage(int width, int height, bool preserveAsp
|
|||||||
cairo_set_source_surface(cr, image, 0, 0);
|
cairo_set_source_surface(cr, image, 0, 0);
|
||||||
cairo_paint(cr);
|
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);
|
unsigned char *data = cairo_image_surface_get_data(surface);
|
||||||
cImage *cimage = new cImage(cSize(width, height), (tColor*)data);
|
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 (image != NULL) cairo_surface_destroy(image);
|
||||||
|
|
||||||
|
if (config.debugImageLoading)
|
||||||
|
dsyslog("skindesigner: trying to load: %s", fullpath);
|
||||||
|
|
||||||
image = cairo_image_surface_create_from_png(fullpath);
|
image = cairo_image_surface_create_from_png(fullpath);
|
||||||
|
|
||||||
if (cairo_surface_status(image)) {
|
if (cairo_surface_status(image)) {
|
||||||
if (config.debugImageLoading)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user