But if I use Magick++ to resize it, after resizing it, it's still a gif imgage file indeed, but it become static.
It seems only the first frame has been decoded . Is there something wrong with my code?
Code: Select all
Magick::Blob blob(in_clone, insize); //'in_clone' is original image file data
Magick::Image img;
img.read(blob);
Magick::Geometry gm(smallWidth, smallHeight);
*orgHeight = img.rows();
*orgWidth = img.columns();
if ( img.rows() > smallHeight || img.columns() > smallWidth ) {
img.scale(gm);
img.modifyImage();
}
img.write(&blob, "GIF");
*outsize = blob.length();
*out = malloc(*outsize);
memcpy(*out, blob.data(), blob.length()); // 'out' is new image file data after resizing