diff --git a/lib/data/atlas/atlas_save_test.v b/lib/data/atlas/atlas_save_test.v index 40cb5da3..09344d5e 100644 --- a/lib/data/atlas/atlas_save_test.v +++ b/lib/data/atlas/atlas_save_test.v @@ -188,7 +188,7 @@ fn test_save_and_load_with_images() { col := a.get_collection('docs')! // assert col.images.len == 1 - assert col.image_exists('test')! + assert col.image_exists('test.png')! // // Save // a.save(destination_meta: '/tmp/atlas_meta')! @@ -199,9 +199,9 @@ fn test_save_and_load_with_images() { // loaded_col := a2.get_collection('docs')! // assert loaded_col.images.len == 1 - // assert loaded_col.image_exists('test')! + // assert loaded_col.image_exists('test.png')! - img_file := col.image_get('test')! + img_file := col.image_get('test.png')! assert img_file.name == 'test.png' assert img_file.is_image() } diff --git a/lib/data/atlas/collection.v b/lib/data/atlas/collection.v index 4944cbe5..0cf30aec 100644 --- a/lib/data/atlas/collection.v +++ b/lib/data/atlas/collection.v @@ -104,7 +104,7 @@ pub fn (c Collection) page_get(name_ string) !&Page { // Get an image by name pub fn (c Collection) image_get(name_ string) !&File { - name := texttools.name_fix(name_) + name := texttools.name_fix_keepext(name_) mut img := c.files[name] or { return FileNotFound{ collection: c.name file: name @@ -117,7 +117,7 @@ pub fn (c Collection) image_get(name_ string) !&File { // Get a file by name pub fn (c Collection) file_get(name_ string) !&File { - name := texttools.name_fix(name_) + name := texttools.name_fix_keepext(name_) mut f := c.files[name] or { return FileNotFound{ collection: c.name file: name @@ -129,7 +129,7 @@ pub fn (c Collection) file_get(name_ string) !&File { } pub fn (c Collection) file_or_image_get(name_ string) !&File { - name := texttools.name_fix(name_) + name := texttools.name_fix_keepext(name_) mut f := c.files[name] or { return FileNotFound{ collection: c.name file: name @@ -145,20 +145,20 @@ pub fn (c Collection) page_exists(name_ string) !bool { // Check if image exists pub fn (c Collection) image_exists(name_ string) !bool { - name := texttools.name_fix(name_) + name := texttools.name_fix_keepext(name_) f := c.files[name] or { return false } return f.ftype == .image } // Check if file exists pub fn (c Collection) file_exists(name_ string) !bool { - name := texttools.name_fix(name_) + name := texttools.name_fix_keepext(name_) f := c.files[name] or { return false } return f.ftype == .file } pub fn (c Collection) file_or_image_exists(name_ string) !bool { - name := texttools.name_fix(name_) + name := texttools.name_fix_keepext(name_) _ := c.files[name] or { return false } return true }