joto / osmium

C++/Javascript framework for working with OSM files.
http://wiki.openstreetmap.org/wiki/Osmium
GNU General Public License v3.0
123 stars 31 forks source link

error "BlobHeader size invalid" when input filename contains dots #74

Open mtmail opened 11 years ago

mtmail commented 11 years ago

There is special logic for handling filenames containing dots in order to identify .osm.bz2 and other compression formats. https://github.com/joto/osmium/blob/master/include/osmium/osmfile.hpp#L457

This fails when the input filename is for example 'some.body.osm'. The error message is "what(): BlobHeader size invalid:1010792557 Aborted (core dumped)"

Test case: ~/osm-tools/osmium/osmjs/osmjs -j ~/osm-tools/osmium/osmjs/js/testgeom.js /tmp/palermo.streets.osm

I don't know if it worth adding more logic or simply let it fail with a more descriptive error message. The work-around for me (renaming the input file) was trivial :)