GDAL Error 4 triggers when working with geo-referenced jpeg


ashnair0007@...
 
Edited

I used gdal_translate to convert a geotiff to a jpg with jpg.aux.xml file.  The following is part of the script I used to get and write the tiles to disk

import rasterio as rio

im = rio.open('./rgb.tif')
meta = im.meta.copy()

for window, transform in get_tiles(w,h,im):
   tile_name = f"{window.col_off}_{window.row_off}"
   meta["transform"] = transform
   meta["width"], meta["height"] = window.width, window.height
   outpath = "./tiles/" + tile_name
   with rio.open(outpath, "w", **meta) as outds:
       outds.write(self.im.read(window=window))

Now when the input is the original geotiff, writing the tiles to disk works perfectly. However, if my input is the jpeg that I created via gdal_translate, writing to tiles still works however it keeps printing out 
ERROR 4: tiles/0_0.jpg: No such file or directory for each tile. So it'll go something like this:

ERROR 4: tiles/0_0.jpg: No such file or directory
ERROR 4: tiles/0_1000.jpg: No such file or directory
ERROR 4: tiles/0_2000.jpg: No such file or directory
.........................

and so on despite successfully writing the jpeg tiles. I'm confused as to why this error gets printed out and would appreciate any clarification regarding this behaviour.