Skip change_datatype things if we're not actually changing the extension

Side-steps a problem with FileParameter in the most efficient way
possible. This likely became a problem for one of Wolfgang's workflow
afer we dropped some earlier unnecessary flushes.
This commit is contained in:
mvdbeek
2023-10-26 15:44:23 +02:00
parent f620b11a94
commit ca5132d7bf
+8 -7
View File
@@ -590,13 +590,14 @@ class Registry:
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):