0

After reinstalling my computer with new windows, an problem occurs with an existing website routine that runs in my computer/IIS.

Using the library DynamicImage (https://github.com/tgjones/dynamic-image) my routines always worked but now saves the image as an black image.

When running from Visual Studio with IIS Express still works fine, no problem. After deploying to my IIS it generates an black image without raising an exception.

I tried to mimmic IIS Express in IIS so i configure the apppool to use my user but still saving an black image.

Looked at event viewer and no error message.

I simplified the code and made an simple form to test, still black image on IIS and ok on IIS Express

Any help, idea or what to verifiy is appreciate.

Code test:

using SoundInTheory.DynamicImage;
using SoundInTheory.DynamicImage.Filters;
using SoundInTheory.DynamicImage.Layers;

protected void Button1_Click(object sender, EventArgs e)
{
    ImageLayer layer = new ImageLayer { SourceFileName = "f:\\backdb\\a1.jpg" };
    Composition composition = new Composition();
    composition.ImageFormat = DynamicImageFormat.Bmp;
    layer.Filters.Add(new BorderFilter { Width =20, Fill = new Fill { BackgroundColor = SoundInTheory.DynamicImage.Colors.Green }});
    composition.Layers.Add(layer);
    GeneratedImage img = composition.GenerateImage();
    img.Save("f:\\backdb\\img.jpg"); // BLACK IMAGE ON IIS - Image OK on IIS EXPRESS
}
Trent
  • 1,595
  • 15
  • 37

1 Answers1

0

Fixed..

1st - I reinstalled IIS cleaning the directories.

2nd - The line "composition.ImageFormat = DynamicImageFormat.Bmp;" wasn't in the old instalation, was an try to fix probably mimetype, but was saying it as BMP and the filename as JPG, changed to DynamicImageFormat.Jpeg and now everything is ok.