Resize images permanently over the API

Hi!
I am attempting to resize images permanently (during creation of a task over the WebODM API, prior to starting processing), but cannot seem to parse the option to ODM.

I see one resize function is used in a test, in the APIClient - class:

            res = client.post("/api/projects/{}/tasks/".format(project.id), {
                'images': [image1, image2, multispec_image, gcp],
                'name': 'test_task',
                'processing_node': pnode.id,
                'resize_to': img1.size[0] / 2.0
            }, format="multipart")

I cannot seem to initiate the similar in-browser resize method during task creation prior to starting from the API. Is the method exposed over the api?

thanks!

1 Like

Welcome!

I’m sorry, but I’m not terribly familiar with this side of things, and I’m sorry you’ve hit a bit of a wall here.

Are you attempting to make your own interface to ODM, or are you working just over REST?

Hi Saijin, Thanks for the reply. Thanks also for all the massive efforts you guys put in to keep this great community. I have got a lot of help here.

Yes, I am running odm over the API, works great, but I cant resize them prior to setting up the task. There is a resize function in webodm

[app/models/task.py](https://github.com/OpenDroneMap/WebODM/blob/9c499aad83f0b3d5e255e8bbb30c7e973c0fb00e/app/models/task.py) 

When sending a POST request, the local method in ODM is accessed:

https://github.com/OpenDroneMap/ODM/blob/1042e50a4943484dccd939d1b19cb1f2f50e7be1/contrib/resize/resize.py

I cannot seem to access either of the methods when setting up the task. the resize-to accesses, but that is only during sfm reconstrution, and I am not sure what the test does. If it is accessible I can add this to the documentation. If not, I could attempt to add the it to the api.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.