aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcrystfel/src/image-hdf5.c6
-rw-r--r--libcrystfel/src/image-hdf5.h2
-rw-r--r--libcrystfel/src/image.c8
3 files changed, 12 insertions, 4 deletions
diff --git a/libcrystfel/src/image-hdf5.c b/libcrystfel/src/image-hdf5.c
index 6b6b70c5..02b83068 100644
--- a/libcrystfel/src/image-hdf5.c
+++ b/libcrystfel/src/image-hdf5.c
@@ -1221,3 +1221,9 @@ struct event_list *image_hdf5_expand_frames(const DataTemplate *dtempl,
}
}
+
+
+int is_hdf5_file(const char *filename)
+{
+ return H5Fis_hdf5(filename);
+}
diff --git a/libcrystfel/src/image-hdf5.h b/libcrystfel/src/image-hdf5.h
index 93f887e6..84a53d99 100644
--- a/libcrystfel/src/image-hdf5.h
+++ b/libcrystfel/src/image-hdf5.h
@@ -64,4 +64,6 @@ extern ImageFeatureList *image_hdf5_read_peaks_hdf5(const DataTemplate *dtempl,
extern struct event_list *image_hdf5_expand_frames(const DataTemplate *dtempl,
const char *filename);
+extern int is_hdf5_file(const char *filename);
+
#endif /* IMAGE_HDF5_H */
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c
index 4b698534..09e1e755 100644
--- a/libcrystfel/src/image.c
+++ b/libcrystfel/src/image.c
@@ -288,7 +288,7 @@ static double get_value(struct image *image, const char *from)
val = strtod(from, &rval);
if ( (*rval == '\0') && (rval != from) ) return val;
- if ( H5Fis_hdf5(image->filename) > 0 ) {
+ if ( is_hdf5_file(image->filename) > 0 ) {
return image_hdf5_get_value(from,
image->filename,
image->ev);
@@ -468,7 +468,7 @@ struct image *image_read(DataTemplate *dtempl, const char *filename,
return NULL;
}
- if ( H5Fis_hdf5(filename) > 0 ) {
+ if ( is_hdf5_file(filename) > 0 ) {
image = image_hdf5_read(dtempl, filename, event);
} else if ( is_cbf_file(filename) > 0 ) {
@@ -536,7 +536,7 @@ struct image *image_read(DataTemplate *dtempl, const char *filename,
} else {
mask_fn = p->mask_file;
}
- if ( H5Fis_hdf5(mask_fn) > 0 ) {
+ if ( is_hdf5_file(mask_fn) > 0 ) {
image_hdf5_read_mask(p, mask_fn, event,
image->bad[i],
dtempl->mask_good,
@@ -636,7 +636,7 @@ ImageFeatureList *image_read_peaks(const DataTemplate *dtempl,
const char *event,
int half_pixel_shift)
{
- if ( H5Fis_hdf5(filename) > 0 ) {
+ if ( is_hdf5_file(filename) > 0 ) {
const char *ext;
ext = filename_extension(filename, NULL);