|
- package main
-
- import (
- "biukop.com/sfm/loan"
- log "github.com/sirupsen/logrus"
- "path/filepath"
- "testing"
- )
-
- func TestGetConvertUploadsToImage(t *testing.T) {
- for id := 30; id <= 44; id++ {
- ul := loan.Uploads{}
- e := ul.Read(int64(id))
- if e != nil {
- log.Error(e)
- return
- }
-
- e = convertUploadsToPDF(ul)
- if e != nil {
- log.Error(e)
- return
- }
-
- e = convertUploadsToJpg(ul)
- if e != nil {
- log.Error(e)
- return
- }
-
- e = convertUploadsToThumb(ul)
- if e != nil {
- log.Error(e)
- return
- }
- }
-
- }
-
- func TestConvertImageToThumbnail(t *testing.T) {
- _, name := filepath.Split("/home/sp/uploads/abc.uploads")
- test := fileNameWithoutExtTrimSuffix(name) + ".jpg"
- log.Println(test)
- test1 := filepath.Ext("abc.uploads.pdf")
- log.Println(test1)
- ext := "."
- log.Println(ext[1:])
- }
|