I want to create thumbnails of different sizes from the same source image. I am able to create a single thumbnail with this code:
Code: Select all
g_Magickwand = NewMagickWand();
MagickReadImage( g_Magickwand, "test.jpg" )
MagickResizeImage( g_Magickwand, "150", "100", LanczosFilter, 1.0 );
MagickWriteImage( g_Magickwand, "test_tn1.jpg" );
g_Magickwand = DestroyMagickWand( g_Magickwand );
Now I want to create another thumbnail from test.jpg:
Code: Select all
...
MagickResizeImage( some_wand, "300", "200", LanczosFilter, 1.0 );
MagickWriteImage( some_wand, "test_tn2.jpg" );
...
I could create another wand and call MagickReadImage again, but since this is for a busy internet server, there is probably a more efficient way of doing it, without reading the disk again. How can I keep "test.jpg" in memory while creating several thumbs?