[Mono-bugs] [Bug 677596] GIF transparance

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Mar 8 15:58:46 EST 2011


https://bugzilla.novell.com/show_bug.cgi?id=677596

https://bugzilla.novell.com/show_bug.cgi?id=677596#c2


--- Comment #2 from Christian Geldermann <stivy_moneyman at gmx.de> 2011-03-08 20:58:45 UTC ---
A small sample project is on
http://www.peoplez.bplaced.net/BugReproducer.tar.gz
Run the project in Debug (because the needed files are in that folder) and 
open http://localhost:8080/ in your local browser.
The white part of the picture is that what is wrong. It has to be 
transparent (/green).

If there is a problem with downloading here the small code:
using System;
using System.Net;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
using System.Threading;

namespace BugReproducer
{
    class MainClass
    {
        public static void Main (string[] args)
        {
            HttpListenerContext context = null;
            Bitmap bmp = new Bitmap("./pic.gif");
            HttpListener listener  = new HttpListener();
            listener.Prefixes.Add("http://*:8080/");
            listener.Start();
            while(true)
            {
                context = listener.GetContext();
                Stream output = context.Response.OutputStream;
                if(context.Request.RawUrl.Contains("/pic.gif"))
                {
                    bmp.Save(output, ImageFormat.Gif);
                    output.Close();
                }
                else
                {
                    byte[] buffer =
System.Text.Encoding.UTF8.GetBytes(LoadHtml());
                    output.Write(buffer, 0, buffer.Length);
                    output.Close();
                }
            }
        }

        private static string LoadHtml()
        {
            StreamReader reader = new StreamReader("./index.html");
            return reader.ReadToEnd();
        }
    }
}

And the Html-Code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test page</title>
<style type="text/css">
body{
background-color: #005D2F;
}
</style>
</head>
<body>
<img src="http://localhost:8080/pic.gif">
</body>
</html>

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list