<commit_before>package filters

import (
	"image"
	"image/png"
	"log"
	"os"
	"testing"

	"code.google.com/p/graphics-go/graphics/convolve"
)

func TestGaussianBlurKernel(t *testing.T) {
	file, err := os.Open("lenna.png")
	if err != nil {
		t.Fatalf("File doesn't exist")
	}
	defer file.Close()

	src, err := png.Decode(file)
	if err != nil {
		t.Fatalf("Can't decode")
	}

	dst := image.NewRGBA(src.Bounds())

	filter := NewGaussianBlurKernel(1.0, 2)
	log.Println(filter.Weights())

	if err := convolve.Convolve(dst, src, &filter); err != nil {
		t.Errorf("%s", err)
	}

	dstFile, err := os.OpenFile("lenna_gaussian_blur.png", os.O_CREATE|os.O_WRONLY, 0666)
	if err != nil {
		t.Fatalf("File can't be created")
	}
	defer dstFile.Close()

	if err := png.Encode(dstFile, dst); err != nil {
		t.Fatalf("Can't encode")
	}
}<commit_msg>Remove log<commit_after>package filters

import (
	"image"
	"image/png"
	"os"
	"testing"

	"code.google.com/p/graphics-go/graphics/convolve"
)

func TestGaussianBlurKernel(t *testing.T) {
	file, err := os.Open("lenna.png")
	if err != nil {
		t.Fatalf("File doesn't exist")
	}
	defer file.Close()

	src, err := png.Decode(file)
	if err != nil {
		t.Fatalf("Can't decode")
	}

	dst := image.NewRGBA(src.Bounds())

	filter := NewGaussianBlurKernel(1.0, 2)
	// log.Println(filter.Weights())

	if err := convolve.Convolve(dst, src, &filter); err != nil {
		t.Errorf("%s", err)
	}

	dstFile, err := os.OpenFile("lenna_gaussian_blur.png", os.O_CREATE|os.O_WRONLY, 0666)
	if err != nil {
		t.Fatalf("File can't be created")
	}
	defer dstFile.Close()

	if err := png.Encode(dstFile, dst); err != nil {
		t.Fatalf("Can't encode")
	}
}
{'fraction_non_alphanumeric': 0.18489425981873112, 'fraction_numerical': 0.008459214501510574, 'mean_word_length': 3.943283582089552, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5974297', 'n_tokens_mistral': 718, 'n_tokens_neox': 668, 'n_words': 136}