Skip to content
Snippets Groups Projects
Commit 8fa12284 authored by pascal.mouquet_ird.fr's avatar pascal.mouquet_ird.fr
Browse files

adding new small jpg QL

parent 5bfec8b6
No related branches found
No related tags found
No related merge requests found
...@@ -322,15 +322,29 @@ def create_l2a_ql(b02: Union[str, pathlib.PosixPath], ...@@ -322,15 +322,29 @@ def create_l2a_ql(b02: Union[str, pathlib.PosixPath],
src.height, src.height,
*src.bounds, *src.bounds,
resolution=out_resolution) resolution=out_resolution)
profile.update(nodata=0, if out_path.suffix == ".jpg":
driver="Gtiff", profile.update(nodata=0,
dtype=np.uint8, driver="JPEG",
transform=dst_transform, dtype=np.uint8,
width=dst_width, transform=dst_transform,
height=dst_height, width=dst_width,
tiled=False, height=dst_height,
count=len(file_list)) tiled=False,
count=len(file_list))
profile.pop('tiled', None)
profile.pop('blockxsize', None)
profile.pop('blockysize', None)
else:
profile.update(nodata=0,
driver="Gtiff",
dtype=np.uint8,
transform=dst_transform,
width=dst_width,
height=dst_height,
tiled=False,
count=len(file_list))
with rasterio.open(str(out_path), 'w', **profile) as dst: with rasterio.open(str(out_path), 'w', **profile) as dst:
for id, layer in enumerate(file_list, start=1): for id, layer in enumerate(file_list, start=1):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment