- Home
- Forum
- Xamarin.Forms
- Resize image before sending it to the server using an API
Resize image before sending it to the server using an API
Hey!
I have an app (Android & iOS) with a camera function. With this function, the user can simply click on a button to open te camera app, take a picture and this picture is then send to the server with an API:

Now I have a new camera function with an in-app camera (so that the camera app isn't needed anymore). Now the user can take a picture, which is then showed in Syncfusion image editor (rotation and cropping). This image should then be send to the API:

Now I have the following problem: the picture size is too big and the system rejects pictures which are too big.
You can see in the first image that I resize the picture to medium so that the system can handle the image. If I don't do this, the image will simply not be send to the server. Problem is that I have no idea how to do this resizing in the Image Editor.
Anyone that can help?
Best regards,
Ganesh
Greetings from Syncfusion.
From your update, you are loading the saved image stream to the server API and before that, you have to resize the image, which is loaded in the SfImageEditor then, please use the below KB
https://www.syncfusion.com/kb/9400/how-to-resize-the-image-with-imageeditor
Query: the picture size is too big and the system rejects pictures which are too big.
This update is mainly to get the confirmation of your reported issue to proceed with this without any misleading.
Are you facing any problem on loading the large size image to SfImageEditor if then could you please share us with a screenshot with used device configuration?
Are you faced any crash issues while loading large-size image?
Are you saving the image with jpg format since by default file size will be compressed while saving with jpg format?
Regards,
Sridevi S.
Hemalatha M.
This update is mainly to get the confirmation of your reported issue to proceed with this without any misleading.
Have you saved the image in JPEG format?
If you are saving the image in JPEG format, the image quality will be lost from its original image quality and it is not our ImageEditor control side issue. (it’s framework side image process issue). To overcome this problem, you can save the image in PNG format.
Let us know if you need any further assistance.
Regards,
Sridevi S.
- 8 Replies
- 5 Participants
-
GG Ganesh Gebhard
- Dec 9, 2020 02:07 AM UTC
- Mar 15, 2021 12:05 PM UTC