Files
photoview/api/test_utils/env.go
Googol Lee a378522af4 Use magick generating thumbnails.
Fix #1204

* Add bad medias to scanner_test.

* Fix the script.

* Add GenerateThumbnail function.

* Add identify dimension

* Use new API. Cover json condition.

* Use magick to generate thumbnails.

* Update go mod.

* Remove dependency of executable_worker -> test_utils

* Reduce dependency of magick.

* Use magick to get dimension.

* Remove almost all code around `image` package.

* Fix thumbnailing with multi-frame gif.

* Remove the struct in wrapper.

* Fix typo.

* Build images.

* Update logs

* Add jpeg decoder.

* Remove code dependency.

* Add log to confirm scan in parallel.

* Update log

* Add reformat image perf tests.

* Rollback the build workflow.
2025-05-22 09:01:43 +02:00

19 lines
386 B
Go

package test_utils
import (
"path/filepath"
"runtime"
)
// PathFromAPIRoot returns the real path in the API project root.
func PathFromAPIRoot(rootRelatedPath string) string {
_, file, _, ok := runtime.Caller(0)
if !ok {
panic("Can't get the path of current function. It should not happen.")
}
base := filepath.Dir(file)
return filepath.Join(base, "..", rootRelatedPath)
}