Skip to content

Commit

Permalink
fix: handle more pbf formats
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Mar 7, 2023
1 parent bc7e733 commit c27256c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src-tauri/src/tiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ pub fn get_tile_details(path: &Path) -> Result<TileMeta> {

let tile_format = match get_data_format_via_query(tile_name, &connection, "tile") {
Ok(tile_format) => match tile_format {
DataFormat::Unknown => return Err(Error::UnknownTileFormat(String::from(tile_name))),
DataFormat::Unknown => DataFormat::Pbf,
DataFormat::Gzip => DataFormat::Pbf, // GZIP masks PBF format too
_ => tile_format,
},
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub fn decode(data: Vec<u8>, data_type: DataFormat) -> Result<Vec<u8>> {
z.read_to_end(&mut s).unwrap();
Ok(s)
}
_ => Err(Error::InvalidDataFormat(String::from(data_type.format()))),
_ => Ok(data),
}
}

Expand Down

0 comments on commit c27256c

Please sign in to comment.