Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Is there a way to set an image size when using the photos module?
-
Hello everyone,
I am working with some facial recognition api’s and am wondering if there is a way for me to set a specific image size when using the photos module. I have been searching the docs and the forums but Im not having any luck.
Any ideas?
Thank you in advance,
Colin
-
@inzel Sorry, I don't understand. Do you want to resize an image?
-
Resizing would be fine as well actually. I was originally wondering if there is a way to set the size of the image when you save it but resizing afterwards would be fine too.
Does that make sense?
Thanks!
-
@inzel I'm really sorry but I don't understand yet.
You have an image in your script and you want to set the size and save it in camera roll photos? If yes, what kind of image is it: ui.Image or PIL Image? -
@cvp I get what you are asking. Sorry for the confusion...
I have a script that uses the photos module to capture an image. I then use BytesIO to save the output as JPEG then base64 encoded so I can send it to an api. I want to figure out a way to make sure the resolution of the captured photo isnt above a certain size before I send it to the api to cut down on the filesize. I am hoping this will help with uploading the image on slower networks since it doesnt need to be that large. Since the photo is a PIL image when captured can I set it then or change it with the Images module? I have been trying to research this but am still not the greatest at code haha
Hopefully that makes sense?
Thanks again for the help,
Colin
-