--- src/libxinevdec/image.c.orig 2006-05-25 19:33:05.000000000 +0300 +++ src/libxinevdec/image.c 2006-06-12 15:56:20.000000000 +0300 @@ -82,7 +82,7 @@ this->index += buf->size; if (buf->decoder_flags & BUF_FLAG_FRAME_END) { - int width, height, i; + int width, height, i, scale; MagickBooleanType status; MagickWand *wand; uint8_t *img_buf, *img_buf_ptr; @@ -104,6 +104,21 @@ width = MagickGetImageWidth(wand) & ~1; /* must be even for init_yuv_planes */ height = MagickGetImageHeight(wand); + + scale = 0; + if(width > 720) { + height = height * 720 / width; + width = 720; + scale = 1; + } + if(height > 576) { + width = (width * 576 / height) & ~1; + height = 576; + scale = 1; + } + if(scale) + MagickResizeImage(wand, width, height, LanczosFilter, 1.0); + img_buf = malloc(width * height * 3); MagickGetImagePixels(wand, 0, 0, width, height, "RGB", CharPixel, img_buf); DestroyMagickWand(wand);