t, err := template.ParseFiles("C:\path\to\www\index.html")
t, err := template.ParseFiles("/path/to/www/index.html")
import (
"fmt"
"log"
"os"
"path/filepath"
)
func main() {
dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
if err != nil {
log.Fatal(err)
}
fmt.Println(dir)
}
package main
import (
"bitbucket.org/kardianos/osext"
"fmt"
)
func main() {
filename, _ := osext.Executable()
fmt.Println(filename)
}
$img = imagine\Image::getImagine()->open(Yii::getAlias($fullName));
$size = $img->getSize();
$ratio = $size->getWidth()/$size->getHeight();
$width = 200;
$height = round($width/$ratio);
$box = new Box($width, $height);
$img->resize($box)->save($filePath.'/thumb/' . $fileName);
// OR:
imagine\Image::thumbnail($fullName,$width,$height)
->save($filePath.'/thumb/' . $fileName);