app: add buffering to reading data files

gimp_data_factory_load_data(): use a GBufferedInputStream so we don't
end up reading files byte-by-byte in the worst case.
This commit is contained in:
Michael Natterer
2018-02-21 22:11:25 +01:00
parent 26cb87aa2d
commit d71ed88592

View File

@ -894,7 +894,9 @@ gimp_data_factory_load_data (GimpDataFactory *factory,
if (input)
{
data_list = loader->load_func (context, file, input, &error);
GInputStream *buffered = g_buffered_input_stream_new (input);
data_list = loader->load_func (context, file, buffered, &error);
if (error)
{
@ -909,6 +911,7 @@ gimp_data_factory_load_data (GimpDataFactory *factory,
gimp_file_get_utf8_name (file));
}
g_object_unref (buffered);
g_object_unref (input);
}
else