secureimage

package module
v0.0.0-...-37b2fc7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2020 License: MIT Imports: 10 Imported by: 0

README

secureimage

TR: Go web uygulamalarında upload edilen resim dosyalarının güvenilir olup, olmadığını kontrol eden küçük bir doğrulama paketidir. Bu paket sadece gif, jpeg ve png dosya formatlarını doğrular.

EN: This is a small verification package that checks whether image files uploaded in Go web applications are reliable. This package only supports gif, jpeg and png file formats.

Install

go get github.com/c1982/secureimage

Usage

package main

import (
	"fmt"
	"os"
	"github.com/c1982/secureimage"
)

func main() {
	trusted, err := secureimage.Check("./uploads/tmp_test.jpg")

	if err != nil {
		panic(err)
	}

	if trusted {
		fmt.Println("file is trusted.")
	} else {
		fmt.Println("bad file")
	}
}

Todos

  • Magic Bytes check
  • Validate image file format
  • Clean exif data in jpeg format

Credits

License

The MIT License (MIT) - see LICENSE.md for more details

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(imagefile string) (trusted bool, err error)

Check you can check trusted image file.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL