Search code examples
androidgoogle-drive-apigoogle-drive-android-api

Android Google Drive API increases file size after re-download


I am using google drive API to store images in google drive. I do some optimizations on image size (decrease image quality) before uploading the file. File is uploaded to appdata folder. After restoring images from google drive, somehow file size of images get increased by a significant amount.

After repeating this behavior, i can see a pattern, which is:

more colorful image is, it's size will increase in that ratio.

i.e black and white image will get a little bump in size and a colored image may get double of its original size.

I wonder how can google drive alter my data.

Original image

Image after restore from google drive

Only single file was deleted for this screenshot

Has anyone noticed similar behavior.


Solution

  • This issue was not a fault of google drive at all, there was a statement to convert JPEG to PNG right before it upload image to google drive.