mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 19:29:15 +00:00
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.
19 lines
386 B
Go
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)
|
|
}
|