from PIL import Image, ImageFilter import os.path import PIL import numpy as np import time from sentinelhub import BBoxSplitter from pathlib import Path from osgeo import gdal import os from osgeo import gdal from osgeo import osr import numpy as np import os,sys from exif import Image folder_name = 'varanasi/varanasi_1' file_list = [f"{x}" for x in Path(folder_name).iterdir()] for file_path in file_list: with open(file_path, 'rb') as src: img = Image(src) print([img.gps_latitude_ref, img.gps_latitude, img.gps_longitude_ref, img.gps_longitude]) time.sleep(100000) gdal.BuildVRT((folder_name+'/merged.vrt'), file_list) # time.sleep(10) # folder_name = 'tif_2022-09-10' # Convert to JPEG try: gdal.Translate((folder_name+'/out.jpeg'),(folder_name + '/merged.vrt')) except Exception as e: print(e) gdal.Translate((folder_name+'/out.jpeg'),(folder_name + '/merged.vrt'))