I know it's no imagemagick error, because if I write the scaled version into a new file it looks ok. But maybe somebody knows what the scaling function does - because I have no idea why it doesn't work after the scaling.
My code:
Code: Select all
Magick::Image image;
image.read(Magick::Geometry(info->new_size, info->new_size), info->file_info.absoluteFilePath().toStdString());
image.scale(Magick::Geometry(info->new_size, info->new_size));
Magick::Blob blob;
image.magick("RGBA");
image.write(&blob);
image.write("c:/testtest.jpg");
glBindTexture(GL_TEXTURE_2D, info->texture_id);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8 , image.columns(), image.rows(), 0, GL_BGRA, GL_UNSIGNED_BYTE, blob.data());