Resizing with the Camera control


Peter Bradstreet
Hi David,

I'm just looking for a little advice. I will be inserting images into the app and storing them in the Firestore database. I will be allowing the user to either take the photo using their device or select from the device's gallery as per your AB1 sample 'Camera 3'.

In order to speed up the app, I want to limit the size of the stored images. If the saved image is portrait, I want to resize it to a maximum height of 320px and if it is landscape, I want to resize it to a maximum width of 320px before I upload the image.

I was wondering what your suggested method would be for doing this? It looks like the camera control can be used to scale the image if they take the picture but not if they select an existing picture from their device?

Cheers, Pete

decsoft

Hello Peter,

It's curious. According to the documentation, the "targetWidth" and "targetHeight" do not mention the "issue" with the "photolibrary". I know the AB documentation mention it, that is, apaprently these options can't work if we use the "photolibrary" option. Well... I just try it right now and apparently the options working as expected. So I can't be sure why the AB help says other thing...

You can try it by yourself, Peter, I just use the "Camera3" sample app too, and just set a "TargetWidth=100", leaving "TargetHeight=-1". And apparently works like expected in both cases: if we made a photo using the camera, or if we choose an image from the "photogallery". Maybe we can resize an image using some JavaScript techniques, however, since you use the Camera control, maybe the referred options are enough.


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.