title: How to reduce Image Base64 data string length using Swift 4.2?
body: <p>My scenario, I am trying to get <code>Image data</code> for <code>upload</code> to <code>server</code>. Here, I am getting huge <code>data</code> string length. Is there anything possibility to get short string without reducing <code>image</code> file resolution.</p>
  
  <p>My Code for Image Data </p>
  
  <pre><code>let image = self.attachment_one_img.image
  let imageData = image?.jpegData(compressionQuality: 1)
  let base64String = (imageData)?.base64EncodedString(options: NSData.Base64EncodingOptions(rawValue: 0))
  let trimmedString_one = base64String?.trimmingCharacters(in: .whitespaces)
  Print(trimmedString_one) // I am getting huge data string length 
  </code></pre>