Deadwood-ai / deadwood-api

Main FastAPI application for the deadwood backend
GNU General Public License v3.0
0 stars 0 forks source link

updating file_size and cog_size to MB insead of bytes #62

Closed JesJehle closed 4 weeks ago

JesJehle commented 1 month ago

The current display in bytes in quite unreadable in the supabse table and a manual convertsion is needed. I would like to update the upload logic to directly store them as MB.

This would require to update: upload.py

file_size=target_path.stat().st_size / (1024 * 1024),

processing.py

 cog_size=output_path.stat().st_size / (1024 * 1024),

and also update the current value in the database via sql.

@mmaelicke @cmosig what do you think?

mmaelicke commented 1 month ago

Yeah. I think there will be no sub-MB images.

You could even add a ::int (or int( ) in python) and only store integers. I guess the frontend will ignore decimal places anyway.

Go ahead from by side.

cmosig commented 1 month ago

Not sure if necessary as you still need to do a conversion to GB in the frontend.