aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/image.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-06-16 14:43:16 +0200
committerThomas White <taw@physics.org>2021-06-16 14:43:16 +0200
commit3fffe0c4cb5efb4c33e819708f0808aa419ea678 (patch)
tree411c14185c26538894a80dfbe28b0398e9a321c2 /libcrystfel/src/image.c
parent81947acbea8cea233d29d85c6625b5cfe113e468 (diff)
Add DST_NONE for 'no data source' (e.g. image came from stream)
Diffstat (limited to 'libcrystfel/src/image.c')
-rw-r--r--libcrystfel/src/image.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c
index ae143480..f25f70d2 100644
--- a/libcrystfel/src/image.c
+++ b/libcrystfel/src/image.c
@@ -366,6 +366,11 @@ static int read_header_to_cache(struct image *image, const char *from)
{
switch ( image->data_source_type ) {
+ case DST_NONE:
+ ERROR("No data source for %s %s - not loading header\n",
+ image->filename, image->ev);
+ return 1;
+
case DST_HDF5:
return image_hdf5_read_header_to_cache(image, from);
@@ -444,7 +449,7 @@ static DataSourceType file_type(const char *filename)
{
if ( !file_exists(filename) ) {
ERROR("File not found: %s (file_type)\n", filename);
- return DST_UNKNOWN;
+ return DST_NONE;
}
if ( is_hdf5_file(filename) ) {
@@ -757,6 +762,11 @@ static int image_read_image_data(struct image *image,
switch ( image->data_source_type ) {
+ case DST_NONE:
+ STATUS("No data source for %s %s - not loading.\n",
+ image->filename, image->ev);
+ return 1;
+
case DST_HDF5:
return image_hdf5_read(image, dtempl,
image->filename, image->ev);