This project has moved. For the latest updates, please go here.

.Resize is not working, not sure why

Mar 26 at 4:24 AM
Edited Mar 26 at 6:26 AM
I want to save the master, then an 600x600, then a 600x600 with Watermark, then a thumbnail of the image object. Instead, they are all saved master size. Watermark works.
                //SAVE UNTOUCHED MASTER
                image.Write(Server.MapPath(MasterPath));

                //SAVE USEABLE DOWNLOAD WITHOUT WATERMARK
                MagickGeometry usize = new MagickGeometry(600, 600);        
               image.Resize(usize.X,usize.Y);
               image.Write(Server.MapPath(model.ImagePath));

                 //SAVE USEABLE DOWNLOAD WITH WATERMARK
                //WATERMARK
                new Drawables()
                  // Draw watermark on the image
                  .FontPointSize(72)
                  .Font("Candice")
                  .FillColor(new MagickColor("white"))
                   .FillOpacity(new Percentage(50))
                  .TextAlignment(TextAlignment.Center)
                  .Text(256, 240, "SurfJohn.com")
                  //PLACE WATERMARK
                  .Draw(image);

                image.Write(Server.MapPath(WaterMarkedPath));

                //FINALLY SAVE THUMBNAIL
                MagickGeometry size = new MagickGeometry(200, 200);
                image.Thumbnail(size.X, size.Y);

                image.Write(Server.MapPath(model.ThumbPath));
Coordinator
Mar 26 at 5:55 AM
If you want to create a thumbnail of the original image you should create a "Clone" before you resize it.
Mar 26 at 6:25 AM
Thank you. I will look into that. What I am doing is saving first the Master, then resizing it and saving, then adding watermark and saving, and then resizing into thumbnail size. I don't think that cloning it will matter because I am saving it after I've saved the bigger copies, no?

I did find why I couldn't resize the image in the 2 places: I was using image.Resize((size.X, size.Y) when I should have used the size object alone: .Resize(size).
Works like I want (for now haha).

Am I losing quality by resizing it 2 times? once for 600x600 and once for thumbnail? If so, then clone sounds like the way to go.

Thank you very much dlemstra.
Mar 26 at 6:29 AM
What is the best practice in your opinion?
Save 4 versions, Master, 600x600 to buy, 600x600 with watermark to view, and thumbnail for initial display.

or

Save just the master picture and then generate the 3 other versions on demand?
Coordinator
Mar 26 at 8:24 AM
The best practice depends on your situation/application. My first thought would be on demand with the Magick.NET module but that might not work in your situation. Might be easier to just always create those images.