How to Reduce image(resize) base 64 image string below 64000 bytes RRS feed

  • Question

  • Hello Everyone, 

          I have an image binary data(base64 encoded string) to show in android(mobile) device. Mobile device won't allow if it's size exceeds 64000 bytes. How to resize that image binary data(base 64 encoded string) to show in mobile using c# without exceeding 64000 bytes. 

    please share any reference to reduce base 64 encoded string of an image. 


    Thursday, July 16, 2020 12:39 PM

All replies

  • Did you consider reducing the size or quality of the image? (Get the image from string, transform it and obtain the string until it is short enough).

    Thursday, July 16, 2020 2:21 PM
  • Where is this limit defined? Are you talking about when you're sending data over HTTP, via a URL, the image size of the resultant file?? Where the limit is being applied impacts the solution.

    If you're referring to getting an OOM when loading the image then Android already has a page that talks about this. but this isn't really related to C# at all, which is what this forum is about. If you're running into the issue on the Android side then you should be using the Android forums. If you're using Xamarin then try in their forums. If you are calling an API on the server side written in C# then personally I don't think it is related to Android at all and you should make your API smart enough to allow the client to specify how big the image should be and then scan accordingly (or use images that are in multiple resolutions).

    Michael Taylor http://www.michaeltaylorp3.net

    Thursday, July 16, 2020 3:46 PM