diff --git a/lib/galaxy/datatypes/registry.py b/lib/galaxy/datatypes/registry.py index 8c14bb64d8d5..ce5f9ad890e5 100644 --- a/lib/galaxy/datatypes/registry.py +++ b/lib/galaxy/datatypes/registry.py @@ -590,13 +590,14 @@ def get_datatype_by_extension(self, ext): return self.datatypes_by_extension.get(ext, None) def change_datatype(self, data, ext): - data.extension = ext - # call init_meta and copy metadata from itself. The datatype - # being converted *to* will handle any metadata copying and - # initialization. - if data.has_data(): - data.set_size() - data.init_meta(copy_from=data) + if data.extension != ext: + data.extension = ext + # call init_meta and copy metadata from itself. The datatype + # being converted *to* will handle any metadata copying and + # initialization. + if data.has_data(): + data.set_size() + data.init_meta(copy_from=data) return data def load_datatype_converters(self, toolbox, use_cached=False):