mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Panoramas: Increase projection type string limit to 32 characters #1508
This commit is contained in:
@@ -289,7 +289,11 @@ func TestFile_Panorama(t *testing.T) {
|
||||
assert.False(t, file.Panorama())
|
||||
})
|
||||
t.Run("equirectangular", func(t *testing.T) {
|
||||
file := &File{Photo: nil, FileType: "jpg", FileSidecar: false, FileWidth: 1500, FileHeight: 1000, FileProjection: ProjectionEquirectangular}
|
||||
file := &File{Photo: nil, FileType: "jpg", FileSidecar: false, FileWidth: 1500, FileHeight: 1000, FileProjection: ProjEquirectangular}
|
||||
assert.True(t, file.Panorama())
|
||||
})
|
||||
t.Run("transverse-cylindrical", func(t *testing.T) {
|
||||
file := &File{Photo: nil, FileType: "jpg", FileSidecar: false, FileWidth: 1500, FileHeight: 1000, FileProjection: ProjTransverseCylindrical}
|
||||
assert.True(t, file.Panorama())
|
||||
})
|
||||
t.Run("sidecar", func(t *testing.T) {
|
||||
@@ -298,6 +302,39 @@ func TestFile_Panorama(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestFile_SetProjection(t *testing.T) {
|
||||
t.Run(ProjDefault, func(t *testing.T) {
|
||||
m := &File{}
|
||||
m.SetProjection(ProjDefault)
|
||||
assert.Equal(t, ProjDefault, m.FileProjection)
|
||||
})
|
||||
t.Run(ProjCubestrip, func(t *testing.T) {
|
||||
m := &File{}
|
||||
m.SetProjection(ProjCubestrip)
|
||||
assert.Equal(t, ProjCubestrip, m.FileProjection)
|
||||
})
|
||||
t.Run(ProjCylindrical, func(t *testing.T) {
|
||||
m := &File{}
|
||||
m.SetProjection(ProjCylindrical)
|
||||
assert.Equal(t, ProjCylindrical, m.FileProjection)
|
||||
})
|
||||
t.Run(ProjTransverseCylindrical, func(t *testing.T) {
|
||||
m := &File{}
|
||||
m.SetProjection(ProjTransverseCylindrical)
|
||||
assert.Equal(t, ProjTransverseCylindrical, m.FileProjection)
|
||||
})
|
||||
t.Run(ProjPseudocylindricalCompromise, func(t *testing.T) {
|
||||
m := &File{}
|
||||
m.SetProjection(ProjPseudocylindricalCompromise)
|
||||
assert.Equal(t, ProjPseudocylindricalCompromise, m.FileProjection)
|
||||
})
|
||||
t.Run("Sanitize", func(t *testing.T) {
|
||||
m := &File{}
|
||||
m.SetProjection(" 幸福 Hanzi are logograms developed for the writing of Chinese! ")
|
||||
assert.Equal(t, "hanzi are logograms developed for the writing of chinese", m.FileProjection)
|
||||
})
|
||||
}
|
||||
|
||||
func TestFile_Delete(t *testing.T) {
|
||||
t.Run("permanently", func(t *testing.T) {
|
||||
file := &File{FileType: "jpg", FileSize: 500, FileName: "ToBePermanentlyDeleted", FileRoot: "", PhotoID: 5678}
|
||||
|
||||
Reference in New Issue
Block a user