path was given as a parameter\). NOTE 2: If the parameter is a directory the call is nonblocking; the film object will not have the newly imported images yet. Use a [post-import-film](..//../events/post-imort-film) filtering on that film to react when images are actually imported.
* **return** - _[types.dt_lua_image_t](../../types/dt_lua_image_t)_ - The created image if an image is imported or the toplevel film object if a film was
This will move the image file, the related XMP and all XMP for the duplicates to the directory of the new film and rename them as specified.
Note that the order of the two required parameters is not relevant.
* **image** - _[types.dt_lua_image_t](../../types/dt_lua_image_t)_ - The image to move
* **film** - _[types.dt_lua_image_t](../../types/dt_lua_image_t)_ - The film to move to. To rename a file within the same film, set this to the image's
current film.
* **\[newname\]** - _string_ - \(Optional\) If provided, rename the file with this new name. Must not contain any path
separator characters.
# darktable.database.copy_image
```
function(
image : types.dt_lua_image_t,
film : types.dt_lua_film_t,
[newname : string]
) : types.dt_lua_image_t
```
Physically copies an image to another film.
This will copy the image file and the related XMP to the directory of the new film and
rename them as specified.
If there is already a file with the same name as the image file, it will create a duplicate
from that file instead.
Note that the order of the two required parameters is not relevant.
* **image** - _[types.dt_lua_image_t](../../types/dt_lua_image_t)_ - The image to copy
* **film** - _[types.dt_lua_image_t](../../types/dt_lua_image_t)_ - The film to copy to. To make a copy of a file within the same film, set this to the image's
current film.
* **\[newname\]** - _string_ - \(Optional\) If provided, give the copy this new filename. Must not contain any path separator characters.
* **return** - _[types.dt_lua_image_t](../../types/dt_lua_image_t)_ - The new image
# darktable.database.delete
see [types.dt_lua_image_t.delete](../../types/dt_lua_image_t.delete)